My Project shows no errors. Though when I run the application it says please fix the error before running your application. When I looked at Console tab it says
[2015-07-10 19:50:26 - Dex Loader] Unable to execute dex: Multiple dex files define Landroid/support/v7/app/ActionBar$DisplayOptions;
[2015-07-10 19:50:26 - NavigationDrawer] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Landroid/support/v7/app/ActionBar$DisplayOptions;
I tried searching for the solution but haven't got any.
this is what I have for my support libraries.
Please Help. I got stuck here. Thank you in advance.
You have added several times this same library try to delete it to get only one (android-support-v7-appcompat.jar).
I propose to remove last (at bottom) and first (at top).
I do not know how you android program does, but from my experience these types of errors is the beginning of many erroes own eclipse. I recommend migrate their projects to AndroidStudio an excellent IDE that works without any kind of bugs.
Related
i read a lot of posts but cannot resolve this yet.
There is my error lines and structure of project:
Some libraries and configs I take from another project... And don't know where I went wrong.
I will give you source code of files if needed
Thank you for any help.
I've also been getting this error since upgrading from Android Studio 2 to 3. The code compiles, but the IDE isn't recognizing the native functions. (This may be due to a preprocessor macro I've created that simplifies JNI function names.)
I've suppressed this error in Java by adding #SuppressWarnings("JniMissingFunction") before my class declaration.
Ok, so this missing 'JNI function' isn't a big deal. I know it's highlighted red, but the function is being linked, just not in a way that the IDE can determine.
First, here's the relevant source code: https://github.com/koreader/crengine/blob/master/android/jni/cr3engine.cpp#L770
CrEngine is linking the functions at run time. The reason why your IDE isn't picking them up is because the CrEngine functions start with Java_org_ instead of Java_com_. If you were relying on the engine to automatically link, this would be an issue, but as stated before, they are being explicitly linked at runtime with jniRegisterNativeMethods.
Do a clean and update your build tools to 25.0.3 (or better) in your gradle.build file. Update your SDKs and NDK. Then rebuild. Some of the errors I saw could be caused by older build tools.
I write a android app in Eclipse and use run command on my cellphone.
It's run success on my cellphone.
But I use [Android Tools -> Export Signed Application Package...] to export my app.
Then use [adb install] to install apk on my cellphone and run.
And I got the error message:
07-22 11:20:43.537: E/AndroidRuntime(20216): Caused by: java.lang.ClassNotFoundException: com.mytest.MyActivity in loader dalvik.system.PathClassLoader[/data/app/com.mytest-1.apk]
In [Java Build Path -> Order and Export], I have been selected all.
In AndroidManifest.xml, the application attribute doesn't have android:name.
I don't know how to solve this problem.
I'm success use Eclipse run on my cellphone, why run error when I export the app?
please help me, thanks!!
I had same issue, after 2 hours of research I managed to fix this problem by deleting "bin" and "gen" folders and rebuilding project.
There seems to multiple reasons for this happening from what I have researched. Do you have a lib folder? if so change it to "libs".
Do you have proguard enabled? If so that may cause the problem.
Also try unchecking the "Android #.#.#" and "Android Dependencies" in your Build Path, Order and Export.
Check out this thread which has a bunch of other possible solutions, a lot of them deal with setting the proper ActivityName in the manifest file.
java.lang.ClassNotFoundException on working app
If those solutions still don't solve the problem try these threads.
Android: Unable to instantiate activity / ClassNotFoundException
ClassNotFoundException Android
What I had to do is just re-do the building/exporting process with no modification to the code whatsoever. It worked for me, which I did was to export it two times.
On my first export, the build APK has lower file size and the second export (with no any modification to the code/configuration) produced a slightly larger file size (about 200KB diff).
This bug in building is really costly, kills you in front of your manager, and should be really fixed by Android/Eclipse team. Kind of sucks
When I add the stax-api-1.0-2.jar in my Android project, I get the following error:
Dx trouble processing "javax/xml/stream/EventFilter.class"
Conversion to Dalvik format failed with error 1
Now I have searched the site and found this "Conversion to Dalvik format failed with error 1" on external JAR and a lot of other similar questions and have tried out the solutions presented in them. Unfortunately, these solutions do not work for me. I have come to the conclusion that the problem is in using this jar itself.
My question is two-fold:
Why does Dalvik conversion fail when using particular core external jar like stax-api-1.0-2.jar but does not fail for javax.json-1.0.4.jar, javax.ws.rs-api-2.0.jar, javax.annotation-api-1.2.jar when these are also core jar files?
Which alternate to stax-api-1.0-2.jar I can use which will not cause this error?
After searching for similar questions/answers without success I'll try to explain my situation.
I've an Andorid game developed with LibGDX, which also uses the Google Play Games services.
My game is composed by several projects:
google-play-services_lib (lib project provided by Google, unmodified)
http://i.stack.imgur.com/1XnHn.png (libs)
http://i.stack.imgur.com/Gay5H.png (buildpath)
BaseGameUtils (lib project provided by Google, unmodified. depends on 1)
http://i.stack.imgur.com/3iJ0W.png (libs)
http://i.stack.imgur.com/noNDX.png (buildpath)
odd-blocks (the principal project of the game)
http://i.stack.imgur.com/atsKA.png (libs)
http://i.stack.imgur.com/5MDua.png (buildpath)
odd-blocks-android (basically the main activity class, depends on 1, 2, and 3)
http://i.stack.imgur.com/VUxJt.png (libs)
http://i.stack.imgur.com/yP6wv.png (buildpath)
odd-blocks-desktop (for testing the game on desktop mode, depends on 3)
http://i.stack.imgur.com/pKGUf.png (libs)
http://i.stack.imgur.com/9XzdM.png (buildpath)
My problem is that, with the configuration shown, when I try to execute the odd-blocks-android project I obtain the following error:
[2014-03-08 19:04:22 - Dex Loader] Unable to execute dex: Multiple dex files define Landroid/support/v4/accessibilityservice AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
[2014-03-08 19:04:22 - odd-blocks-andorid] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
Which is related to the "andorid-support-v4.jar", I'm sure to have only one version of this jar, as you can see in the images. There is a "solution" proposed in some questions to disable the private libraries in the build path configuration. In my case, if I do that, the game is executed but before starting there is a exception that says:
03-08 18:26:05.524: E/AndroidRuntime(15449): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.damsoft.oddblocks/com.damsoft.oddblocks.MainActivity}: java.lang.NullPointerException
There are also, some questions available about this second error message, that mentions that it is because the manifest is incorrect because does not have the activity registered. I'm sure that this is not my case, because I checked it, and also because my game worked before. In these questions they also mention that a way to resolve this error is to enable the "android private libraries" in the build path configuration screen, but then, I got the first error...
It is also important to mention that this error started to happen after the update to "Android SDK build-tools" v19 (currently 19.0.3).
I've been trying many things but nothing seems to solve the issue, maybe is something stupid... I don't know, but I'm out of ideas. I hope you can help :)
Finally I found the problem.
It was the "gdx-backend-android.jar", and some bad luck.
I installed a nightly build of LibGDX that for some reason included the classes of the android-support-v4.jar that caused the conflict of versions.
My solution was as simple as re-download libgdx.
But as a general remark, it is important to notice that this error message could mean that some other lib includes duplicated classes. Not necessarily with the same file name. The only way I found to check this was to rename the jar files to zip, and check for the duplicated class files.
I have a project that uses leap motion sdk. I wrote this project in Eclipse. When I run my program I don't have any problem because I set my native libraries as it is suggested from configuration.
However, when I export my application I can not run my program because Eclipse does not include my native libraries and I am having this error.
Native code library failed to load.
java.lang.UnsatisfiedLinkError: no LeapJava in java.library.path
My purpose is create a .jar file which user can run with one click on Windows(just). I tried this methodologies as it is suggested in stackoverflow. However, I could not get this result.
1.) method with static{ System.load("write each .dll") }
This did not work becuse I am having a error when I try to load Leapd.dll.
2.) System.setProperty("java.library.path", "C:/Users/can/Desktop/Vinar_libraries/LeapSDK/lib/x64/" );
This one also did not work.
3.) Adding -Djava.library.path="\LeapSDK\lib\x64" parameter from running configurations on Eclipse.
I know this subject is mentioned many times in stackoverflow. However, proposed solutions did not work for Leap Motion sensor.