作者:从了良后 | 来源:互联网 | 2023-08-04 12:05
您好,创建通用apk应用程序后无法在设备上打开并崩溃
反应本机版本:
-
系统:
- 操作系统:macOS Mojave 10.14.6
- CPU:(4)x64 Intel(R)Core(TM)i5-5257U CPU @ 2.70GHz
- 内存:74.69 MB / 8.00 GB
- Shell:3.2.57-/ bin / bash
-
二进制文件:
- 节点:10.16.3-/ usr / local / bin / node
- 纱线:1.17.3-/ usr / local / bin / yarn
- npm:6.9.0-/ usr / local / bin / npm
-
SDK:
- iOS SDK:
平台:iOS 13.2,DriverKit 19.0,macOS 10.15,tvOS 13.2,watchOS 6.1
- Android SDK:
API级别:22、23、24、25、26、27、28、29
构建工具:27.0.3、28.0.3、29.0.2
-
IDE:
react-native-cli:2.0.1
android / app / build.gradle
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetcompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
applicationid "com.detaysoft.mobile.bnet"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 325
versionName "6.3.3"
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true,also generate a universal APK
include "armeabi-v7a","x86","arm64-v8a","x86_64"
}
}
signingConfigs {
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
release {
if (project.hasProperty('RELEASE_STORE_FILE')) {
storeFile file(RELEASE_STORE_FILE)
storePassword RELEASE_STORE_PASSWORD
keyAlias RELEASE_KEY_ALIAS
keyPassword RELEASE_KEY_PASSWORD
}
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"),"proguard-rules.pro"
signingConfig signingConfigs.release
}
}
// applicationVariants are e.g. debug,release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture,set a unique version code as described here:
// https://developer.android.com/studio/build/configure-apk-splits.html
def versiOnCodes= ["armeabi-v7a": 1,"x86": 2,"arm64-v8a": 3,"x86_64": 4]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug,universal-release variants
output.versiOnCodeOverride=
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
packagingOptions {
pickFirst '**/armeabi-v7a/libc++_shared.so'
pickFirst '**/x86/libc++_shared.so'
pickFirst '**/arm64-v8a/libc++_shared.so'
pickFirst '**/x86_64/libc++_shared.so'
pickFirst '**/x86/libjsc.so'
pickFirst '**/armeabi-v7a/libjsc.so'
}
}