I generated a project using React-Native and followed the official RN guide to publish to Play Store.
When I get to the buildRelease step. This outputs the following error:
Execution failed for task ':java:packageReleaseBundle'.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Version code not found in manifest.
When I use assembleRelease however, the build creates an apk without any issues. What am I missing?
The default config under app/build.gradle is configured as such:
defaultConfig {
applicationId "com.company.appname"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0.0"
missingDimensionStrategy 'react-native-camera', 'general'
}
In my case, i had to disable enableSeparateBuildPerCPUArchitecture
def enableSeparateBuildPerCPUArchitecture = false
Related
I´m using flutter version 3.4.0 with cloud_firestore version ^4.1.0 and I´m getting this error:
`Execution failed for task ':app:processDebugMainManifest'
Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:cloud_firestore]`
How should I change version of the minSdk from 16 to 19?
This is my defaultConfig:
`
defaultConfig {
applicationId "com.example.example"
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
`
Add this line into your local_properties :
flutter.minSdkVersion=21
Then in your build.gradle under the app folder find the defaultConfig and replace value of minSdkVersion for localProperties.getProperty(‘flutter.minSdkVersion’).toInteger()
To finish just type commands flutter clean and flutter pub get
you need to modify it in your build.gradle file.
see: Flutter Execution failed for task ':app:processDebugResources'
Hope it works!
I was trying to add Firebase Crashlytics to my app and I followed this tutorial. When I ran the app, I am getting the following duplication runtime exception.
Execution failed for task ':app:mergeDebugResources'.
> [string/com.crashlytics.android.build_id] /home/chinkysight/Desktop/Pecha/build/app/generated/fabric/res/debug/values/com_crashlytics_build_id.xml [string/com.crashlytics.android.build_id] /home/chinkysight/Desktop/Pecha/build/app/generated/crashlytics/res/debug/values/com_crashlytics_build_id.xml: Error: Duplicate resources
Try to delete your build folder in app/build. And then try a clean build
Might be you have not enabled multidex,
Please go to app/build.gradle, if it is not enabled then enable it and restart the app again.
here is how you can do that:
Goto ->
/android/app/build.gradle and add
multidrxEnabled true
In defaultConfig
It should look like this:
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.chat_app_flutter_firebase"
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
//Enable multidex by adding this line
multiDexEnabled true
}
While adding react-native-notifications package using npm i react-native-notifications and setting all the required steps for the android platform, still getting:
Could not resolve project :reactnativenotifications
Please add the missing part in the android's build.gradle file under "android/app/build.gradle' as per the docs: [1]
defaultConfig {
applicationId "com.packagename.app"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
+ missingDimensionStrategy "RNNotifications.reactNativeVersion", "reactNative60" // See note below!
-
-
}
Use "reactNative60" for 0.60.x and above and "reactNative59" for 0.59.x and below.
So I am having this strange error when I try to compile my Qt application for Android. My build.gradle is practically (except for package name) the same as this one here https://github.com/Larpon/QtFirebaseExample/blob/master/App/platforms/android/build.gradle. When I try to compile however I get a long list of errors beginning with:
What went wrong: Execution failed for task ':transformDexArchiveWithExternalLibsDexMergerForDebug'.
BUILD FAILED in 8s 21 actionable tasks: 8 executed, 13 up-to-date com.android.builder.dexing.DexArchiveMergerException: Error while
merging dex archives:
I have read similar threads on here which suggest enabling multiDexEnabled = true, I have already tried and also tried to clean my app but it doesn't work. I have also tried to add implementation 'com.android.support:multidex:1.0.3' in the dependencies section of my build.gradle but no luck. Finally I have also set but nothing works.
defaultConfig {
applicationId "packagename" // Used by Firebase auto-config (the google-services.json from Firebase console)
minSdkVersion 23
targetSdkVersion 28
//versionCode 1
//versionName "1.0"
//testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
// Enabling multidex support.
multiDexEnabled = true
}
So I was able to fix the problem by migrating to AndroidX as noted here https://developer.android.com/jetpack/androidx/migrate. After modifying the necessary files the compilation error disappeared.
I'm trying to automate publishing an app to the Google Play store using the Gradle Play Publisher. So far so good except that I haven't been able to update the version_name this way, it just ignores it.
I Tried ./gradlew publishRelease -Dversion_name=3.0.0. It looks like it's due to Google Play API limitations. If I run ./gradlew assembleRelease -Dversion_name=3.0.0 to generate the apk and then upload the apk manually it correctly uploads with the version 3.0.0. Just want to make sure is it not possible to upload the version name vía Google Play Developer API or is it an issue of Gradle Play Publisher?
build.gradle
def version_name = System.getProperty("version_name")
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
minSdkVersion 16
targetSdkVersion 23
versionCode version_code
versionName "${version_name}"
renderscriptTargetApi 23
renderscriptSupportModeEnabled true
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
}
EDIT:
Following R. Zagórski suggestions I tried:
1.
./gradlew assembleRelease -Dversion_name=3.0.0 publishRelease
and
2.
./gradlew assembleRelease -Pversion_name=3.0.0 publishRelease
build.gradle
def version_name = project.getProperty("version_name")
println "version name: "+version_name
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
minSdkVersion 16
targetSdkVersion 23
versionCode version_code
versionName "${version_name}"
renderscriptTargetApi 23
renderscriptSupportModeEnabled true
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
...
}
But still nothing. Just to be clear the problem is not that I'm not getting the version_name or the wrong version_name in the build, in fact that println you see there prints the right version. Is just that I'm not getting anything at all in the Google play store (see image below).
This is not the issue of plugin or API. This is just how gradle works. Other answers indicating the problem are here or here.
Basically the problem is that gradle might create a JVM fork processes to complete the tasks. Therefore, when running publishRelease, which depends on
assembleRelease, separate process might be created to finish assembling before publishing. And you pass system property to publish taksand not assemble task.
The solution might be to run two tasks simultaneously, passing argument to appropriate one:
./gradlew assembleRelease -Dversion_name=3.0.0 publishRelease
Or set project property instead of system property as described here