i have just migrated to ubundu 64bit 14.04 LTS operating system...after downloading android studio, i picked the option "Check out project from Version Control" to pull a project from github repository. In the next step after cloning the project i checked the "Create project from existing sources" option, after that i followed all the steps without changing anything and the project loaded in Android Studio. The problem is that i get "Migrate Project to Gradle?
This project does not use the Gradle build system. We recommend that you migrate to using the Gradle build system." warning and i get the following error logs:
Have you tried to import the project rather than simply opening the project?
File->New->Import project.
Related
When I import a downloaded project, I get this message:
Migrate Project to Gradle?
This project does not use the Gradle build system. We recommend that you migrate to using the Gradle build system.
More Information about migrating to Gradle
Don't show this message again.
How to make the android project using gradle build system?
Go to the Welcome Screen of Android Studio (If you are in a project: File->Close Project).
There is a button "Import project (Eclipse ADT, Gradle, etc.)", press it.
From here on out, the wizard will guide you, but I'll describe them here too:
Select your project folder.
Enter your new project path.
Check all boxes.
There are many guides for migrating to Android Studio out there (for example by Google themselves).
I set up git in Android Studio
http://maxrohde.com/2014/08/18/import-github-project-to-android-studio/
Then imported this project
https://github.com/GautamGupta/Simple-Android-OCR
The following error was displayed:
Migrate Project to Gradle?
This project does not use the Gradle build system. We recommend that you migrate to using the Gradle build system.
What can I do to fix this?
That project hasn't been modified in two years, really four for most of the project, so it uses the older project layout and was very likely developed using Eclipse rather than Android Studio.
Here is the Google reference for migrating a project from Eclipse to Android Studio:
https://developer.android.com/sdk/installing/migrate.html
An option if simply importing doesn't work is to install Eclipse and do an export from there to Android Studio. While you could just work in Eclipse it is deprecated for Android development and you'll find many more up-to-date resources for Android Studio.
How do you import an Eclipse project into Android Studio now?
Android Studio's default build system is Gradle. That GiftHub project is not using Gradle build system. Probably created from Eclipse (Ant build system)
So when you open a project that does not use Gradle build in Android Studio, it will ask to convert the Project to Gradle based build. You just give yes on the popup, it will take care of everything.
http://gaut.am/making-an-ocr-android-app-using-tesseract/#comment-184181
here it explains solutions for gradle errors
That's not an error!
The recommended build system for android projects is gradle.
But the author of this project in github did it using only eclipse without any special build system.
You just need to answer "yes" to that popup message and Android studio will convert the project to use gradle
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.
How can you migrate to Android Studio using an Eclipse project depending one many user libraries?
I've tried using the Eclipse export to gradle but I can't seem to get it to work.
Also, my project sources are not in the workspace.
As of Android Studio 0.4.2, you can now import the Eclipse project from Android Studio.
Note: This is different from Eclipse's export Gradle project function.
Open Android Studio
Verify the version is >0.4.2, if not update to it. (I had to download it from the tools website)
Import Project...
Navigate to the actual Android app project, the highest level project (not the workspace or the directory containing all the eclipse projects)
Follow the wizard to import it all
The advantages of doing it this was is that :
makes the migration less painful
generates gradle files
restructures your project as a gradle/Android Studio project
I have a project that was originally from IntelliJ.
I followed the instructions below.
http://tools.android.com/tech-docs/new-build-system/migrating-from-intellij-projects
I'm not sure what to do next. When I load my project in Android Studio it still asks if I want to migrate to gradle. What did I miss?
I am able to use Gradle in the command prompt to build my project, so I assume I just need to tell Android Studio to use Gradle instead of Ant.
I next imported my existing project and it recognized it as a gradle project. I also had to change the gradle version in the gradle.build file to work with the newer version of Android Studio.