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

Error when module included #13

Closed
mattlanham opened this issue Nov 12, 2015 · 6 comments
Closed

Error when module included #13

mattlanham opened this issue Nov 12, 2015 · 6 comments

Comments

@mattlanham
Copy link

When I include the module in my project I am getting the following error, can you let me know how I should go about resolving this?

[ERROR] :  Failed to run dexer:
[ERROR] :  
[ERROR] :  UNEXPECTED TOP-LEVEL EXCEPTION:
[ERROR] :  java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/gcm/GoogleCloudMessaging$1;
[ERROR] :   at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:122)
[ERROR] :   at com.android.dx.dex.file.DexFile.add(DexFile.java:161)
[ERROR] :   at com.android.dx.command.dexer.Main.processClass(Main.java:685)
[ERROR] :   at com.android.dx.command.dexer.Main.processFileBytes(Main.java:634)
[ERROR] :   at com.android.dx.command.dexer.Main.access$600(Main.java:78)
[ERROR] :   at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:572)
[ERROR] :   at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
[ERROR] :   at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
[ERROR] :   at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
[ERROR] :   at com.android.dx.command.dexer.Main.processOne(Main.java:596)
[ERROR] :   at com.android.dx.command.dexer.Main.processAllFiles(Main.java:498)
[ERROR] :   at com.android.dx.command.dexer.Main.runMonoDex(Main.java:264)
[ERROR] :   at com.android.dx.command.dexer.Main.run(Main.java:230)
[ERROR] :   at com.android.dx.command.dexer.Main.main(Main.java:199)
[ERROR] :   at com.android.dx.command.Main.main(Main.java:103)
[ERROR] :  1 error; aborting
TRACE  | titanium exited with exit code 1
ERROR  | Error: ti run exited with error code 1
    at ChildProcess.<anonymous> (/Users/matthewlanham/.appcelerator/install/5.0.4/package/node_modules/appc-cli-titanium/plugins/run.js:92:66)
    at ChildProcess.emit (events.js:98:17)
    at Process.ChildProcess._handle.onexit (child_process.js:809:12)
TRACE  | Sending exit signal to titanium process:  67493
@m1ga
Copy link
Contributor

m1ga commented Nov 12, 2015

do you include other modules? It is a problem with the google services (jars inside the lib folder)

@mattlanham
Copy link
Author

I have just tested a brand new, clean default alloy project with 5.0.2.GA SDK and it doesn't work, so I assume this must be an issue with this module, or it's compatibility with the new SDK?

@morinel
Copy link
Owner

morinel commented Nov 13, 2015

Which Android version are you targeting? Please post the relevant parts of your tiapp.xml.

@mattlanham
Copy link
Author

Turns out it was to do with the inclusion of google play services within this module, how would you get around this, seems a little crazy for it to clash on this? https://github.com/Sitata/titanium-google-analytics

@m1ga
Copy link
Contributor

m1ga commented Nov 13, 2015

There are multiple bugs in jira about including multiple modules that bring their own version of the play-services (it gets tricky when you use maps and a different version). But you can use a stripped version of the play services, that only include the stuff you need. That mimizes the collisions.

E.g. Ti.GA has a pull request with a stripped version (benbahrenburg/Ti.GA#6). It smaller too.

I guess you could use something like https://gist.github.com/dextorer/a32cad7819b7f272239b to just use the gcm stuff inside the services

@morinel
Copy link
Owner

morinel commented Nov 13, 2015

Yes, please open a ticket for the other module to strip their version of the shipped Google Play Services jar. I've limited the version used in gcmpush already.

OTOH, it would be nice if there was a workaround for this provided by Appcelerator

@morinel morinel closed this as completed May 26, 2016
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

3 participants