I'm on Eclipse for hours now and I didn't found a solution yet for my problem even after many searches on internet: I have no more R.java file on my projects.
On just created or on my old projects, i don't have R file anymore and I tried so many solutions (uninstall, re-install Eclipse, clean my project, check all my XMLs, fix problem with android tool and so on ...)
Please someone can tell me what to do in this case?
Hey If you just updated to ADT Rev 22 :
I had the problem too. There is a new component in the Tools folder called "Android SDK Build-tools" that needs to be installed.
Step 1
Open the Android SDK Manager
Step 2
Select the newly added Build Tools and install. (If problem stays then go to Project Properties => Java Build Path => Order and Export and check Android Private Libraries, then clean and build project.
It may be necessary to repeat the process, restart the SDK Manager after the update and make sure it looks like this (all tools installed):
More info:https://groups.google.com/forum/?fromgroups=#!topic/android-developers/rCaeT3qckoE%5B1-25-false%5D
Perhaps in Project Properties -> Java Build Path -> Libraries you don't have:
Android 4.2.2 (or other version)
Android Dependencies ?
If so, then right click project - > Android tools -> fix android properties
and see if this library showed up.
Thank you all for saving me! I've spent the whole afternoon on search this error.
Finally, my project works.
By the way, I also encountered one problem which i wanna share with you:
After upgrading, even if my project has not errors anymore. During runtime, it seems it couldn't find the classes from the jars placed in \libs.
Go into Project=>properties => Java build path= > Order and Export.
Please make sure all your jars are checked.
If this problem occurs suddenly in a well working project,
the first step is to find whether the problem occurs only in the current project or in all other projects.
if all other projects in the current workspace are working then 90% problem is with XML / mainfestfile/resourse file that you edited recently.
This error is not shown as red mark we have to find out what we have done recently in these files.
try this
sudo apt-get install lib32stdc++6 lib32z1 lib32z1-dev
it solved my problem
Close your eclipse and after refreshing system, try to open Eclipse again. I think you are using Emulator along with the eclipse. It may be because of the low Memory problem (RAM) of your system. I used to face the same problem when I use Emulator
whenever there is any mistakes in any of the xmls the R goes missing when a build or clean happens so check for any xml errors in your project unless you fix it you cant get back your R on clean or build. fix the xml files and perform a clean you will have the R generated. Also check in File->properties->Builders and see if everything is checked
I was using Eclipse Indigo and nothing I tried worked. I ended up downloading Juno SR2, reinstalling the ADT, and now everything works again.
Reinstall everything and it'll work.. i.e. go back to Google SDK or w.e. you're using and download it.
Update it to latest in SDK Manager.
Go into Eclipse-Project-Prefs-Java build path-order/export TICK EVERYTHING.
problem: No R file get generated.
guess: Try cleaning project if it is old one. Else create new project with no R get generated and with no compile errors but this: no project.apk
In this case you have to check your SDK for the built-tools. May not be installed after updating SDK.
Thus download them if not download here, then put them under directory: SDK/built-tools folder. Lastly, and most important, is to Run the SDK As Administrator. This guarantees refreshing SDK with all packages appearing in it.
Install the SDK-Built-Tools or any missing packages according to the above link and you're done.
hope this helps.
Try one thing, create a new Android Project and transfer all those files which are in the previous project. That worked for me.
In my case there is error due to "&" inside strings.xml file(but error not shown) for declaring string for a array type. Now the problem has been solved as I changed "&" to "and".
So, please make sure that you do not have such silly use of symbols, and clean the project.
I have had the same kind of problem, however Rechecking all XML files in the Resources folder was helpful in my case. I found syntax error in my XML files. Cleaning and building the project again can be helpful sometimes too.
I had the dreaded not more R.java.
Some of the things I've used in the past:
Clean / rebuild (the first thing we all try)
Restart eclipse (optionally reboot pc/mac)
Update both SDK/ADT eclipse plugin to latest version
Create new eclipse workspace and import project
Enable Verbose AAPT build output Eclipse menu>Preferences>Android>Build
Port project to Android Studio / Gradle (this helped my actually see the AAPT error i was getting Error Code:138)
Delete recent XML changes - Ultimately I found deleting recent menu.xml files I'd added and commenting out where they were referenced fixed the issue and I finally got R.java.
I got the error recently and had found no fault in any layout or value file. After a lot of tries I add another Activity and the R.java was build and the error disappeared. I don't know why this occur, but it takes me hours.
Related
I wanted to Setting up android studio, i have installed the latest version(3.1.0) of it and i downloaded and installed the latest version of gradle(4.6) and created a new object. but gradle project sync failed. and shown up the error :
Could not find builder.jar (com.android.tools.build:builder:3.1.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/build/builder/3.1.0/builder-3.1.0.jar
screenshot
I Couldn't find such problem with the others.
is it related to android sdk or gradle version?
is there any solution to download it manually and place it in the
location??if it's possible , where is the location ,that i can put the
builder-3.1.0.jar file.
Go to File>Setting>Build,Execution,Deployment>Gradle>Android Studio>>
and
Check mark this:: Enable Embedded repository
and Click Ok.
Then,
Rebuild the Project.
or
go to Terminal and type "gradlew cleanBuildCache" to clear the cache. The cache is in USERNAME.ANDROID\BUILD CACHE Directory.
And Rebuild.
Try deleting ~/.gradle folder and building the project again. Gradle will download that.
Accepted answer did not work for me, so I changed the class path line in gradle (project : project name) and issue is gone.
classpath 'com.android.tools.build:gradle:3.1.2'
I have tried all of the suggestions and none of them worked!
if you are facing the same issue i suggest you to do what solved my problem , i have found out the problem may caused because:
most likely at one time this dependency version was available, and so it’s now available on your Mac/PC in the filesystem (cache), and Gradle won’t try to download it (as it’s already downloaded). But then the version was removed / is no longer available, so it will no longer work on any new Mac/PC (as the dependency version can’t be downloaded).
hopefully if you have a backup before this problem happen these steps might help you to fix this issue
1) Backup or push the file you have changed to git (I suggest just your code files not anything related to gradles or android files)
2) delete C:\Users\ (your User)\ .gradle\caches
3) Do a clean git clone of the repository, into a new directory
4) Open new copy of your project with Android Studio and let Android studio sync gradles again
Check the version of Android Studio you are using...i was Android Studio 3.1 when it gave me the problem....i downgraded my Android Studio version to 3.0.1 and the problem solved.
I battled with the same problem for a very long time. But I was able to resolve it. You can try this:
Go FIle > Settings > Build, Execution, Deployment> Build Tools > Gradle then check the option Offline Work . You will notice that it points to a local gradle directory on your computer i.e C:Users/User_name/.gradle. Click Apply then OK. Run your project again, it should work.
Below is a screenshot:Screenshot of the Fix
go to SDK manager and download other SDK platform
I am using Android SDK Tools 23.0.2 with Android API 20 (L preview).
I have been having this error for some time:
parseSdkContent failed
.androidjava.lang.ExceptionInInitializerError
and I have looked at many other similar questions and tried their solutions to no avail.
They recommended deleting the /.android file in the user directory where my workspace is saved and restarting Eclipse. However this did not work for me.
parseSdkContent failed Could not initialize class android.graphics.Typeface
Android SDK Content Loader failing with NullPointerException
This error seems to be affecting my java code's ability to recognize the XML files it references. When I reference variables to components in the XML file, it does not recognize its existence, even though everything seems to be set up correctly.
Please let me know if any more information is needed.
I'd add a comment, but my rep isn't high enough...
Anyway, deleting .android folder worked for me. Your wording suggests you deleted then restarted Eclipse. Try:
Stop/Exit out of Eclipse
Delete .android
Restart Eclipse
I was using the 64 bit version of Eclipse ADT from this link https://dl.google.com/android/adt/adt-bundle-windows-x86_64-20140702.zip
and it was giving me issues on Windows 7 64 bit
I have now downloaded 32 bit version of Eclipse ADT from this link https://dl.google.com/android/adt/adt-bundle-windows-x86-20140702.zip
and now its working perfectly.
It might help others too.
I used the "switch workspace" option and created a completely new workspace. This new workspace gives me no problems.
I'd add a comment, but my rep isn't high enough... (just copied and paste here)
I was in the same problem and using Eclipse Luna + ADT Plugin, what I did was:
Exit Eclipse.
Delete .android folder from my home directory.
Delete .metadata folder from my workspace directory.
Also in my workspace deleted a folder called .remote (I don't remember exactly what was it's name, just deleted it).
Open eclipse, complete the ADT dialog, setup the Android SDK path, and check for eclipse updates.
If updates were done better you restart Eclipse before continuing.
Import my existing projects, (or create a new one).
Open a layout file (xml) to see if the error is gone.
Good luck!
I am having trouble setting up the build path of my java project. I am currently in a Co-Op IT position so I am somewhat new to all this. My background is mostly in C++ and I am learning java on the fly. I am also somewhat new to Eclipse (Kepler service release 1).
I am working on a bug on an existing program and need to get the program to build so I can work on it. When I add all of the external .jar files that I know for a fact are the right ones, I am getting this error on two of them :
"Archive for required library: '(location of file)' cannot be read or is not a valid ZIP file"
Two of the other full time guys on my team have gotten the program to run with those exact same .jar files, one running Eclipse Indigo and the other running the same Kepler version as myself. I also was able to open the two .jar files manually and everything appears to be there. After every trial trying to fix this, I have refreshed, cleaned and restarted eclipse. The two other full time guys said they have never seen this error. I would like to get some insight on this from anyone who has any similar experiences so that I don't have to use up much more of their time.
I Had this issue, just fixed by deleting .jar files from Libs directory then copy->paste original Jars again. Then do a complete clean -> rebuild
I got this problem, took help from following link solution
which basically says to
1. delete the corresponding maven download folder
2. maven>update project in eclipse
In my case I deleted hibernate folder, since i was getting error related to hibernate-validator.jar
I had the same error here. What I did to resolve the problem was close and reopen the project.
I got the same problem and found out the root cause is the JDK in my linux shell is set to 1.6, but in the eclipse, the JRE is 1.7.
Using Eclipse without m2e features (Standard Edition) helped me.
Similar problem with Spring toolsuite
Just came across this link that shows a way to get unblocked.
In preferences dialog box go to
Java->Compiler->Building
and change Incomplete build path to "Warning" (from default "Error")
This can be done globally (for all projects), or on a project by project basis.
Check the jar's file permissions/ownership.
I had the same issue on eclipse installed on Linux and fixed it by setting the file permissions right.
In my case ..worked after removing this from spirngrest-servlet.xml file.
<prop key="net.sf.ehcache.configurationResourceName">/Sysehcache.xml</prop>
I think it had to do with default location of maven repository of jar files.
Been at it for 3 days. finally solved it.Hope it helps anyone.Just look for similar think in your spirngrest-servlet.xml file. Good luck.
I just tried the following and it worked:
Close eclipse as there might be some files eclipse is accessing and you won't be able to delete.
Delete all the libraries installed in the maven repositories folder: ".m2/repository"
Open eclipse and update your project(Alt+F5).
What did we just do? : This is possible that the existing libraries in the local repository are erroneous and maven tries to open which it fails in. We have now deleted the already existing library and with the project update, Maven will download the library again which should resolve the issue.
i fixed this by just deleting everything inside of the /Users/username/.m2/repository folder. not the repository folder itself. and then running a mvn clean package in the project folder
I downloaded the sample Restlet project and opened it in Eclipse. I instantly get this error:
Errors occurred during the build.
Errors running builder 'Google WebApp Project Validator' on project 'org.restlet.example.serialization.gae-gwt'.
java.lang.NullPointerException
What am I doing wrong?
I had this same error with my own project. In the Eclipse Project Explorer I right-clicked the project and chose Refresh. That cleared up the error for me.
This is a temporary, but repeatable solution someone on my team found...
Close project
Close Eclipse
Open Eclipse
Open project
I continually had this problem in combination with git. My git repository was in my eclipse workspace ( even though eclipse warns you not to do this ). Deleting the old repository, and creating a new git repository outside of the eclipse workspace, then cloning a fresh copy of my gwt project solved this problem for me. Hope this helps.
I'm also experiencing this error, but thanks to git comparing .classpath I noticed that I had removed a couple of variables from the "Configure Variables" list, but not from the Java Build Path. Once I removed it from the second list, the error was gone.
I got this error when I was using a workspace that was on an NFS and I had the same workspace open on two different vnc sessions. I closed out Eclipse on one vnc session and then restarted eclipse on the other. Then I went to the java build path and editted the gwt sdk and had it use the gwt sdk it was already pointed to and it stopped giving me that error. I didn't actually change the gwt sdk, just went through the motions of doing so. Hope this helps.
The problem was miss configuration of JRE, I just did the following:
Go to Build path configuration, select add Library, JRE System Library, select your JRE.
And there you go...
For me this error seemed to occur after a compile had failed due to lack of memory and eclipse had been restarted. However, after increasing memory (in the eclipse.ini) the problem still persisted. None of the above solutions worked for me.
The bizarre solution I found: our project here uses GWT 2.4, so I switched to 2.5 (which comes with the plugin - window>preferences>google>Web Tookit), re-compiled, switched back to 2.4 and, hey presto, it worked again!
(Another hour of my life I'll never get back!)
I'm using Eclipse to learn to develop Android applications in Java. I haven't used Eclipse before.
The project I'm trying to use (supplied by OReilly as part of 'Android Application Development') is MJAndroid. When attempting to run the project, the Run fails, and the Problems tab mentions com.java.Object can't be found, and Eclipse asks me to check the build path. Clicking
Properties -> Java Build Path -> Libraries, the message 'Unable to get system library for the project' is displayed.
On a working project, Properties -> Java Build Path -> Libraries has an entry for Android 1.1, which if I click Edit, has the classpath container path of com.android.ide.eclipse.adt.ANDROID_FRAMEWORK.
It seems a simple matter of adding the correct container path to my non-working project. However Eclipse seems determined to make this as difficult as possible. No matter what I chose to add - jars, externals jars, variables, libraries, class folders, external class folders, nothing seems to take the form of 'com.android.ide.eclipse.adt.ANDROID_FRAMEWORK' that the 'Android 1.1' entry on the working app has.
How can I add this namespace to my project so it resembles the working one?
I'm quite sure it's a problem with Eclipse's somewhat odd user interface. Frankly there' nothing I'd prefer more than a file to modify and set such information - my background is in Python, and the whole eclipse environment seems an unnecessary burden.
I had faced the same issue when I imported a sample code downloaded from the internet. I am using android sdk 1.5 with 0.9 ADT plugins. Here is a simpler way to fix the andoid library reference issues
Right click on the project which has
issues and select properties
Select the appropriate Android build
(1.1, 1.5 or 1.5 with google api) and
say ok
Again right click on the project and
select "Android Tools > Fix Project
Properties"
Fix the imports once (if required)
Refresh the project and you should be
ready to go without any manual
editing
I faced this same problem after importing a project through GIT. The problem was that I didn't have the same target android platform installed, and the build path somehow got corrupted.
The first obvious thing i did was changing the target sdk in the project.properties, but even after cleaning up the project and Android Tools > Fix Project Properties, it didn't help and I was still getting the build error.
My solution after wasting close to 1 hour trying to figure this out?
RESTART ECLIPSE
Everything worked fine after that. Eclipse is pretty fickle. Only through years of experience you'll then understand her well. :)
Had the same problem and it turns out the Android SDK Location was not set which was a really simple fix. Go to Window->Preferences, click on 'Android' on the left hand menu, fill in the location of the Android SDK (e.g. C:\Program Files\Android\android-sdk) and click OK. Everything worked fine for me after that.
Found the answer in this set up guide: http://developer.motorola.com/docstools/library/Installing-Android-Dev-Environment/
Sometimes Eclipse can get a bit funny (technical term) with classpath container resolution.
You have a working project in your workspace, so you can rule out plugin installation issues. You could try opening the .classpath file (hidden by default, select the triangle in the top-right of the Package Explorer view, select Filters... and uncheck .* resources) and manually adding the container declaration.
`<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>`
You may then have to close the project and open it again (right-click->Close Project) before Eclipse recognises the change.
You may also find that there is an Android builder and/or nature. If you compare the .project files for the working and non-working versions you may see entries for Android builders/natures. Copying the relevant entries may resolve the issue.
sometimes, eclipse can help you.
In Android projects, click right button on the project-> Android Tools -> Fix Project Properties.
It's usefull in class path errors!!
Luck!
I would verify you have the correct version of Java installed as well as the Android SDK. I would recommend installing/reinstalling the ADT plugin in your eclipse, makes it alot easier to create the android project.
http://developer.android.com/sdk/1.5_r2/installing.html
Also. I guess the path of the Android SDK must be setup correctly. This happened when I was overloaded with projects and I decided to create a new workspace copying some existing stuff into it.
Seems that the new workspace requires you to setup these details too once again
Is that setup properly?