Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build works on local but fails on codemagic | Execution failed for task ':app:stripDebugDebugSymbols'

I'm trying to implement a continuous deployment system to build my app and deploy to Google Play using codemagic. Doing a build works fine locally but fails remotely on codemagic.

Error summary:

FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:stripDebugDebugSymbols'.
> 1 exception was raised by workers:
  org.gradle.process.internal.ExecException: A problem occurred starting process 'command '/usr/local/share/android-sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-strip''

Complete log:

== Building for Android ==

> flutter build appbundle --debug
Running "flutter pub get" in My_Project...                     1,655ms

💪 Building with sound null safety 💪

Running Gradle task 'bundleDebug'...                            
[flutter_background_geolocation] Purging debug resources in release build
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/builder/programs/flutter_2_5_3/.pub-cache/hosted/pub.dartlang.org/geocoding-2.0.1/android/src/main/java/com/baseflow/geocoding/GeocodingPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:stripDebugDebugSymbols'.
> 1 exception was raised by workers:
  org.gradle.process.internal.ExecException: A problem occurred starting process 'command '/usr/local/share/android-sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-strip''


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2m 19s
Running Gradle task 'bundleDebug'...                              141.1s
Gradle task bundleDebug failed with exit code 1


Build failed :|
Failed to build for Android

Current configuration on codemagic:

Flutter channel: stable 
Mode: debug 
Build for: Android
like image 383
eduinvestor Avatar asked Nov 07 '21 19:11

eduinvestor


People also ask

Why execution failed for task ‘:processdebugmanifest’ in Android project?

Many times while building an Android project our Manifest file gets overwritten. So we will get to see this kind of issue as Execution failed for task ‘:processDebugManifest” in Android Project. The error dialog is shown below:

How to fix Gradle task assembledebug failed with exit code 1?

* Get more help at https: //help.gradle.org Exception: Gradle task assembleDebug failed with exit code 1 1. Downloaded Java and set the path. 3. Uninstalled Android Studio and reinstalled again.

How do I fix the NDK error in Android Studio?

some times it is solving by removing ndk from local.properties. Go inside your SDK location and find the directory called ndk then delete the content inside that directory. Then build the app again. Probably the ndk version has corrupted and Android Studio will replace it with the latest.

How to fix Gradle not working in Android Studio?

Double-check the build of your app. gradle. It adds an extra.jar file as a dependency that didn’t exist in your project. As a result, remove that and you’re back on track! If you happen to be running the latest version of Android Studio or the Canary Flavor of the IDE then maybe the issue is there with the certain sdkVersions of your project.


1 Answers

to fix this you need to upgrade Gradle version in android/gradle/wrapper/gradle-wrapper.properties to 6.7.1 or commit gradle wrapper to your repository if you don't have this file.

Additional to that you also might need to upgrade Android Gradle plugin in andriod/build.gradle

- classpath 'com.android.tools.build:gradle:3.5.4'
+ classpath 'com.android.tools.build:gradle:4.2.0'

WITHOUT GRADLE UPGRADE

if for some reasons you can't upgrade Gradle version you can freeze previous NDK version.

For that you can specify ndkVersion "22.1.7171670" in your build.gradle and make sure you use Java 1.8 since there is an issue with using latest Java versions.

In Codemagic you can specify Java version in environment section in your codemagic.yaml like this

workflows:
  workflow-name:
    environment:
      ndk: r22b
      java: 1.8
like image 151
Mikhail Tokarev Avatar answered Sep 20 '22 00:09

Mikhail Tokarev