Hi I am trying to make an android app on my Mac but am getting the following error when creating a new project
[2015-03-09 18:33:06 - appcompat_v7] WARNING: unable to write jarlist cache file /Users/shareennainar/Documents/workspace/appcompat_v7/bin/jarlist.cache
any help will be appreciated
Try this :
Project->Properties->Java build path. On the "Order and Export" tab, make sure you have checked all the libraries the project is referring to in your case appcompat_v7
Be sure you have android:minSdkVersion="14", else change it to 14 and do Project -> Clean
Also you can take a look -> this or this
If you don't need specifically use eclipse I encourage you to use Android Studio. I changed from eclipse to Android Studio and I think it's one of the best choices I did in my work.
P.S: That error looks like you don't have the appcompat library installed in your project. Are you using gradle? if so try to add it using the following line.
compile 'com.android.support:appcompat-v7:21.0.+'
If you don't use gradle you must add it manually.
EDIT: Here you can see how to import different libraries into your android project.
http://android-er.blogspot.com.es/2013/12/create-library-project-with-appcompat.html
This error means you're trying to load a Java "class" file that was compiled with a newer version of Java than you have installed.
For example, your .class file could have been compiled for JDK 7, and you're trying to run it with JDK 6. To solve this, you may take one of these solutions:
In Eclipse's menu
Window -> Preferences -> Java -> Compiler
Check "Configure Project Specific Settings".
Upgrade your Java runtime or
Recompile the class if you have the source, using your local Java compiler (if you have one).
javac FileName.java
Related
I want to use CastComponaionLibrary but I'm using Eclipse and not Android Studio.
So I created a new project and copied all CastCompanionLibrary sources into it.
I also added references to:
android-support-v7-appcompat
android-support-v7-mediarouter
google-play-services_lib
In this new project I get these compilation errors:
The project was not built since its build path is incomplete. Cannot find the class file for android.support.v4.app.ActionBarDrawerToggle$DelegateProvider. Fix the build path then try building this project
The type android.support.v4.app.ActionBarDrawerToggle$DelegateProvider cannot be resolved. It is indirectly referenced from required .class files VideoCastControllerActivity.java
any ideas?
Thanks!
First, you don't need to include v4 library since that is part of the v7 libraries, so remove that. Then follow the instructions in this G+ community post
I don't know why but I solved this problem:
In android.support.vX -> Properties -> Java Build Path -> Projects -> Add
Choose the related project/s to the android.support.vX
Press OK
Do the same and remove the project/s added
I need help with a project dependency issue in the Android SDK.
I have the following projects:
"Sync" (a Java only project)
"Agonis" (an Android Library project)
"Dragonis" (an Android application project)
Agonis has a project dependency on Sync, and Dragonis has a project dependency on Agonis, like so:
Dragonis->Agonis->Sync
I have correctly used the Properties->Android->Library dialog to add Agonis as an Android Library. I have exported the Sync project in the Agonis build path setup:
http://i.stack.imgur.com/GsQIR.png
In the Dragonis project, I see both Agonis and Sync in the "Android Dependencies" virtual folder:
http://i.stack.imgur.com/EhH8L.png
From here, I would expect everything to just work, but it doesn't.
I can start the app, but as soon as I instantiate a type from the Agonis project (com.mob.agonis.AgonisServer), I get a NoClassDefFoundError. If it matters, the Agonis type I am trying to instantiate extends a type that is in the Sync project (com.mob.sync.Server).
I tried cleaning all the projects, and using Android Tools->Fix Project Properties on both Agonis and Dragonis to no avail.
Am I overlooking something?
Put the jar library in the folder libs and add it to the java built path.
Right click on the file -> Build Path -> Add to Build Path
Hope it helps.
I figured it out.
The Sync Java-only library was compiling to 1.7 Java byte code. Android only supports converting Java 1.6 byte code to DEX.
Scroll to the top of the console, kids.
You can solve this through the command line tool. You could create/update the Dragonis and Agonis android projects - one as an application and other as library. See http://developer.android.com/tools/projects/projects-cmdline.html
You can easily set up the dependency from D -> A using the command line tools as shown in section called referencing a library project. At this stage, a build of D automatically triggers a build of A.
Now modify the build.xml of A - to include a dependency on : build and copy Sync.jar at the pre-compile stage (look inside build.xml to find the placeholder). The build and copy tasks can be done by starting a sub ant process using subant. See http://ant.apache.org/manual/Tasks/subant.html
At this stage all your dependency work properly on command line if you trigger ant build. Now you can also use eclipse by importing the android project Dragonis from source.
From the project properties of "Sync" set the "Java Compiler"-> "JDK Complience" to 1.6. Rebuild and enjoy!
While trying to add android source to eclipse, I am getting the following errors.
Project 'android' is missing required library: 'out/target/common/obj/JAVA_LIBRARIES/gsf-client_intermediates/javalib.jar'
Project 'android' is missing required library: 'out/target/common/obj/JAVA_LIBRARIES/google-common_intermediates/javalib.jar'
FYI, I have built the source successfully with full_maguro-userdebug configuration (for Galaxy Nexus) before adding this to eclipse. Since I couldn't find "create project from existing source" in Eclipse Indigo, I changed the location of the project to the root directory of the source. I refreshed the project several times with same error.
How to solve this issue?
You should go to Project -> Properties -> Java Build Path.
There open tab Libraries.
In this tab out/target/common/obj/JAVA_LIBRARIES/google-common_intermediates/javalib.jar should be changed to out/target/common/obj/JAVA_LIBRARIES/android-common_intermediates/javalib.jar by selecting javalib.jar from google-common_intermediates, pressing Edit and selecting instead android-common_intermediates.
Entry with gsf-client_intermediates javalib.jar can be simply deleted.
A more comprehensive answer at here: https://groups.google.com/forum/?fromgroups=#!topic/android-platform/XIbR8ZKe7Tw
I would not recommend using eclipse for android source. Android is not a single project and it too big for an IDE like eclipse to handle.
Use simpler plain text editors like vim, emacs to browse the code
I have come across a strange error. I have an Android project that uses external libraries, in particular:
android-support-v4.jar (for Fragment support in Android 1.6)
GoogleAdMobAdsSdk-4.3.1.jar (for ads)
The project ran fine until I updated some aspects of the plugin (can't recall the specifics as I did not pay too much attention to it) and after that, whenever I try to use any class from the above .jar files (or any of its subclasses, even ones defined by me), I would get a java.lang.NoClassDefFoundError. I could not find the answer after much searching, so I am really stumped.
I believe this problem is related to how my IDE is set up and it has little to do with actual code, so I will not post any unless if it's absolutely necessary.
You need to read this - Dealing with dependencies in Android projects.
This link is also useful - ClassDefNotFoundError with ADT 17
Basically, create a folder called libs and place all of your jar files inside. The recent update will automatically take care of the rest for you. You don't need to edit your path anymore.
Android does not support Java1.7 up to now. Jars built with compliance level 1.7 cannot be used in Android Applications. Rebuild your Java project with compliance level 5.0 or 6.0 before exporting the jar file.
I found this post via google and answers above didn't solve my problem. Hope what I say will be helpful to others.
If you see NoClassDefFoundError after upgrading to ADT 22, try this in Eclipse:
Go to Project Properties → Java Build Path → Order and Export tab.
Check the Android Private Libraries option.
Also a warning to others who have updated to r17 with many dependencies. I had a another referenced project on my build path and it still did not work after following ALL the directions on this r17 issue on the internet.
Found out after an hour that my referenced project used an older version of an external Jar than my main project did. When trying to compile the main project, Eclipse would give up due to this jar version difference and I never noticed the warning message in Console.
Solution was to copy the newer version external jar file to the referenced project's libs directory.
Wow - such a productivity killer.....
I ran into this error today too, because of updating to the Android SDK, r17. What the links that #aneal pointed out do not discuss is how to handle external runtime libraries (such as those imported under their own heading - not an imported user library).
The easiest way to solve this problem is to change the build order in the build path. Simply right click on your project and select Properties. From here, select Java Build Path. At the top of the display, choose the tab order and export and move GoogleAdMobAdsSdk-4.3.1.jar above Android X (replacing x with the version you are using). Next, clean your project and run it. You should be good to go!
The way I solved it was by : Right clicking on the project and selecting build path. Select configure build path in the selections that appear. After that see if your libraries are there in the libraries folder and then select the order and export tab and over there select all your jar files. Then select ok and run your project.
If you're using Eclipse with Maven IDE (m2e) go to "Java Build Path" then "Order and Export" and finally check the item "Maven Dependencies" and pull it down to the BOTTOM of the list. You should do the same with project references in the same workspace.
Every time I setup the project in a new computer that happens.
currently i have difficulties trying to import the lynda.com android app development with java essential training exercise files into eclipse. I keep getting some java errors like this.Can someone help me out with this problem?
Currently im using
Android SDK r12
ADT 12 plugin for eclipse
JDK 7x64
JRE 7x64
LEclipse IDE for Java Developers 3.7 indigo
here's the error:
The project was not built since its build path is incomplete. Cannot
find the class file for java.lang.Object. Fix the build path, then try
building this project.
The type java.lang.Object cannot be resolved. It is indirectly
referenced from required .class files
(original screenshot below)
A little late on this, however after struggling with the issue myself I found a solution to the problem.
Right Click on the project --> Build Path --> Configure Build Path...
In the 'Source' tab, Select the project eg. 'myProject/src' --> Click OK.
Right Click on the project --> Android Tools --> Fix Project Properties
That should do it!
Have you tried changing your compiler to Java 5 instead of Java 7?
Also make sure that in the project settings that you're using Java 5.
Ryan,
I had the same problem and it was corrected by going to the project preferences(right click project -->preferences). Then go to "java build path" and click on the libraries tab. Look for your JRE lib in the list. In my case the system was unable to find it, but the entry was still there. Delete this and add a new one by clicking "add library" and select JRE System library. Then select the default system lib. Close out of the preferences window and then Right click on your project and go to android tools-->Fix project Properties. Clean your project and try building again.
This works
Project > Properties > Android > change the Build Target