Facebook SDK/Android, Eclipse cannot find resource files - android

When trying to build project HelloFacebookSampleActivity in Eclipse, the layout/main.xml has error
No resource identifier found for attribute 'confirm_logout' in package 'com.facebook.samples.hellofacebook'
The offending line is
facebook:confirm_logout="false".
The facebook:confirm_logout is defined in the FacebookSDK project, not in this project.

You need to configure your Build Path properly and make sure you check the Facbook SDK Project as a Library project.These errors are generally due to misconfiguration in Build Paths.
Clean and Build again after your sure of the above.
Try going to Project > Clean all projects > OK and see if that helps.If you go to the "Problems" tab and paste the different errors you're having it might provide us with more context to help you.

Related

Project has no project.properties file! Edit the project properties to set one error

I am getting the errors:
Errors occurred during the build.
Errors running builder 'Android Resource Manager' on project 'DashboardActivity'.
java.lang.NullPointerException
and
[2013-09-02 17:55:31 - DashboardActivity] Project has no project.properties file! Edit the project properties to set one.
and
Description Resource Path Location Type
The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files UserFunctions.java /DashboardActivity/src/libary line 1 Java Problem
and
Description Resource Path Location Type
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 DashboardActivity Unknown Java Problem
I have already tried cleaning the project and I get the same errors. Only the 'DashboardActivity' project is the one getting this error and my other projects work fine. In my properties Order and Export section there is a part that says "Unable to get system libary for this project"
I know there should be a proper android.jar file here but I don't see one.
Also, the android tools 'fix project properties' does nothing at all when I click on it.
I have the AndroidManifest.xml file as well.
Ever since I first went to clean my project it has created the file "proguard-project.txt" as well.
What can I do to fix this? Thanks in advance!
NOTE: now I can't acess the gen folder or bin folder (there is no little + for me to click on to open it) and now it's saying that R cannot be resolved to a variable) ???
Error while applying
Why don't you do this
Right click on Project Root folder > properties > Java BuildPath > Library Tab
Check whether any of library is missing (showing error with red cross)
if yes then add this library to your project
don't forget to CHECK it on Order and Export
Do one more thing
Right click on Project Root folder > properties > Android > set your Project Build Target
check any one target
Check your Android-sdk path from
Window > Preference > Android
I was also having these errors:
The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object.
and
The Project Properties Order and Export section has an error "Unable to get system library for this project"
I solved it by Right Clicking on the Project Root folder > properties > Android > set your Project Build Target and changed it to the highest target I could trust from working on other projects.
It has been 3 years since I had this project working. So I noticed when I was troubleshooting tonight, that the manifest did not have a targetSdkVersion, only a minSdkVersion of "8". So I had changed that to this:
After doing the above 2 things, all my errors were gone -- however (!) ... a bit later tonight, I was trying to export my project to an .apk. And Eclipse crashed. Upon re-opening it, Eclipse is super broken. I am about to do a re-boot my PC now - and thus need to finish posting this. I trust Eclipse will be back to normal. But the reason I am mentioning this is that I suspect I may need to re-install Eclipse as I have been getting other minor start-up errors when I open Eclipse. And the errors I had tonight in that app were very strange and unusual.

R.java not being generated for new Android project

When I create a new android project in Eclipse, and I choose to have a default main activity, my R.java file does not get generated.
I have seen some questions online and on this site about R.java not being generated but all are due to some manual action/mistake that had to be corrected during the development of the application.
However, does anyone know why R.java would not get generated for a brand new android project, where I have made no manual modifications whatsoever?
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"
I hope you have helped!
ADT version 22 requires that you install "build tools". To get it to work i had to update:
SDK Tools
Platform Tools
Then install:
Build Tools
This link recommends you add build tools to your environment path. I had to do the following before the R.java was generated:
Append build tools to PATH environment variable
Restart Eclipse.
Make sure your project is free of errors and problems. You can use Windows-View to find and rectify them. Common mistakes are in the layout files.
Check the AndroidManifest file and see if the activity names match the classes in your source folder. Clean and rebuild.
R.java creates every time when you create android project first time r.java created by default
so check for the errors and clean the project.

