I know this is very widespread problem , but I didn't find solution to my particular case after searching the web for almost one day. I am using Ubuntu 14.04. I have just installed eclipse , ADT and SDK. So I have tried followings but still I get the same error.
Install all possible SDK build tools
Delete gen folder and clean/build the project
Fix all the errors in layout files
Make sure that the path to sdk is correct
Check if appcompat_v7 is added as a library or not
So what can you advise me to do besides these?
I had a similar problem and I fixed by adding
import your.package.name.R
to my activity.
Eclipse by default adds import android.R
You should try with NEXT
rigth click in your projects -> Android Tools -> Fixed project libraries or support library project -> clean or restart. If the above does not work, import the projects said JCODER
What you can also try is to change the android api
Hope that helps
First, You have to make sure all of your XML files are absolutely fine and have no errors.
If no errors found, try changing your Build Target and apply, then change it back. In eclipse do the following:
-> Project -> Properties -> Android -> Project Build Target -> Change the target and click Apply
Related
Good evening, everybody.
I'm trying to debug the In-App Billing project. The sourse which I use, is
https://github.com/blundell/SimpleInAppPurchaseV3
I'm facing the problem from time to time:
Suddenly the project in file Log.java gives two errors:
1. The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
The error shows near the first symbol of the file.
R.java cannit be resolved! And gen-folder doesn't recreate! No errors in xml-files.
IabHelper.java shows the error: The import com.android.vending.billing.IMarketBillingService cannot be resolved
So if delete com.android.vending.billing/IInAppBillingService.aidl file and recreate it (by copy-paste) nothing happens.
What am I doing wrong?
I think your problem is just the latest update of the SDK.
Test the following operations on two projects :
In the project properties (eclipse) -> java build path -> order and export make sure that all your jars in the libs folder are checked.
And "Android Tools -> Fix Project Properties"
And "Project -> Clean"
If your problem persists try this:
Remove your project
Close eclipse
Import your project again
I hope you have helped!
Try this one.
1) project properties-> java build path-> order and export
make sure you have checked true all files that I have listed below:
Android Private Libraries,
Android Dependencies,
your all jar and libraries you have added.
2) check your SDK manager you have updated all required versions for
--> Tools: SDK Tools, SDK platform tools, SDK build tools.
--> Android 4.2 or what ever you are using, Google Map and SDK Platform should be updated latest.
--> Extras: Google Play Services,Google play billing libraries
also make sure you have not imported wrong variables or any class.
Hope it will help you.
Simple solution.
Rename your package name from com.android.vending.billing to com.android.vending.billing2.
Refresh project.
And after that again rename to com.android.vending.billing. And it will work.
In Android Studio click "Make Project" after adding "IInAppBillingService.aidl" file to your project. Then Android Studio can import "IInAppBillingService" class after press Alt+Enter on IInAppBillingService class.
I reinstalled my eclipse. and then imported all the projects in the Eclipse, but every project has a common error:
Cannot find the class file for java.lang.Object. at Line 1.
I have checked my Java Path. But not able to sort it out.
Right click on Project--> Properties, Java Build Path.
Check whether you have JRE installed. If installed click on EDIT and check whether its pointing to correct location
Check this if it works:
There is a problem with your java repositories. I guess..:
goto Help>Install New Software> Click on Add Button .
on popup:
Name: ADT
Location:https://dl-ssl.google.com/android/eclipse
Install all the available softwares in the list. This may work.
Have a good day!!!
A quicker way will be
Right Click Project---> Properties--->Build Path--->Add External Jars--> Find your android-xx.Jar e.g android-17.jar
In my case I'm using the adt and it is here
E:\adt-bundle-windows-x86_64-20130219\adt-bundle-windows-x86_64-20130219\sdk\platforms\android-17
Hope it helps
This happened to me when I tried to merge two branches of an Android project using eGit. For some reason my build path basically disappeared (possibly one of the files was untracked).
To get the JRE and android libraries back, I just right-clicked on the project in the project explorer, and hit Android Tools -> Fix Project Properties (these options are only available if you have Android ADT installed).
Try this:
Go to Build Path -> Libraries -> Add Library -> JRE System Library -> Select JRE
I am not sure but you might be missing JRE System Library in your project, this does not happen often but it is possible.
I just had this problem and all I had to do was clean the entire workspace, i.e. all projects in the workspace. The error went away.
I've had this problem after installing a newer version of Google ADT.
The solution, at least running OS X, is to make a copy of your project to a safe location, delete it completely from Eclipse and then import it again using File->Import->General->Existing Projects into Workspace.
FYI
I am Using Google's on OS X Mavericks
Android Developer Tools
Build: v22.2.1-833290
but I am almost sure I have done in the past with previous OSX and ADT versions.
I had this issue too and in my case the issue was that the following line was missing from the .classpath file of the current project:
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
Adding it solved the problem for me.
This error is because one of "Android Private Libraries" is either corrupted or of wrong version.
In my case it was android-support-v4.jar.
I replaced it with one from a working project and it works.
I have several Android projects in Eclipse, and all is fine, except one (a library) that can not resolve any imports.
The java.io imports do resolve fine in other Android projects in the same workspace, and previously (I haven't used it for over a year) this library worked fine, too.
Any ideas?
Check two things
Eclipse preferences
Check your Eclipse preferences: Java -> Installed JREs
The one that you're using should be marked and it should be a JDK not just a JRE.
Project build path
Also check your project's build path: Right click on the project -> Properties -> Java Build Path
Check in the libraries folder whether the JRE System Library is present and ...
If not add it using Add library -> JRE System Library and then
select the correct one (from an installed JDK).
I am using Maven an this is what I did to re-solve -->
Right click on project
Maven -> Update Project. Make sure you choose 'Force update of Snapshots/Releases'.
Also check the 'clean project', 'update project conf from pom' and 'refresh workspace resource options' and click ok.
The following worked for me:
Close the project and reopen it.
OR
Clean the project ( = rebuilds the buildpath and thereby reconfigures the JDK libraries).
I was missing the JRE Systems Library in my Project Tree.
And navigating to Projects' Build Path and 'Add(ing) Library' worked!
I just ran into this problem with Eclipse 2022-6 and java-17-openjdk-amd64. I just appeared during editing in another file, the same code had worked before.
For me, all settings were correct and none of the above tricks worked. What I then did was completely removing the import command import java.io.Closeable;, saving the file, adding the same import command back at the same place, and saving again. The error disappeared.
I'm interested in running the Android Support library demo projects for the v4 library.
Using the Android SDK manager I've installed the Eclipse plugins, and APIs from 2.2 to 4.0.1. There are several issues involved, and the sample project as provided is far from running on my configuration, as downloaded.
To reproduce this error:
Install SDK and Eclipse Juno
Import the sample v4 compatibility project using File --> New --> New Project and choose "from existing code", targeting, for example, the Support4Demos folder in <Android-sdk-path>/extras/android/support
Open the file AccessibilityManagerSupportActivity.java. The following errors appear.
Open res/values-v11/styles.xml. The following errors occur.
How do I get rid of these errors? I'd also like to understand why they are appearing so I can fix them in the future.
Thanks!
Clean solution is to:
Right-click your project.
Choose "Android Tools"
Choose "Add support library".
Install the appropriate support library (the newest)
I can't really answer you on the why this problem happens, but I'm guessing the Android team doesn't supply the Android support library, because it's changing all the time, so not to get stuck on some older version, they want us to supply it on our own.
If errors still persists or new errors come up, right-click the project again and choose "Android tool" -> "Fix project properties"
Update: In conjuction to my answer, the way to remove the rest of the errors is to import the project another way than you did.
Select File -> New -> Other
Click Next
Write Android Sample
Select Android sample Project and click Next
Now add the Android support librarys as described above.
You will get errors still however. To fix these, do the following:
Right-click your project and select "Properties"
Select Android
Select an SDK version equal to 3.0 or above
Select Ok and clean the project from the project menu.
All done ;-)
Now you won't be able to run the sample project on devices lower than Android 3.0.
The reason is because of some dependencies on some themes and settings, that wasn't added before Android 3.0 apparently.
It doesn't make sense why Google did this, but they did. You could try to remove the SDK +11 (Android 3.0) specific dependencies, but it will take some time - there are more errors than you actually see - especially in the XML files.
You have to add the v4 support library.
In order to do that , please follow these steps :
Select your project.
Click on Project from the menu.
Select Properties.
Click on Java Build Path.
Select the Libraries tab.
Click on Add External JARs.
Select the main directory of the Android SDK that you installed, then go to extras -> android -> support -> v4 , and then select android-support-v4.jar and click on Open.
Click OK.
This should remove the errors.
Please check your libs folder has android-support-v4.jar is present or not. if not add this jar file in libs folder.Just copy the android-support-v4.jar from any project and paste it to the libs folder of your project
I spent a whole night on this but can not solve this problem.
I finally solved the by accident: change some file in the demo and save, then change it back, this cleared all the errors. I think when you change some file and save, eclipse build the project and generate the R.java.
I am having this annoying problem which takes 10-20 seconds and sometimes more every time my android project is refreshed or rebuilt.
I searched for android forums and also in stackoverflow and but solutions does not make sense. Please give me the solution or link to it.
My android project depends on two external java libs and android libs. Tell me if you need more info.
Earlier I asked this question and it solved the problem by removing 'source attachment'. But I believe it is not a good solution because I need source to be attached with jar. It helps while debugging, code browsing. If source is not attached then, your breakpoint stops there and you can't go in readable source.
Better Solution Needed. Is there a launcher option? which disables when app launched. or build options?
Instead of attaching a source folder to the .jar file, you should zip the source folder and attach the zipped file to the .jar.
See this answer for more info https://stackoverflow.com/a/9699242/637754
The reason for this is that you have attached source with your dependent jars. Just the remove the source from the class path. This how it can be done.
Right click on the project -> Select Build Path -> Configure Build Path.. -> Select Libraries
Select the Source attachment and Remove button will highlight. Press Remove and OK.
I think that should fix your issue.
this helped me so you can try too:
Go to your Workspace root/.metadata/.plugins/org.eclipse.jdt.core/ and remove .org.eclipse.jdt.core.external.folders folder
it contains .project file with links to external folders which takes too long to refresh
You can disable "Refresh on access" option in Window->Preferences->General->Workspace - it have no effect as I think, because even it's turned on you must manually refresh projects if you modify them outside of Eclipse
If anything else fails (my case), install a fresh copy of Eclipse Juno
Go to Help-Install Software, and add this repo:
https://dl-ssl.google.com/android/eclipse/
Check all options and install.
For migration reasons I was trying to install Eclipse on MAC OS Yosemite, since Android Studio is now the official IDE, it is hard to find Eclipse setups with the ADT plugin included. I tried several versions of Eclipse, and JUNO did the work.