Meenu Agrawal
Meenu Agrawal

Reputation: 27

React-Native Android generate Signed apk: Build Gradle error

Build.gradle error on Line 2. I followed the steps described in 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"
    }

}
}

Can someone please point out where I went wrong?

Upvotes: 1

Views: 244

Answers (1)

Antoine Grandchamp
Antoine Grandchamp

Reputation: 7470

You are working in android/build.gradle, but you are supposed to add those lines in android/src/build.gradle.

Upvotes: 0

Related Questions