Eclipse Android Project Error - android

Trying to run my Android App and Eclipse (in Windows 7) is throwing up an error. Yesterday I had no problem so I can't think what I could have done to caus eit. The error message is
**Your project contains error(s), please fix them before running your application.**
Well, I went to window->view->error log and I found this
Warning
While loading class "com.android.sdklib.internal.project.ProjectProperties", thread "Thread[main,6,main]" timed out waiting (5000ms) for thread "Thread[org.eclipse.jdt.internal.ui.text.JavaReconciler,1,main]" to finish starting bundle "com.android.ide.eclipse.adt_11.0.0.v201105251008-128486 [317]". To avoid deadlock, thread "Thread[main,6,main]" is proceeding but "com.android.sdklib.internal.project.ProjectProperties" may not be fully initialized.
org.osgi.framework.BundleException: State change in progress for bundle "reference:file:plugins/com.android.ide.eclipse.adt_11.0.0.v201105251008-128486.jar" by thread "org.eclipse.jdt.internal.ui.text.JavaReconciler".
at org.eclipse.osgi.framework.internal.core.AbstractBundle.beginStateChange(AbstractBundle.java:1073)
I would like ot add that although the project itself is showing an error no source file or resource has an error.
SO far I have tried:
clean/build (several times)
close eclipse and reopen (several times)
shutdown computer and restart
Thanks in advance.
EDIT:
Tried again and got the following message in console:
[2011-08-14 00:40:47 - Dex Loader] Unable to execute dex: wrapper was not properly loaded first
[2011-08-14 00:40:47 - MyAppName] Conversion to Dalvik format failed: Unable to execute dex: wrapper was not properly loaded first
Don't know it cant convert to Dalvik format. The SDK is in the build path.

After much stress and pain and me almost throwing my computer out the window I found the problem is in the debug.keystore file. Although Eclipse gave me no warning of this. After deleting the debug.keystore file I cleaned/build my project.
Eclipse gave the following error.
Re-installation failed due to different application signatures.
[2011-08-14 13:16:42 - MyApp] You must perform a full uninstall of the application.
WARNING: This will remove the application data!
[2011-08-14 13:16:42 - MyApp] Please execute 'adb uninstall com.etc.etc' in a shell.
[2011-08-14 13:16:42 - MyApp] Launch canceled!
I didnt follow the advice but simply renamed my package. It works now. I'm not sure what to do with older packages that I have released onto the Market. It will be difficult to add new versions if I have to rename them to test them on the emulator/my phone.

feels to me something wrong with the SDK. Why dont you uninstall the current Android sdk and install a new version instead.

Right-click on your Project in Eclipse and choose Properties. Check in the Java Build Path that you have the Google API's in the Libraries tab. Check the references to them.

Related

Intellij idea showing error: could not create the java virtual machine

I am having trouble with intellij idea ide.
It was working fine , but suddenly it started showing error:
Android Dex: [untitled3] Error: Could not create the Java Virtual Machine.
Android Dex: [untitled3] Error: A fatal exception has occurred. Program will exit.
I have checked my sdk, jdk path.
i have done re-installing it but still the problem is same.
Any help would be appreciated.
Thanks.
The problem was caused by the too high heap size for the DX compiler, it can be changed here (File | Settings | Compiler | Android DX Compiler).
Check this document that explains why it happens when 32-bit JDK is used.
try this:
navigate to C:\Program Files (x86)\JetBrains\IntelliJ IDEA 13.1.3\bin and run the " idea64.exe ".
if 64-bit executable is not provided for your product
Start the IDE using .bat file instead of the .exe
javac may be running in 32-bit mode, preventing the use of heaps greater than 2**32 bytes.
Try adding -d64 to the “Additional compiler process VM options” in settings or via Ctrl-Shift-A/⇧⌘A

dx.bat hangs while processing .class files

I'm using dx.bat to prepare my java code and java libraries I'm using for device. I have several .jar's, and the tool always hangs on the same class. It doesn't finish or report any errors. If I remove the .jar that contains that class, then dx.bat completes successfully, but the app won't run, of course, because classes are missing.
The .jar causing problems is aws-android-sdk-1.4.0-core.jar, from Amazon. The class is com/amazonaws/javax/xml/stream/StaxErrorReporter$1.class
I've searched extensively and found other dx errors, but not this one. Has anyone else seen this happen?
UPDATE: I'm running dx.bat from a java build tool I made when it hangs. I tried running the same command from the windows command line, and it runs just fine. So the problem appears to be with java?
Well, it turns out the problem was my java code that was running dx.bat. The issue is explained here:
Java Process with Input/Output Stream
I redirected the error stream, and now it's working.

It got the 'java.lang.ClassNotFoundException' error when run the export apk

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

Android unable to execute dex

I am beginning to work on an android app with a group that has already started. After installing the SDK, and running the emulator, I got these error when trying to run the code.
[2012-02-02 19:59:45 - Dex Loader] Unable to execute dex: Multiple dex files define Lcom/swipe/DrawView;
[2012-02-02 19:59:45 - SwipeActivity] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/swipe/DrawView;
EDIT:
I have been trying everything in the link provided. I uninstalled the SDK and Eclipse ADT and now I get this error when reinstalling.
Cannot complete the install because one or more required items could not be found.
Software currently installed: Shared profile 1.0.0.1316138547364 (SharedProfile_epp.package.java 1.0.0.1316138547364)
Missing requirement: Shared profile 1.0.0.1316138547364 (SharedProfile_epp.package.java 1.0.0.1316138547364) requires
Make sure you have updated your Eclipse trough Help->Check for updates and istall the latest updates and if you use Windows make sure to do this with administrator rights.
If that doesn't work, you could also try this: https://stackoverflow.com/a/7884908/1084764
Try deleting the android-support-v4.jar libs file in the project. And then cleaning your project. It worked for me.
Add the following to eclise.ini:
-vm C:/Program Files/Java/jdk1.6.0_10/bin
It is very simple, If you have added google-play-service library project. Then just Update it revision from SDK Manager.
Please verify it and let me know if any one not able to resolve it.

Type Error - generating final archive: java.lang.ArrayIndexOutOfBoundsException: 13 , Type: Android packaging problem

I have a weird problem. I have installed windows 7 on my machine.
For android installation i have downloaded the latest android sdk, installed plugins, set the paths and all... as i have done it several times....
But when i create a new sample project and compile it it shows red cross on the project in Package explorer and i am not able to run the program.(I have compiled the project successfully and it is not the R.java file error... :-) )
In the Problem window it shows on error and that is
Type Error - generating final archive: java.lang.ArrayIndexOutOfBoundsException: 13 , Type: Android packaging problem.
Struggling with this for last one week and getting more and more frustrated.
I will very thankful if some solve my prol
Do a Project->Clean in Eclipse, see if that'll help out.
I have found this bug in my system to
and got puzzeled and ask question http://stackoverflow.com/questions/18045984/eclipse-pacakge-error-found-no-solutions
But At last i got the soulution
that worked for me
First change laguage from hindi(or some thing) to English
delete the debug key (Can be found on my doucument and folder named ".android")
and do
"eclipse.exe -clean" from command promp
this will generate a dubug keystore and project runs normally.

Categories

Resources