Missing myProject.R file in android

It seams that I missing the R file, this is a common error and usually I have solved by cleaning the projects, using android tools fix project properties and restarting eclipse.
Now I have installed the new android developer tools eclipse and after importing the project I have this error in eclipse:
Errors occurred during the build.
Errors running builder 'Android Pre Compiler' on project 'MyProject'.
java.lang.NullPointerException
and the R file is not generated so it is missing.
The project is a library project. Thanks
Sometimes if you have errors in an XML file, it will stop the project from building correctly and the resources (project.R) file won't be created properly. You will also need to make sure that you are importing your resource file and not the one from android.R
If you've changed the project build target or minSdkVersion, you might have XML nodes in one of your layout files that isn't supported by the SDK you are using which will stop it from building. That's also worth checking
Go to Project and hit Clean. This should regenerate your R.java file.
Also get rid of any import android.R.* statements and then do the clean up as mentioned.
Otherwise, XML resource under layout may not having the correct naming convention or might be having some capital letters.
Try changing them to lowercase and make sure your layout.xml files don't contains errors.
Clean the project because the project may have trouble finding the name of a resources, it really sucks that i constantly have this problem when adding new image..

How do you cause com.actionbarsherlock to be in the gen folder of an Android project?

I'm trying to build and run the demos included with ActionBarSherlock. I go to File -> New Android project from existing source, and navigate to the samples/demos directory. The project is imported into eclipse, however, none of the R. references are resolved, because com.actionbarsherlock doesn't appear in the gen folder.
The actionbarsherlock library is being referenced (Properties -> Android -> Libraries). actionbarsherlock.jar is in the Android Dependencies folder.
Thanks for the help.
EDIT: Just referencing the library in another eclipse project causes com.actionbarsherlock to be properly generated. I have no idea why the same behavior in this demos project isn't generating com.actionbarsherlock.R.
EDIT 2: And now it has magically decided to work. I did nothing special, just continually referenced and un-referenced the library until it worked.
Thanks for looking all, the problem's been solved
the gen folder (and R.java) are generated during compilation. Try doing a clean and build to see if R and gen/ get created.
If they don't, then compilation is failing. If there are any errors in eclipse that are not related to missing R.java, fix them or post them as a comment for more info.
This might be a problem with the import my.project.R statements at the top of each java file, but checking the errors will confirm or deny this.
I don't think the gen folder is created until you try to run the app.
If this isn't the issue, you could try fixing the project properties. Right click on the project --> Android Tools --> Fix Project Properties

Eclipse - Several Errors After Altering Proguard and Manifest Files

I have an Android project for which I use the Eclipse IDE and I wanted to try an use the ProGuard tool to obfuscate/shrink my code. Unfortunately I couldn't get it to work with Eclipse throwing up a ProGuard error when I try to export my project.
To resolve this I altered the necessary project properties file to NOT use ProGuard but Eclipse just complained there were errors with the project which needed to be resolved. I tried cleaning the project, refreshing too but all to no avail. As I use a Mercurial for source control I reverted to my last good sources but now Eclipse throws up even more errors which I cannot get rid of:
org.eclipse.core.internal.resources.ResourceException: Resource is out
of sync with the file system: '/XXXXX/AndroidManifest.xml'.
loadAndParseRClass: failed to find manifest package for project
XXXXXXX
I've never been a great fan of Eclipse but how can I clean my project and get it back to a NON proguard state?
I resolved the problem. There's ANOTHER error log in Eclipse called 'Problems' which tells me my Debug certificate has expired on 25/12/2011. Handy how Eclipse labels this as a 'problem' and not an error and gives no indocation other that a red x that there's some sort of problem!
Anyway I resolved this by going here.
Make sure you Refresh your project so that the state of your Workspace/IDE agrees with your state on disk (Right click on the project and select "Refresh"). This will get rid of the first error you have.
And then just do a Team -> Revert on your projects and select the files that you have changed and want to revert to the checked-in version.

Categories

Resources