I have ADT Eclipse Project and I want to just import that project in android studio.
But I got this error There are unrecoverable errors which must be corrected first.
The error is saying that your project depends on google_Play_Service_Lib and android studio is not able to find that dependency, but what android studio did is giving you the path where you can paste that library and then you will able to import that project.
first download google_service_lib from
https://github.com/aporter/coursera-android/tree/master/Examples/google-play-services_lib
or
https://github.com/MobileChromeApps/google-play-services
and now paste that in
E:\android\CFPEvents\cfp-android-user
now again import..
find project.properties
open it,
delete(No package)android.library.reference.1=../android-support-v7-appcompat
later,you need download the package.
link http://blog.csdn.net/wu_wxc/article/details/47091795
You need to add the
google_play_service_lib
in the folder
E:\android\CFPEvents\cfp-android-user
and re-import the project.
Above answers are right but it seems it is only the First Step on the way to solving this issue because I had faced the same issue.
So what can be done?
First Step
First download google_service_libary not only jar and now paste that in E:\android\CFPEvents\cfp-android-user(path of your project folder).
Second Step
Close your project
Back up your project
Delete the .idea folder in the root directory of the project
Delete all the .iml files in your project
Import your project in Android Studio, and in the dialog that prompts
you for a file, choose the build.gradle file.
After this you should be good to go.
I accidentally deleted a completed project of mine from eclipse. The deleted project is still in my workspace folder. I tried to import it in to eclipse by clicking, File -> Android -> Existing android code in to workspace. I had checked my data in the project folder, before importing it in to eclipse by opening it in notepad. The data was all there then. But after i opened it in eclipse, the data is all lost. The java files and xml files are there, but with no codes inside. It is all 0kb. Is there any solution to recover it back ?
easiest way..
start a new workspace and do an android project import of the project form your first workspace.
In future yo should get use to the git dev flow which would be to set up the project in another folder rather than the eclipse workspace..other benefit is that whenever you update Eclipse versions workspace etc you still have a non corrupted subfolder with all your pojrects in it.
I am trying to import an existing project in eclipse. However i am getting this error in the snapshot below.
This problem only exists when i try to import from my workspace. However if the same project is somewhere else, then i am able to import it successfully.
I also faced the same problem. The trick bellow solved my problem:
check the box Copy project into workspace while importing the existing project.
you have two solutions and they works:
1- move your project package from workspace and place it in another root, then import to eclips.
or
2- rename your project package and then add it and it will fix the problem.
you have a project named X in your workspace still you are trying to import another project named X . you can fix it by deleting the existing project in eclipse and retry importing.
Fixes
You can change your workspace and import this project in to the new workspace
delete the project from eclipse and import without using copy project in to workspace
Android -> Existing Android Code Into Workspace, You must use General->Existing projects into workspace. It's probably a solution
You should change workspace path.
For to do Change The Workspace Path:
I have checked all the solution and finded that in most of cases "Changing the Project location" form Workspace worked in 80% cases. But for next 20%,i would recommend to do following:
Change the folder of Project and then Import it. (first do this)
If above does not worked, Rename the Project and then try importing it.
If still you are not getting success,check whether you are importing the project from 1 workspace folder to other or not.IF yes,then while importing the projects,check the option "Copy project into Workspace".
And even if you are not getting success, clik import --> General --> Existing Project into Workspace.
PS --> If this solution worked for you,please vote-up as i am newbie here and hence need that to participate in major questions and answers.
I have map Project in Eclipse IDE and I Cleaned It From Project Menu.It deleted mY BIN Folder and also Gen Folder.Now I Have tried Much BY Build Manually and also from Android Toold To Fix Project Properties But It is Not fixing the Problem and In Source Files R is Red underlined and Bin and Gen Folder are Not Being Created again.Please any oNe Help me to To Get Out OF this issue.
There may be Some Reasons :-
1.from Project-> checked Build Automatically.
2.There Should not any error in your xml otherwise R file will not build automatically.
3.Refresh the project & Restart eclipse.
First backup(e.g. zip) your whole workspace before you start experimenting. Then try to remove IDE specific files e.g. .project .classpath and setup it again. If it fails create new project with similar configuration and simply copy your libraries and source code into new project. Eclipse IDE is pure magic sometimes.
If you have imported this project, then try import as a general project, not as android project. then in build path see if all libraries are present, then run as android application
you have to try till you succeed process.
Try following steps:-
Make sure there is no error any any of your .xml files .. check in
Problem section..
Make sure all your impoert are correct, Eclipse sometimes do import
android.R; on its own, so remove that..
If that doesnt succed make some changes in Manifest file say remove a
word save it then again add that word save it.. I know it doesnot
make sence as code but making changes in Manifest files rebuilds the
workspace an so is the auto generated files. then clean build your
project.
Restart Eclipse as last resort..
try the following steps to help us
remove if imported import android.R; and after like example if your application package name is com.example.project you need import like import com.example.project.R;
I have an Android project developed on Eclipse (GNU/Linux) that I last touched half a year ago. I am trying to import the project into Eclipse 3.6 on Windows (with ADT installed) installed using File -> Import Project in Eclipse. When the project is imported, I see the following error twice on the console:
[2010-12-10 02:17:12 -
com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper]
Unable to read C:\Program
Files\Android\android-sdk-windows\AndroidManifest.xml:
java.io.FileNotFoundException:
C:\Program
Files\Android\android-sdk-windows\AndroidManifest.xml
(The system cannot find the file
specified)
Why is Eclipse looking for AndroidManifest.xml on the Android SDK path? The file actually seems to be in the project's directory. How do I fix this problem and get the project to compile?
A simple solution is to either reimport the AndroidManifest.xml file or make a change to the file and save it. This worked for me.
If you see an error about AndroidManifest.xml, or some problems
related to an Android zip file, right click on the project and select
Android Tools > Fix Project Properties. (The project is looking in the
wrong location for the library file, this will fix it for you.)
from: http://developer.android.com/resources/tutorials/notepad/notepad-ex1.html
The way you are importing the Android project into Eclipse is wrong. The Correct way of doing is File -> New Android Project. In the Contents Tab in "New Android Project", select "Create project from existing source" and choose the Build Target. That should fix your problem.
It appears that this error is produced because Eclipse thinks the default location for new Android projects is the Android SDK path. Even if the project location is changed, the error fails to be resolved, so the trick is to change the project location before Eclipse is aware of the condition generating the error.
To circumvent this quirk I imported the old project with the following steps:
File -> New -> Android Project
Un-check 'Use default location' and browse to project root directory.
Click 'Create project from existing source'
It's important to do step (2) before (3) otherwise the error persists and prevents running the project.
I had the same problem, all of the above did not work. I cleaned the project and it worked.
Instead of using File ---> New Android Project --> "Create project from existing sources", which will result in the error your are seeing, choose "Create project from existing sample" and choose it from the drop down. This will work.
Experienced JAVA developers tend to go with the first option which is normally there and works for classic Eclipse projects. But this is not your typical project and I bet the Google developers put this special case in the wizard to accommodate the differences.
I had the same problem. I was trying to compile the JakeWharton view page sample, so I checked out the GIT in a directory in a different folder then the workspace which caused the problem.
Eclipse was maintaining 2 folders:
1. A new workspace folder was made under the workspace directory, which eclipse checks for libraries and others source code including the AndroidManifest.xml file
2. The existing folder which was not under the Root workspace
To fix the problem after importing I had to manually move the files in the new workspace folder created by eclipse.
I met this problem when using Facebook SDK, now I solve it by doing this:
Close the project;
Copy "AndroidManifest.xml" file to the project's root path;
Open the project and refresh it, it's Done!
this worked for me by the way:
I changed the project name to the exact name of the project that I am importing.
Eclipse seems somewhat fragile in its naming conventions. One of the causes for this error is a difference between the project name and the folder name in the workspace. I imported a zip file for a project named "HelloDialogs" into a workspace folder named "HelloDialog". This caused the "AndroidManifest.xml file missing" error. Once I renamed the folder correctly, everything worked fine.
Because of the multiple different answers here, I thouhgt I'd add yet another one that worked for me, as I had exactly the same issue when first working with Phonegap android dev tools.
So I found (as mentioned by Gintautas in comments to the accepted answer), that I had to create a new project using the phonegap 'create' script, then when importing the project into eclipse. the only way to get this to work successfully was if the project was originally created in some temp folder somewhere other than the place I actually want to work with it.
So I created a project in windows like this in a cmd window...
c:\phonegap\phonegap-2.6.0\lib\android\bin>create.bat c:\temp\android_boilerplates\test app.test test
Then I imported the project in eclipse like this...
File > New > Project
Within the new project wizard select: "Android Project from Existing Code"
Click "Next"
Now navigate to the temp location of your project and set that to the root directory, check the project you want and check "Copy projects into workspace" as the example below...
Click "Finish"
And that's it, Eclipse should copy all your project files into your workspace and there shouldn't be any errors in your project (fingers crossed).
Your project should look something like this...
Hope that helps, it took me an age to work out why Eclipse didn't like creating a new project from existing code when the new project was being setup in the same place as the existing code. This isn't a problem for other languages I've used, so it was a little weird, but understandable as Eclipse (I'm guessing) seems to want to overwrite certain files.
Eclipse randomly decided to make another folder instead of the one that i had specified, but doesnt have any resources or data or layout etc in it..
it has some conflicts i guess..
anyway, a noob approach to this was, copying the original file to some other location(i put it to desktop)..
now create new project-create existing project, select this one from desktop, n VOILA.. its all fine.. :D
I am a little late to this game but I caused this same problem by generating the initial application into the exact location I was going to work on it. That is to say I put it directly into my current workspace. I then did File, Import, Existing Android Code Into Workspace. The import process blanked out my android.xml file.
I tried above solutions and had no joy. I then generated the initial application into a temp directory and imported from there. This worked for me.
The only way to import a project into eclipse workspace is to create an empty project and then drag and drop all the folders and files into this project. Why is this so is beyond me.
The answer from Raunak is wrong.
I found a .classpath file in the root directory of my Android project. I opened it and updated the file paths in it, and it seemed to fix the problem for me.
I had the problem when I tried to update an old project with recent code from the SVN. I had the Manifest.xml exported to my local file system as backup and deleted it. I've then reverted my complete project to the most recent version from the SVN and then it worked :)
This is what I had to do to get this to work. Fortunately I had backups of earlier "project".
1) Import the project as usual.
2) If the errors with empty xml etc. comes up, close the project.
3) Go to the original project if you have backup.
4) Copy all of the projects root files and directories and paste it over where Eclipse expects the projects root directories and files to be.
5) Open the project and refresh. Make "Clean" if necessary and you're done!
Always make backups because Eclipse f--kups! I learned this the hard way when suddenly my Android project refused to work because of empty manifest-file.
Sometimes if you automatically fix imports in MainActivity IDE imports android.R class instead of one that will be generated for the project. Remove the import and recompile.
when importing project from another workspace add existing project in workspace. and tick to the copy projects in workspace.then check the api level and supporting library from project.properties files.then rebuilt project and clean it.. it is works for me.
2017 Solution: Much Easier and tested solution is to remove your application folder from elipse project only then Import it again and the problem will be fixed immediately!