React-Native Android生成Signed apk:Build Gradle错误

时间:2017-05-11 13:05:40

标签: react-native-android

第2行的Build.gradle错误。 我按照https://facebook.github.io/react-native/releases/0.31/docs/signed-apk-android.html

中描述的步骤进行操作
// Top-level build file where you can add configuration options common to all sub-projects/modules.

signingConfigs {
    release {
        storeFile file(MYAPP_RELEASE_STORE_FILE)
        storePassword MYAPP_RELEASE_STORE_PASSWORD
        keyAlias MYAPP_RELEASE_KEY_ALIAS
        keyPassword MYAPP_RELEASE_KEY_PASSWORD
    }
}
buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.2.3'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}

allprojects {
repositories {
    mavenLocal()
    jcenter()
    maven {
        // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
        url "$rootDir/../node_modules/react-native/android"
    }

}
}

有人可以指出我哪里出错吗?

1 个答案:

答案 0 :(得分:0)

您正在使用android/build.gradle,但您应该在android/src/build.gradle中添加这些行。