BUILD FAILED for android platform
I have this problem with the google-analytics-plugin:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
/usr/local/Cellar/android-sdk/24.4/build-tools/23.0.2/dx --dex --no-optimize --output /Applications/MAMP/htdocs/contaum/app/platforms/android/build/intermediates/dex/debug --input-list=/Applications/MAMP/htdocs/contaum/app/platforms/android/build/intermediates/tmp/dex/debug/inputList.txt
Error Code:
2
Output:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
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)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 58.353 secs
My project infos: Ionic v. 1.7.6 Cordova v.5.3.3 Android platform: [email protected] cordova-plugin-google-analytics 0.8.1 "Google Universal Analytics Plugin"
This problem occour only with the "cordova-plugin-google-analytics" installed.
EDIT: I already update: sdk-tools, platform-tools, Android support Repostory, Android support Libary, Google Play Services, Google Reposiory.
Sorry,
I haven't seen the important note: "If the latest versions (0.8.0+) of this plugin are not working for you with Android on Cordova 5.0+, please try the suggestions in Issues 123."
The suggestions in Issues 123 and command ionic platforms update android works for me!
Sorry and thanks!
We have solved it, by installing the Google Analytics previously and then the onesignal push plugin later