I load the Vuforia project into Android Studio and get this Error-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.
+
Error running build: Cannot find script C:\Users...\vuforia\v2\samples\app\build.gradle
Actually the build.gradle file is in this folder.
I followed these Steps:
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.
,but not successfully.
Sorry for my bad english.
Related
I am receiving a "can not find symbol" error for dependencies which are already added to the project
The app is running on android studio 3.1, and it compiles and runs normally, as if there are no dependency issues. I tried clearing gradle cache with the cleanBuildCache command, and I also invalidate the cache from File > Invalidate Cache/Restart but to no avail.
Import error in red
Support libraries under dependency on the right, but not showing in external
libs on the left
Try doing the following:
Save your project and close Android Studio
DELETE Project Name.iml file from you project directory
DELETE app.iml file from your Project Name/app directory
DELETE .idea folder from your project directory
Project Name is the name of the project that you set when you first created your project in Android Studio.
Relaunch Android Studio, load your project ,sync gradle and build again.
NOTE: You might have to be connected to internet as it will download the libraries again that were delete when deleting the .idea folder
Also update your gradle verions and use implementation instead of compile as it was deprecated long ago.
Have you tried Build > Clean Project? Or a good old fashioned restart of Android Studio?
Am not getting gradle file in the Android project as it is unavailable in android studio bt is available in project file folder. I tried a lot to resolve this issue but I failed.
Thanks in Advance
The project thinks it's still a non-Gradle based project; it's not the presence of the build.gradle file that makes it Gradle-based, but it's how the project was set up in the first place. You'll need to re-import your project to finish the conversion to Gradle.
First, though, it looks like you don't have a settings.gradle file; it looks like you need one. Since you've set up your project as a single-module project, then you can put the file in your project's root directory, next to build.gradle. It should contain this:
import ':'
In the future if you add more modules to your project you may want to convert it to a multi-module directory structure, but you don't need to worry about that now. In any event, now you need to do the re-import in Android Studio:
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 have facing an exact same situation in past, I solved this error by following step
First of all I would remove following files/directories from your project-folder:
bin/
build/
.idea/
.gradle/
projectname.iml
when you open android studio import your project
First of all This is not a duplicate of any of below questions
Migrate project to gradle error
Can't migrate project to Gradle in Android Studio
This project does not use the Gradle build system. We recommend that you migrate to using the Gradle build system
Android Studio Import Project Error
Now let me talk about the problem. I've downloaded a zip file of GitHub project file to build on my laptop. The name of GitHub project is "VNCpp" As I'm not allowed to insert more than 2 links, I have given the project name so someone can search.
When I import this project into my android studio, it gives me this error : "Migrate Project to Gradle? This project does not use the Gradle build system. We recommend that you migrate to using the Gradle build system"
Edit: Android Studio has built in facility to import eclipse project and convert it into gradle build format. But in this case, it is not happening.
I'm getting 2 options while importing the project 1)Import from available sources and 2) Import from external model i.e gradle
When I select Import using external model it shows error like in this image:
gradle path error
And when I select Import from existing sources it creates some file system that doesn't have gradle structure. So I cannot edit and build the app on studio :
File system without gradle structure
What should I do now to properly import the project ?
I solved this problem after reading carefully [the documentation(https://developer.android.com/studio/intro/migrate.html).
Clone the project from GitHub
Close all Android Studio projects.
From the Android Studio welcome screen, click Import Project (Eclipse ADT, Gradle etc).
Select the project folder with the AndroidManifest.xml file
Click ok.
I just downloaded a project from GitHub to learn from those that know better; Image 1. After extracting the project and importing it to my android studio, it gave me "migrate project to gradle" error.
I have imported using gradle but to no avail.
This is the screenshot of my studio:
Image 2
As per #scott-barta (Original Answer)
The project thinks it's still a non-Gradle based project; it's not the presence of the build.gradle file that makes it Gradle-based, but
it's how the project was set up in the first place.
You'll need to re-import your project to finish the conversion to Gradle.
First, though, it looks like you don't have a settings.gradle file; it looks like you need one. Since you've set up your project as a single-module project, then you can put the file in your project's root directory, next to build.gradle. It should contain this:
import ':'
In the future if you add more modules to your project you may want
to convert it to a multi-module directory structure, but you don't
need to worry about that now. In any event, now you need to do the
re-import in Android Studio:
Close your project, Back up your project, Delete the .idea folder in
the root directory of the project and 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.
If that does not help, this will guide you through the process: Migrate existing project to Gradle.
I have problem with importing this library into eclipse. Things I did:
run gradlew.bat (inside project) that downloaded and installed it
run CMD
set my SDK with command "set ANDROID_HOME=C:\dev\android-sdk-windows"
run command gradlew build
after successful build image I tried to import project into my eclipse but it's incomplete (without any classes)
It's first time I'm using gradlew, could you tell me what I'm doing wrong?
This library is built with Android Studio or Intellj.
These steps with Gradle are referred to Android Studio or IntellJ.
I don't know this lib, but if you are using Eclipse, you should do:
clone a copy of this repository, or download it (outside eclipse workspace)
import the code in your workspace starting from library/Donation-lib folder
mark java(*) folder as source (click on folder -> Build-Path -> use as source folder). You can also remove the src folder, from the project.
mark aidl(*) folder as source
add support library v4 rel.XX ( click -> Android Tools -> Add support library , or just copy android-support-v4.jar in libs folder)
mark your project as Android Library (Properties -> Android -> Is library)
(*) Eclipse uses src and res as source folders.
Android Studio instead uses src/main/java , src/main/res and src/main/aidl as source folders.
Open file build.gradle and add this line on top:
apply plugin: 'eclipse'
In project directory invoke command
gradlew.bat eclipse
Open project in Eclipse (import) like normal eclipse project
More info: Eclipse Plugin
Alternatively use dedicated Eclipse plugin Gradle Integration for Eclipse 3.4.0.RELEASE
There is a simplest and quick way to import a Gradle project into Eclipse. Just download the Gradle plugin for Eclipse from here.
https://marketplace.eclipse.org/content/gradle-integration-eclipse-0
And then from import select Gradle and your project would be imported. Then you have to click on Build Model to run it.
EDIT
Above link for Gradle plugin is no more valid. You can use the following link.
https://marketplace.eclipse.org/content/buildship-gradle-integration