Error on adding googlemaps to my android app after updating Android Studio [duplicate] - android

This question already has answers here:
DexIndexOverflowException issue after updating to latest appcompat and support library
(7 answers)
Closed 6 years ago.
How to solve this?
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536

You have reached to 65k method limit.You either remove some dependencies which are not being used or use multidex.
https://developer.android.com/studio/build/multidex.html

Related

Multiple dex files define Lcom/google/android/gms/internal/measurement/zzabn

Since this morning I cannot build my Android app because I get this error
What went wrong: Execution failed for task ':app:transformDexArchiveWithDexMergerForDebug'.
com.android.build.api.transform.TransformException: com.android.dex.DexException: Multiple dex files define
Lcom/google/android/gms/internal/measurement/zzabn;
I have tried bumping the Firebase versions accordingly to 15.0.2 but then I get an other error...
Task :app:processDebugGoogleServices Found com.google.android.gms:play-services-maps:15.0.0, but version 15.0.2
is needed for the google-services plugin.
com.google.android.gms:play-services-maps:15.0.2 is not even released yet?
I have a build to push to production, what is the best way to build the app?
Please update the google-service plugin to:
classpath 'com.google.gms:google-services:3.3.0'
to be able to use the latest version of Firebase and to avoid the errors.
Read the following for more information:
https://android-developers.googleblog.com/2018/05/announcing-new-sdk-versioning.html
Compilation failed to complete:Program type already present: com.google.android.gms.internal.measurement.zzabn
(Posted solution on behalf of the question author).
Removing com.google.gms.google-services at the bottom of my build.build makes it work.

Updating to Android Studio 3.0 Canary 2 give build errors [duplicate]

This question already has answers here:
AAPT2 compile failed: invalid dimen on Android 3.0 Canary 1
(7 answers)
Closed 5 years ago.
Today I updated my Studio to Canary 2 and a strange build error arises:
Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :multipicker:generateDebugSources, :multipicker:generateDebugAndroidTestSources, :multipicker:mockableAndroidJar]
Information:0 errors
Information:0 warnings
Information:See complete output in console
Error:/home/master/AndroidStudioProjects/Reweyou/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:795 invalid drawable
Error:java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.internal.aapt.AaptException: AAPT2 compile failed:
Error:Execution failed for task ':app:mergeDebugResources'.
> Error: java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.internal.aapt.AaptException: AAPT2 compile failed:
aapt2 compile -o /home/master/AndroidStudioProjects/Reweyou/app/build/intermediates/res/merged/debug /home/master/AndroidStudioProjects/Reweyou/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml
Issues:
- ERROR: /home/master/AndroidStudioProjects/Reweyou/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:795 invalid drawable
Information:BUILD FAILED in 11s
I managed to run Android Studio 3 Canary 2 with Gradle 3.0.0-alpha2 based on this answer: https://stackoverflow.com/a/44202755/3936723
I use Linux, and for me this solved the problem:
Open terminal
Type:
export LC_NUMERIC="en_US.UTF-8"
sh ./android-studio/bin/studio.sh
--OLD ANSWER--
It will work in Android Studio 3.0 Canary, if you change Gradle to
classpath 'com.android.tools.build:gradle:2.3.2'
I have the same error with com.android.tools.build:gradle:3.0.0-alpha2 version, rolling back to previous version of Gradle fix a problem for me.
Unfortunately, with older gradle plugin, I can't use advanced options in Android profiler :(
The solution has been provided here.
You need to change your PC regional format for numbers to one that use the dot as decimal mark, like English US / UK.
Android Studio Canary 2 changes Gradle to com.android.tools.build:gradle:3.0.0-alpha2
A workaround is set back to com.android.tools.build:gradle:3.0.0-alpha1

Two Push plugin in single phonegap project

I am trying to use two plugins which use GCM and FCM. But when I try to build the project it failed with following error:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define
Lcom/google/android/gms/actions/ItemListIntents;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:579)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:517)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:164)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:504)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
at com.android.dx.command.dexer.Main.run(Main.java:277)
at com.android.dx.command.dexer.Main.main(Main.java:245)
at com.android.dx.command.Main.main(Main.java:106)
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:
org.gradle.process.internal.ExecException: Process 'command
'/home/karan/jdk1.8.0_91/bin/java'' finished with non-zero exit value 2
I know why "Multiple dex files define" error occurs, this is because when two plugin require same dependencies. But as plugins are third party so how to resolve this error on my end. Please help me to figure out this situation.
PS: Somebody marked this question as duplicate of Android studio 2.0 gradle transformClassesWithDexForDebug fails when using button "run" post. But I want a phonegap solution not Android Studio. :)
Thanks
This is not related to Android Studio at all!
Said dependencies are:
From Realtime Framework
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
and
From hotline-phonegap
compile 'com.android.support:appcompat-v7:22.2.1'
You can manually edit those dependencies to match with each other. You might need to change related Android platform codes for those libraries. Since they are seperate projects from seperate maintainers this seems like your best shot.

Error:Execution failed for task ':Application:transformClassesWithJarMergingForDebug' [duplicate]

This question already has answers here:
TransformException duplicate entry for common.annotations.Beta
(3 answers)
Closed 6 years ago.
While running my android application in android studio, I got the following error:
Error: Execution failed for task':App:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException:
duplicate entry: android/support/annotation/LayoutRes.class
Where does that error come from / how to resolve that issue?
You have added com.android.support:support-annotations: two times. Surely, not directly, but one of your dependencies depends on it. Run from console (inside project folder): gradlew app:dependencies and see what depends on support annotations library.
Then, exclude dependencies

Support Multidex Android studio Below 5.0 [duplicate]

This question already has answers here:
After update of AS to 1.0, getting "method ID not in [0, 0xffff]: 65536" error in project
(2 answers)
Closed 8 years ago.
Multidex: Dex Loader] Unable to execute dex: method ID not in [0, 0xffff]: 65536
By adding below line will solve this issue.
dependencies {
compile 'com.android.support:multidex:1.0.+'
}

Categories

Resources