Can't import eclipse project in android studio - android

I am trying to import eclipse project in Android Studio using http://developer.android.com/sdk/installing/migrate.html
Android Studio Version 0.4.2
Steps I followed:
Exported Eclipse project using "Generate Gradle build files"
Import Project in Android Studio and selected the build.gradle file.
Now when I open any layout file in Android Studio it gives error:
"Rendering Problems No Android SDK found. Please configure an Android
SDK"
I have earlier resolved this issue but don't remember how I did it. My other projects are working fine and Android SDK path is correctly specified. How to resolve this?

Create a local.properties file in your root directory of the Gradle project.
It should contain the path to your Android SDK
sdk.dir=/Users/leandros/android-sdk

File Menu > Project Structure > SDK Location.
If you're running an older version of Android Studio, it may be called something other than "SDK Location" in the Project Structure dialog, but it should still be there.

Related

Android Studio 1.4.1: Gradle Project Sync Failed

I imported a project created from Android Studio earlier version. I am running Android Studio 1.4.1.
I am getting following error message:
Error:The SDK directory '/media/delta/f2164b84-872f-493c-9d9f-8edf44dc4428/home/delta/Android/Sdk' does not exist.
Please fix the 'sdk.dir' property in the local.properties file.
Open File
The SDK directory it is referring to /media/delta/f2164b84-872f-493c-9d9f-8edf44dc4428/home/delta/Android/Sdk does not exist in my machine.
I tried all suggestion proposed by:
Gradle Project Sync Failed - Android Studio
I change sdk.dir in local.properties file to actual sdk folder still does not work. Please help.
Go to
File -> project Structure into Project Structure
Left -> SDK Location
SDK location select Android SDK location (old version use Press +,
add another sdk)
Then sync project with gradle files

Why is android project not opening properly in Android Studio?

Why is android project not opening properly in Android Studio?
I have an android project, set up as such
However, when I open it on android studio,
The structure is setup up as such
Having understood that the project is from an eclipse ide, I tried to open the file, and then export it, however I get this error:
Project 'freegemas-android' is missing project dependency '/freegemas' in Eclipse workspace.
Export from Eclipse
1.Update your Eclipse ADT Plugin (you must have version 22.0 or higher).
2.In Eclipse, select File > Export.
3.In the window that appears, open Android and select Generate Gradle build files.
4.Select the projects you want to export for Android Studio and click Finish.
Your selected projects remain in the same location but now contain a build.gradle file and are ready for Android Studio.
Import into Android Studio
1.In Android Studio, select File > Import Project.
2.Locate a project you exported from Eclipse, select the project's root directory and click OK.
3.Select Create project from existing sources and click Next.
4.Follow the walk-through to complete the import process.

"Gradle location is incorrect" when migrating android project from eclipse to android studio

I followed the this guide to migrate my android project
https://developer.android.com/sdk/installing/migrate.html
I have exported a Gradle file through eclipse. When I try to import the project to android studio, I am stucked with this error. Please help
Android studio version 0.6.1
That's not asking for your project's Gradle structured files it wants the location of your Gradle Build tools or Gradle configuration file.
It defaults as a file called .gradle in your user home directory I think.
Mine points to:
/home/indiv/.gradle
Although, I found it easier to import my Eclipse projects into Studio (as Eclipse projects) than export a Gradle project from Eclipse and then import to Studio.
Your choice though.

Convert a project to Android Studio

I'm trying to open the following project https://github.com/mik3y/usb-serial-for-android on Android Studio but all the things I try it give me errors related to gradle :s
It says version 0.9.0 introduce some incompatible changes but then I can't make the changes they said.
Can anyone try it to me?
The biggest issue is that Android Studio uses Gradle and Eclipse does not. It sounds like the GitHub project was built with Eclipse, which means you first have to import that project into Eclipse, then export it with the Gradle files.
From the Android docs
Export from Eclipse
Update your Eclipse ADT Plugin (you must have version 22.0 or higher).
In Eclipse, select File > Export.
In the window that appears, open Android and select Generate Gradle build files.
Select the project you want to export for Android Studio and click Finish.
Your selected project remains in the same location but now contains a build.gradle file and is ready for Android Studio.
Import into Android Studio In Android Studio, close any projects currently open. You should see the Welcome to Android Studio window.
Click Import Project. Locate the project you exported from Eclipse,
expand it, select the build.gradle file and click OK. In the following
dialog, leave Use gradle wrapper selected and click OK. (You do not
need to specify the Gradle home.) Now that your project is imported to
Android Studio, read Tips and Tricks for some help getting started.
Note: It's possible to import an existing Android project to Android
Studio even if you don't generate a Gradle build file from
Eclipse—Android Studio will successfully build and run projects using
an existing Ant build file. However, in order to take advantage of
build variants and other advanced features in the future, we strongly
suggest that you generate a Gradle build file using the ADT plugin or
write your own Gradle build file for use with Android Studio. For more
information about the Gradle build system, see the Gradle Plugin User
Guide.

Importing project into Android studio

I am trying to import an Android library I've created into Android Studio. I've exported the app from Eclipse by going to File > Export > Gradle Build Files which completed successfully.
However, when I try and import the project into Android Studio I get the following error:
You are using an old, unsupported version of Gradle. Please use
version 1.8 or greater. Please point to a supported Gradle version in
the projects Gradle settings or in the project's Gradle wrapper (if
applicable)
I've followed the instructions from Unable to import Eclipse project to Android Studio but this hasn't worked.
Thanks for any help you can provide
Download Gradle 1.8: http://www.gradle.org/downloads
Install/Copy it in a folder on your computer.
Check what gradle installation you use in Settings (Strg+Alt+S) -> Gradle
Check "use local gradle distribution" and point in "gradle home:" to the gradle installation

Categories

Resources