我已经创建了本机项目的.apk。在android 5和6版本的设备上运行正常。在更高版本的设备中失败。
我已使用下面的链接创建签名的apk文件。
https://facebook.github.io/react-native/docs/signed-apk-android#docsNav
当我使用react-native run-android在更高版本的设备中安装react-native项目时,它工作正常。但是,如果是.apk,则会失败。
您能帮我解决这个问题吗,
我的package.json文件是
{
"name": "awsUpload",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"aws-sdk": "^2.395.0",
"link": "^0.1.5",
"react": "16.6.3",
"react-native": "^0.58.3",
"react-native-aws3": "0.0.8",
"react-native-device-info": "^0.26.2",
"react-native-fetch-blob": "^0.10.8",
"react-native-file-upload": "^1.0.4",
"react-native-image-picker": "^0.28.0",
"react-native-material-dropdown": "^0.11.1",
"react-native-navigator": "^0.4.2",
"react-native-router-flux": "^4.0.6",
"react-navigator": "0.0.0-0",
"uniqid": "^5.0.3"
},
"devDependencies": {
"babel-core": "7.0.0-bridge.0",
"babel-jest": "24.0.0",
"jest": "24.0.0",
"metro-react-native-babel-preset": "0.51.1",
"react-test-renderer": "16.6.3"
},
"jest": {
"preset": "react-native"
}
}
在日志中,它给出以下错误,
Failed to get property persist.sys.media.traces
java.lang.IllegalStateException: Handler (android.os.Handler) {e12e3b3} sending message to a Handler on a dead thread
答案 0 :(得分:0)
我正在使用一组代码来获取设备位置。由于安全原因,在更高版本的Android设备中,它不允许我的应用程序获取它。我通过参考以下链接添加了android设备权限。
链接是
https://stackoverflow.com/questions/45822318/how-do-i-request-permission-for-android-device-location-in-react-native-at-run-t