Error while trying to add AndEngine to my example project - java

I've downloaded the latest AndEngine from Nicolas on his Github repo. Made all the extensions compile on my workspace, everything was okay.
Created a project to start testing the Engine, but whenever I go to my example project properties > Android and try to add AndEngine or any of its extensions, there's a green tick... so I accept when I apply the changes, but when I open the Android configuration again and see the library imports, there's a red "X" on every import, like it failed.
Here's the screenshot:
Does anyone has encountered this problem before? How do I solve it?

No worries, made it work thanks to a guy from this forum
http://www.andengine.org/forums/tutorials/getting-started-with-andengine-t4858-180.html
Going to quote what he said, it really worked:
Hey, look, I can contribute! (Sorry, I'm just excited to be able to
add something here)
I had this same issue and resolved it by moving the libraries
(AndEngine, etc.) into my Eclipse workspace.
For instance, I originally had all my AndEngine files in C:\Users[my
user name]\git\AndEngine\ and encountered the same errors you
describe. After some Googling, I found that I had to move the
AndEngine library from .../git/ to my eclipse workspace, which is
located at F:\android-workspace
So in the end my project's files were located at:
F:\android-workspace[project_name]
And the AndEngine files were located at:
F:\android-workspace\AndEngine
Be sure to re-link the library to your project after moving it. Also,
I apologize for my verboseness, I just wanted to be clear.

Related

Files under the "build" folder are generated and should not be edited

This morning I was coding an app following a tutorial (https://www.youtube.com/watch?v=iFdtSi1v1Vk/) and after adding
compile 'com.microsoft.projectoxford:emotion:1.0.355'
as stated in the tutorial to the build.gradle and then syncing the gradle, almost everything in my manifest turned red and I got the message stating "Files under the 'build' folder are generated and should not be edited." How do I fix this? I have tried everything in other stackoverflow forums related to this query to no avail. I really do not want to start over as I have put a large amount of effort into this app and would be devastated.
Screenshots -- https://imgur.com/a/g46Ws
Fixed by removing the line of code that caused the issue and rebuilding the project, as well as syncing the gradle.
I solved the error by cleaning the project. In the android studio, navigate to the Build, the click on CLean Project. It will solve.

Eclipse Will Not Generate R.Java In Linux

as stated in the title. I can not get Eclipse to generate an R.java file. It fails immediately after the creation of the project. I have read around and fixes have been stated as such:
Clean Project
fix android project
make sure all res/ files are lower case
make sure xml files are clean and no errors
make sure Build Tools is installed
Well I have tried everything for 3 days now and i can't get anything to work. I have even gone as far as marking every file in my android-sdk as "executable". Nothing works for me. Mind you I have never had this problem on my windows 7 machine. I am fairly new to android development.
I have attached images. First one is a screen shot showing that I do have all build tools and up Second is a Screen shot showing the errors and directory tree within my project. As you can see the only errors output are those that point to R.Java File
edit: I can't upload images so I have provided links to the screenshots within my Google Drive
https://drive.google.com/folderview?id=0B73rHBl5RuotOTUtQURfUTdveW8&usp=sharing
This looks like a duplicate for this one:
"R cannot be resolved to a variable"?
It has been extensively responded.

R.java is missing on a clean Android Project

I'm creating a clean project on ADT and I noticed that the gen folder is empty (with no R.java in it), not letting me run the project. I'm running ADT with all stuff up-to-date (as you can see here)
I already cleaned and built it in every possible way. I also tried to reimport the project, and nothing. There are no errors in the XML files.
I searched for a solution and I found a lot of people with the same problem, and in most cases the solution was to update the SDK tools, but it didn't work for me.
Is there a reason for this?
at the top of screen, click build -> rebuild project
Give it a few seconds. it worked for me, i hope it save you aswell
im using Android Studio(beta) 0.8.9
My R disappeared after i fiddled with sound files in my res/raw directory(converted them to different formats, figuring out how SoundPool class works...and suddenly there is red "R"'s everywhere!
Try right clicking on the project, then going to Android Tools > Fix Project Properties.
If that doesn't work, then try cleaning it before and possibly after that.
If R.java disappears, you usually have to recreate the project from scratch again.
There are many reasons for R.java missing issue, i use to face this issue frequently, some of my thoughts to debug this issue.
Try creating another test project using File->New->Project->Android->Android Application Project. After creating the project run the project in emulator. If every thing works then your setup is perfect.
Check your imports section of your java files, some times default R.java gets included which is from android package. In this case Remove that import and add correct import statement.
Check your "res" folder all the xml's should be well formed and valid.
Hope these debugging steps may help to find the root cause.
try deleting the r.java file in gen folder. when you run again after cleaning and building the project. It should recreate those files and it should work after that. Try that.
Other wise you might have to reinstall Eclipse as you have tried in so many different projects
Something I just noticed was that after I removed the auto-generated code for the menus (which I wasn't using) it started causing errors. Eventually when I cleaned with the menu xml's still in the file structure, my R file disappeared. I removed all entries in the menu folder and then cleaned again. This worked for my specific instance. Hope this helps others as well.

How do I fix these missing libraries?

So these are the three missing libraries, that I still didn't manage to add to my imported project. I tried a lot of things and it simply won't work. I downloaded google play services with SDK manager and google-play-services_lib isn't there, while google-play-services is there, but I need both. As for CaptureActivity and PortraitQR, I tried adding both jars from the project dexedLibs but it didn't work. I also tried downloading this but I don't know how to add it to the project (I only know how to add single jars)
EDIT: Okay so I played around a little bit and I think I'm closer to a solution now. I manually added google play services lib and capture activity and this is how libraries look like now:
The only remaining problem is that now there is a red exclamation mark next to my project and when I go to build paths there is this red error:
I tried to look for captureactivity.jar but I can't find it. Can anyoe help me out here?
you should import them with new project->Android project from existing code-> then locate your projects path and also make sure you make them library project; right click on project-> properties-> android -> scroll to bottom and check 'is library' checkbox
and the path for google play services lib is =>
\extras\google\google_play_services
you can also find sample code on there
These three are library projects. Let's say you have a project in your IDE which is called "PortraitQR". It must be open before your project, Evanturist, can see it as a library project. And it's the same story for the other two library projects. If it doesn't work, try removing them in the dialog you've shown here and adding them again.
You should not use any .jar files for this to work. You should have these three projects open in your IDE.

Issue in accessing R. resources in Android 2.2

I am very new to Android application development.
I successfully added some backgrounds to several layouts. And added media files to play. However when I rename a file in the folder structure, it shows an error that the resource does not exist.
But I can see those files in gen-><mypackage>->R.java->drawable.
Now my background pictures and resources do not appear in code.
R.layout.splashforproduct1 it shows an error for splashforproduct1.
not only splashforproduct1 but this issue is the same for R.raw.media.mp4
This is not first time I have got this issues. Please help me.
I am using Android 2.2 with eclipse.
If cleaning your project doesn't work try this: Scroll up to the top of the file and delete the import lines. Then wait for Eclipse to detect your changes and let it work out what you need to import and accept its suggestions.
I guess you just need to clean your project.
In Eclipse you do it clicking:
Project -> Clean and then you choose your android project.

Categories