应用内自动升级,下载安装包后抛出异常,先贴个错误
Log:
android.os.FileUriExposedException: file:///storage/emulated/0/aiyou.apk exposed beyond app through Intent.getData()
问题分析:
1.版本不支持
修改platforms>android
中的AndroidManifest.xml
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="23" />
尽量保持android:targetSdkVersion版本在24以下
If you have an app that shares files with other apps using a Uri, you may have encountered this error on API 24+.
2.权限问题
同样修改AndroidManifest.xml
文件,添加
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
这个主要影响Android 8.x版本
本作品采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议进行许可。