Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to build on android #33

Closed
optikalefx opened this issue Apr 5, 2016 · 6 comments
Closed

Fails to build on android #33

optikalefx opened this issue Apr 5, 2016 · 6 comments

Comments

@optikalefx
Copy link

With using github (https://github.com/pushbots/phonegap) or the official repo (pushbots-cordova-plugin) building for android fails.

cordova v 6.0.0
phonegap v 6.0.1
Mac os 10.11.13
node v 5.9.1

:compileArmv7DebugNdk
 UP-TO-DATE


:compileArmv7DebugSources


:transformClassesWithDexForArmv7Debug

UNEXPECTED TOP-LEVEL EXCEPTION:

com.android.dex.DexException: Multiple dex files define Landroid/support/annotation/AnimRes;
    at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
    at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
    at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
    at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
    at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
    at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
    at com.android.dx.command.dexer.Main.run(Main.java:246)
    at com.android.dx.command.dexer.Main.main(Main.java:215)
    at com.android.dx.command.Main.main(Main.java:106)




 FAILED



FAILURE: 
Build failed with an exception.



* What went wrong:

Execution failed for task ':transformClassesWithDexForArmv7Debug'.

> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2


* 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: 36.989 secs

ERROR building one of the platforms: Error code 1 for command: /Applications/MAMP/htdocs/xxx/phonegap/platforms/android/gradlew with args: cdvBuildDebug,-b,/Applications/MAMP/htdocs/xxx/phonegap/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
You may not have the required environment or OS to build this project

Error: Error code 1 for command: /Applications/MAMP/htdocs/xxx/phonegap/platforms/android/gradlew with args: cdvBuildDebug,-b,/Applications/MAMP/htdocs/xxx/phonegap/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true

Fatal error: Command failed: phonegap build android 
@optikalefx
Copy link
Author

So, it doesn't fail alone. It only fails when this plugin is also in the mix. https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK But ONLY when these two are together. It works fine if each is alone

@John-C2
Copy link

John-C2 commented Apr 9, 2016

I'm getting a build failure but only when I have:
PushBots (Latest 1.3.6) and Google Maps (Latest 1.3.9) cordova-plugin-googlemaps together.
Phonegap Build cli-5.2.0

From searching around it seems to be related to the android-support module being fetched by the Google Maps plugin combined with pushbots reference to the same thing, in the attached log you will see:
Fetching plugin "cordova-plugin-android-support-v4" via npm
Pushbots references cordova-plugin-android-support-v4 as well in it's plugin.xml file.

I'm not sure which side has the power to resolve this so that manual changes aren't needed for Phonegap build to run successfully.

Build failure log attached
debug.txt

UPDATE: This forked version with the Android support references modified built successfully:
<plugin spec="https://github.com/olliebennett/phonegap" source="git" />

@optikalefx
Copy link
Author

this was a different error than mine, see BranchMetrics/cordova-ionic-phonegap-branch-deep-linking-attribution#94 (comment) for my soltuion.

@buddywa
Copy link

buddywa commented Apr 18, 2016

Remove the android-support-v4.jar in your Android platforms/android/libs directory.

@AbdullahDiaa
Copy link
Member

That should be fixed with latest release.

@optikalefx
Copy link
Author

Awesome, will test. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants