Multiple dex files define Lorg/apache/harmony/awt/internal/nls/Messages - android

I am currently developing android application which is in include "Generate PDF" and "Send mail with out user interacting (Send mail in background)". I am using 4 library. activation.jar, additionnal.jar, mail.jar & droidText.0.2.jar. When i run this project it's give error.
[2014-10-17 17:58:00 - Dex Loader] Unable to execute dex: Multiple dex files define Lorg/apache/harmony/awt/internal/nls/Messages;
[2014-10-17 17:58:00 - PdfMail] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lorg/apache/harmony/awt/internal/nls/Messages;
I see many link. Like this
But i am not getting right answer. So How can i resolve this?
Edited
I solve this problem. I have just replace droidText.0.2.jar with itextg-5.5.3.jar file.

Are you using Android Studio?
if yes, this temporary work around might help
add this to build.gradle:
android
{
dexOptions {
preDexLibraries = false
}
...
}

Related

MPAndroid Chart: "Unable to execute dex" issue

My project needs to have a bar chart and i have included the MPAndroid Chart library in my project. However, it is not successful and it gives the following message.
Unable to execute dex: Cannot merge new index 67075 into a non-jumbo instruction!
Conversion to Dalvik format failed: Unable to execute dex: Cannot merge new index 67075 into a non-jumbo instruction!
I know the reason for this error as i have included other libraries in my project which exceeds the limit on Android.
One of the alternatives is to use another library with less methods. However, if i want to use this library, are there any methods so that i would trim down the size of the library to meet my objective.
Add dex.force.jumbo=true in the first line of project.properties
See here
I hope it helps you.
You can enable Jumbo Mode in build.gradle. Change the following line and clean your project before sync gradle again.
android {
dexOptions {
jumboMode = true
}
}
You can also enable Multi Dex
android {
defaultConfig {
...
minSdkVersion 14
targetSdkVersion 23
...
// Enabling multidex support.
multiDexEnabled true
}
...
}
The difference between Jumbo Mode and Multi Dex as shown here is:
Jumbo Mode, when reading https://source.android.com/devices/tech/dalvik/dalvik-bytecode.html, the const-string/jumbo is the jumbo mode for string. It is about the opcode such that "op vAA, string#BBBBBBBB" versus "op vAA, string#BBBB", 32 bits versus 16 bit.
Multi Dex is to allow to load classes from more than one dex file. The primary classes.dex must contain the classes necessary for calling this class methods. Secondary dex files found in the application apk will be added to the classloader after first call to MultiDex.install(Context) see https://developer.android.com/reference/android/support/multidex/MultiDex.html

BouncyCastle Error

I am developing an android application. In this application I create my own private key by passing pass phrase, user id and keys. When creating the private key, it says "Error: org.bouncycastle.openpgp.PGPException: cannot create cipher: CAST5/CFB/NoPadding"
I have checked the logcat as well as the warning section in the Eclipse but there is error there. SO why I am getting this error and how to solve it.
Any help is greatly appreciated!
I am using bcpg-jdk15on-150.jar and bcprov-jdk15on-150.jar,
which I have downloaded from http://www.bouncycastle.org/latest_releases.html
EDIT
the solution of renaming one or both the jar files does not work. When I run the application it says Unable to execute dex: Multiple dex files define Lorg/bouncycastle/apache/bzip2/BZip2Constants;
and Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lorg/bouncycastle/apache/bzip2/BZip2Constants;
I think there is a problem with the duplication of some files within the two jar files. Can anyone suggest me a solution regarding this?
Thanks
Use latest BouncyCastle and setup security in your code in the following way:
Security.removeProvider(BouncyCastleProvider.PROVIDER_NAME);
Security.insertProviderAt(new BouncyCastleProvider(), 1);
It sets Bouncy Castle library as preferred security provider; Android's default provider config has BC at position 3 so this code will remove it and insert BC again at position 1.
It solved the problem for me.

Error in android running the project "Multiple dex"

Error message from console and please fix the project also
014-07-03 19:09:15 - Dex Loader] Unable to execute dex: Multiple dex files define Lorg/apache/commons/lang3/builder/ToStringStyle;
[2014-07-03 19:09:15 - RSExample] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lorg/apache/commons/lang3/builder/ToStringStyle;
I did all circus like refresh,clean checking jar files.............but I found no result these code has been taken from the github.
1.find the error class
2.check out that the class is available in how many jar(definitely that )
3.if available both, remove one jar
4.run
Note : becoz of two classes are trying to execute , then the problem occur
or check the java buldpath

Mobile APP stopped working

My mobile APP was working perfectly.
I got a new computer, downloaded Eclipse + Android SDK, and got the following error messages:
[2013-12-11 13:31:45 - MyPulse] ERROR: Unable to open class file C:\Users\dridley\Dropbox\MyPulse\Martin Brown\ideaProjects\MyPulse\gen\com\palczewski\mypulse\Manifest.java: Permission denied
[2013-12-11 13:36:04 - Dex Loader] Unable to execute dex: Multiple dex files define Lorg/json/simple/ItemList;
[2013-12-11 13:36:04 - MyPulse] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lorg/json/simple/ItemList;
[2013-12-11 13:47:09 - MyPulse] Dx trouble writing output: already prepared
[2013-12-11 13:47:15 - Dex Loader] Unable to execute dex: Multiple dex files define Lorg/json/simple/ItemList;
[2013-12-11 13:47:15 - MyPulse] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lorg/json/simple/ItemList;
The messages repeat many times.
Your project has more than one jar with org.json.simple.ItemList. Remove the extra jars and rebuild.
Also, having the work area in a Dropbox folder likely isn't a good idea. If you need to back up or share code, use a real version control system.

Automatically getting error in project when I open it in eclipse

I'm getting an error everytime i try to open a project that doesn't have any.
I get these error messages in the console section of eclipse:
[2011-07-21 19:17:54 - Dex Loader] Unable to execute dex: wrapper was not properly loaded first
[2011-07-21 19:17:54 - Sound Board Template] Conversion to Dalvik format failed: Unable to execute dex: wrapper was not properly loaded first
Any ideas?
Have you tried re-installing the android SDK?

Categories

Resources