-
Notifications
You must be signed in to change notification settings - Fork 39
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
Cannot Build Android Release APK #1
Comments
Hi Marco. The output for I have no experience building APK releases but I would try to clean the project and rebuild. Check the directories where the intermediate files are gathered. If the problem persists it may be that some other library on your project is including the CDI (javax.inject) with different coordinates. Unlikely, but possible. Check these SO threads:
You can also add an explicit exclude in the gradle build file, but I think you should understand the root cause before going that way. Check this: http://blog.gaku.net/multiple-dex-files-define-with-gradle/ |
I'm closing this at I don't think is a bug of the library. Marco, please share your findings when you manage to solve this. |
I think it's actually the WorkaroundTo get around this, I used this approach:
|
Yes, you are right. I totally missed the repackaged javax.inject ( Seems a problem with javax.inject, look at this: http://stackoverflow.com/questions/24598961/this-dependency-gives-me-two-versions-of-one-jar-how-do-i-fix-this Seems that the problem is HK2, the dependency injection framework used by Jersey. Explained here: http://stackoverflow.com/questions/25212944/why-does-hk2-repackage-everything Thanks for the research! You can also exclude the other way; exclude the repackaged HK2 which may provide more sense. It does for me so I've included this in my projects depending on mailgun:
Or even better (to include test suites, for example):
|
I am trying to run this in eclipse and no matter what I try to exclude/include some of the hk2 dependency when I run my code and try to use the mailgun wrapper you wrote I get the following: Exception in thread "Thread-10" java.lang.NoSuchMethodError: org.glassfish.hk2.api.ServiceLocatorFactory.create(Ljava/lang/String;Lorg/glassfish/hk2/api/ServiceLocator;Lorg/glassfish/hk2/extension/ServiceLocatorGenerator;Lorg/glassfish/hk2/api/ServiceLocatorFactory$CreatePolicy;)Lorg/glassfish/hk2/api/ServiceLocator; I am using maven in eclipse. Any idea? |
Hi. Thanks for reporting. Could you please post your pom.xml and the full stacktrace? |
I get following exceptions with your mailgun 1.1.0. FATAL EXCEPTION: main in my app level gradle, defaultConfig { dependencies { I use Android Studio 2.1.2. |
@danmtplay Can you post the full stack trace? I see that in ClientRuntime.java:261 it is repackaging the thrown Exception as a ProcessingException. With more of the stack trace we could see the cause (caused by ... etc) |
Thanks @MarkyC for the help. Also, @danmtplay , post how are you invoking the library to send the message. Thanks. |
Thanks @MarkyC, @sargue for help. this is my exception full stack. and this is my module to send message to mailgun. Mail.using(conf).to("Dan Matei", "danmtplay@hotmail.com") this is my app level build.gradle. this is my project level build.gradle. this is my current gradle version. my jdk version - jdk1.8.0_74.jdk could you let me know what is error? Thanks again. |
I am not an Android expert but it seems you can't run network code in the main thread. See this: http://stackoverflow.com/questions/6343166/how-to-fix-android-os-networkonmainthreadexception |
Thanks @sargue. You are right. Thanks again. |
I am using Glassfish 4.0 with Java 8.x and JEE 7.0. I get the following exception when I try to build and create a war file. Exception:
Here is my POM.xml
I would appreciate any help. Thanks in advance. |
Hello!
First off, thank you for this library, it has immensely sped up my development time!
I'm trying to include this library in my Android app. When building for development, everything works fine, but when I build my release APK, I get this error:
When I run
gradle -q dependencies
, I see that there is multipleInject
s defined:Is there a way around this?
The text was updated successfully, but these errors were encountered: