Proguard Error : Execution failed for task ':app:transformClassesAndResourcesWithProguardForDebug' - android

I am trying to build app using ProGuard in Android Studio 2.2.3 but I am getting below error :
Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForDebug'.
> Job failed, see logs for details

Do you have a proguard-project.txt file in your project?
If so can you post its content? Also, you can try running 'gradle --stacktrace assemble --debug' for more details about your error.

Related

error: failed linking file resources. without any message to error

I got this error
error: failed linking file resources.
But with no info about error
also, gradle tasks was not found.
Solution is to use
./gradlew build --stacktrace
with terminal this will build app and will show your error

Flutter returns Execution failed for task ':app:transformClassesWithDexBuilderForDebug' as soon as I add packages

I want to make an Android app with Flutter that uses the firebase ml kit to perform text recognition on images. I have successfully added firebase to my flutter project, but as soon as I add the packages image_picker: 0.6.1+4 and firebase_ml_vision: 0.9.2+1 I get the following error:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.dexing.DexArchiveBuilderException: com.android.builder.dexing.DexArchiveBuilderException: Failed to process C:\Users\mathi\.gradle\caches\transforms-1\files-1.1\firebase-analytics-impl-11.4.2.aar\266afe38e9d564b66b359ca5823523b4\jars\classes.ja
The error also occures when I add only one of the two packages.
Update build.gradle to com.android.tools.build:gradle:3.6.0 and do flutter run -v in your build in editor terminal. Because maybe you have to update your gradle-wrapper.properties too in your android folder.

Flutter build failed with D8: Program type already present

I am developing a flutter app.
I found a sample flutter project so folk it.
But the project... build failed with below log message.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:preDebugBuild'.
> Android dependency 'androidx.core:core' has different version for the compile (1.0.0) and runtime (1.0.1) classpath. You should manually set the same version via DependencyResolution
* 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 0s
*******************************************************************************************
The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.
See https://flutter.dev/docs/development/packages-and-plugins/androidx-compatibility for more information on the problem and how to fix it.
*******************************************************************************************
Finished with error: Gradle task assembleDebug failed with exit code 1
The project is not special.
The android part, there are no other modifications.
It is totally same with the "new flutter project'.
I tried something:
Migration to AndroidX
This is failed with error popup. I tried to migration using "refactor > migration to android x", but it shows error popup.
The error popup said to me use compilesdkversion at least 28.
But I already use 28.. what should I do?......
change gradle version from 3.2.1 to 3.3.2.
But build failed with different log
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
D8: Program type already present: android.support.v4.app.INotificationSideChannel
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
Program type already present: android.support.v4.app.INotificationSideChannel
I don't know what should i do...
It make me to tired...
I just want to coding...
I resolve this issue following this link: https://flutter.dev/docs/development/packages-and-plugins/androidx-compatibility
There is 2 migration guide.
Recommended
Not Recommended
In my case, 'Recommended' solution doesn't work...
But, 'Not recommended' solution works...
...
It's not easy...
I tried this two lines of code
flutter clean and then
flutter run

Cordova build android:':app:mergeDebugResources'. failing in Jenkins

After updating the android studio, gradle version and Cordova (incl. platforms) for hybrid project in windows 10 recently, i got this error in Jenkins.
:app:mergeDebugResourcesC:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-25.4.0.aar\76d6a769daf730ed767830374ebcd3bd\res\drawable\abc_btn_colored_material.xml: error: file not found.
...
...
Error: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
:app:mergeDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Error: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
I searched for a solution for this which should be dynamical and can be managed through Jenkins itself since it is not possible to edit individual platform files.
Originally the error was
Execution failed for task ':mergeDebugResources'.
> Error: com.android.builder.internal.aapt.AaptException: Failed to crunch file
which was caused by
Error: File path too long on windows, keep below 240 characters
Workaround for this was to change workspace folder so it is coming to a top level. (eg: C:/Users/[youruser]/yourfolder. Check the link here
Note
I added this question and the answer, for the self reference in future and to assist someone who is working with Jenkins.
The answer is a simple tweak. Go to
Manage Jenkins --> Configure System --> Global Properties
add an Environment variable
name = GRADLE_USER_HOME
value = C:\Users\[youruser]\devGradle
create a folder "devGradle" (or give it any name) if it is not created already.
The Gradle build script will look for this environment variable and then use the specified directory as the Gradle home directory and will build the project

Ionic 2 - Android Build failed with Multiple dex files define Lcom/google/android/gms/common/api/zza

I am working on a professionel project with Ionic 2. I have the presentation with clients coming monday (24/04/2017). Unfortunately from last Friday i am facing a conflict with cordova plugins. The application works well with IOS but build fails with Android. I think the conflict comes with :
cordova-plugin-mauron85-background-geolocation "CDVBackgroundGeolocation"
cordova-plugin-fcm "FCMPlugin"
At the beggining i had a version conflict, so i changed the version into cordova-plugin-mauron85-background-geolocation with framework src="com.google.android.gms:play-services-location:9.0.0". The error was :
Found com.google.android.gms:play-services-location:+, but version 9.0.0 is needed for the google-services plugin.
:processDebugGoogleServices FAILED
After solved the version conflict, now i am facing a new problem. The problem is:
:transformClassesWithDexForDebug
FAILED
>FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/common/api/zza;
And as i have always in my console the following message, i have tried to fix it manually. I tried to apply some solutions that i have found by searches.
The message in console is :
google-services plugin could not detect any version for com.google.android.gms or com.google.firebase, default version: 9.0.0 will be used.
please apply google-services plugin at the bottom of the build file.
The manual fix was adding the following lines in my platforms/android/build.graddle (in correct places):
classpath 'com.google.gms:google-services:3.0.0' (in classpath dependencies)
apply plugin: 'com.google.gms.google-services' (at the bottom of the file)
But i got the following error with this modification, so i deleted them :
>FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
Cannot add task ':processDebugGoogleServices' as a task with that name already exists.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
My platforms/android/project.properties :
target=android-24
android.library.reference.1=CordovaLib
cordova.gradle.include.1=cordova-plugin-fcm/myProjectV2-FCMPlugin.gradle
cordova.gradle.include.2=cordova-plugin-mauron85-background-geolocation/myProjectV2-logtofile.gradle
cordova.system.library.3=com.google.android.gms:play-services-location:9.0.0
cordova.system.library.4=com.android.support:support-v4:+
Hope that i will get some help.
Thanks.

Categories

Resources