构建失败生成的构建 APK 反应原生 [英] Build Failed Generated Build APK react native
问题描述
我想要生成构建 apk 但在 cd android && 之后./gradlew assembleRelease 构建失败.
I Want generated build apk but after cd android && ./gradlew assembleRelease build failed.
我的信息:
* What went wrong:
Could not list contents of '/Users/sweet/Desktop/phase/ka-
mobile/node_modules/react-native/third-party/glog-0.3.4/test-driver'.
Couldn't follow symbolic link.
我已经把 my-release-key.keystore 放在 android/app 下并更改 android/app/build.gradle
i already put my-release-key.keystore under android/app and change android/app/build.gradle
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.kickavenue"
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
signingConfigs {
release {
if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
storeFile file(MYAPP_RELEASE_STORE_FILE)
storePassword MYAPP_RELEASE_STORE_PASSWORD
keyAlias MYAPP_RELEASE_KEY_ALIAS
keyPassword MYAPP_RELEASE_KEY_PASSWORD
}
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release
}
}
并更改 android/gradle.properties 或更改 ~/.gradle/gradle.properties
and change android/gradle.properties or change on ~/.gradle/gradle.properties
android.useDeprecatedNdk=true //only on android/gradle.properties i write
MYAPP_RELEASE_STORE_FILE=my-release-key.keystore
MYAPP_RELEASE_KEY_ALIAS=my-key-alias
MYAPP_RELEASE_STORE_PASSWORD=sample
MYAPP_RELEASE_KEY_PASSWORD=sample
我构建生成的 APK 的步骤有误
there is wrong my step to build genereated APK
推荐答案
您使用的是什么版本的 RN?这个问题出现在 RN 0.46.3 上,如 React Native 的 github 上所述:https://github.com/facebook/react-native/issues/14464
What version of RN are you using? This issue appears on RN 0.46.3 as stated on React Native's github: https://github.com/facebook/react-native/issues/14464
你可以升级到 React Native 0.47.0 来解决这个问题.
You could upgrade to React Native 0.47.0 to fix the issue.
这篇关于构建失败生成的构建 APK 反应原生的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!