I follow in official website : https://facebook.github.io/react-native/docs/signed-apk-android.html
it said line: 128 error
which is
signingConfigs signingConfigs.release
in android/app/build.gradle
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
}
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfigs signingConfigs.release
}
}
in android/.gradle/gradle.properties
MYAPP_RELEASE_STORE_FILE=ezam.keystore
MYAPP_RELEASE_KEY_ALIAS=ezam
MYAPP_RELEASE_STORE_PASSWORD=*****
MYAPP_RELEASE_KEY_PASSWORD=*****
You are adding the config to the wrong file. Add it to app level build.gradle android/app/build.gradle.
see https://github.com/Triple-T/gradle-play-publisher/issues/228#issuecomment-321557581
Honestly spend 3 hours on this issue
buildTypes{
release{
signingConfig // not signingConfigs without "s"
}
}
The signingConfigs
element must be a child of the android
element
apply plugin 'com.android.application'
android {
// (...)
signingConfigs {
release {
// (...)
}
}
buildTypes {
release {
// (...)
signingConfig signingConfigs.release
}
}
}
I experienced the same error because I didn't realise this, and made signingConfigs
a top-level element.
This will give you an error:
apply plugin 'com.android.application'
signingConfigs {
release {
// (...)
}
}
android {
// (...)
buildTypes {
release {
// (...)
signingConfig signingConfigs.release
}
}
}
In my case, I have to do
buildTypes{
release{
signingConfig signingConfigs.release
}
}
instead of
buildTypes{
release{
signingConfig release
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With