【问题标题】:Build Failed Generated Build APK react nativeBuild Failed Generated Build APK react native
【发布时间】:2017-09-18 01:09:35
【问题描述】:

我想要生成构建 apk,但在 cd android && ./gradlew assembleRelease 构建失败之后。

那里有我的信息:

* 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

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

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 的步骤有误

【问题讨论】:

    标签: android react-native react-native-android


    【解决方案1】:

    您使用的是哪个版本的 RN?如 React Native 的 github 所述,此问题出现在 RN 0.46.3 上:https://github.com/facebook/react-native/issues/14464

    你可以升级到 React Native 0.47.0 来解决这个问题。

    【讨论】:

      【解决方案2】:

      尝试删除node_modules 中的.bin 文件夹

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2022-08-15
        • 1970-01-01
        • 1970-01-01
        • 2014-03-03
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多