我正在使用React-native:
"dependencies": {
"native-base": "^2.13.4",
"react": "16.8.6",
"react-native": "0.60.4",
"react-native-elements": "^1.1.0",
"react-native-geolocation-service": "^3.0.0",
"react-native-gesture-handler": "^1.3.0",
"react-native-image-picker": "^1.0.1",
"react-native-linear-gradient": "^2.5.6",
"react-native-reanimated": "^1.1.0",
"react-native-sqlite-storage": "^3.3.11",
"react-native-textinput-effects": "^0.5.1",
"react-native-vector-icons": "^6.6.0",
"react-navigation": "^3.11.1",
"react-navigation-drawer": "^2.0.0",
"react-redux": "^7.1.0",
"redux": "^4.0.4",
"rn-fetch-blob": "^0.10.16"
},
并按照以下步骤获取APK版本:https://facebook.github.io/react-native/docs/signed-apk-android
问题是,当我第一次在设备中安装APK时,它的安装状况良好,但是当我打开它时,会发生此错误:“应用程序停止停止” https://user-images.githubusercontent.com/33368907/42800339-0bed041c-89b9-11e8-9103-bfafd6592349.gif
如果我卸载该应用程序并再次安装,则会发生这种情况:https://i1.wp.com/www.ryadel.com/wp-content/uploads/2018/02/android-app-not-installed.jpg?resize=768%2C432&ssl=1
通过“ react-native run-android”(通过usb)安装不会产生任何错误,但是当我创建APK时会出现错误。我不知道问题是什么。
这些是我的文件:
buildGradle:
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
}
Androidmanifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.geslubapp">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />
<uses-permission android:name="android.permission.CAMERA" />
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>
</manifest>