I am facing the below problem while importing the downloaded project into Andoroid Stuio.
Please help me.
**
Could not execute build using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.7-bin.zip'.
Build file '/Users/Rajesh.K/Desktop/Test/Project/build.gradle' line: 9
A problem occurred evaluating project ':Project'.
A problem occurred evaluating project ':Project'.
SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
Consult IDE log for more details (Help | Show Log)
**
Please help me to come out of this isssue. I am facing this issue in the Android Studio Mac version.
Are you trying to imort studio project into Android studio or eclipse project into Android studio.?
Try to set up your ANDROID_HOME as studio asking you. ( export ANDROID_HOME="PATh to your SDK folder" ) and run studio form this console.
Or you can try to configure in within Android Studio (File->Project Structure->Android SDK) And then you should set the proper SDK path.
I faced something similar but the difference was I had already set the variable into Android Studio and even with that, it was not recognized.
What I did was a simple File -> Invalidade Cache and Restart -> Invalidade and Restart.
I did not go deeper to check if it is a known issue on Android Studio.
Related
I tried importing via import project wizard, didn't work. This project is using Gradle Kotlin DSL. I am using Android Studio 3.1.4.
I tried running gradle idea and got this message
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/user/Projects/firebaseauthui/FirebaseUI-Android/build.gradle.kts' line: 400
* What went wrong:
SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
What is the recommended way to import this project as they have migrated to Kotlin DSL?
This has been reported on GitHub Repository. Still I have issue importing.
A note on importing the project using Android Studio: Using 'Project
from Version Control' will not automatically link the project with
Gradle (issue #1349). When doing so and opening any build.gradle.kts
file, an error shows up: Project 'FirebaseUI-Android' isn't linked
with Gradle. To resolve this issue, please git checkout the project
manually and import with Import from external model.
According to your issue
* What went wrong:
SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
Looks like Android SDK is not configured in your project which is why it is failing to compile project in Gradle.
Try this solution:
Go to your project ('/Users/user/Projects/firebaseauthui/FirebaseUI-Android/')
Find local.properties file.
Open that file and add this variable if it's not there
sdk.dir=`path of your Android SDK`(it is where you've put android sdk in local storage)
"For more generic way, check this solution" SO answer by #Ziggy192
I did update the Android Studio, current version
Android Studio 3.1.4 Build #AI-173.4907809, built on July 24, 2018
JRE: 1.8.0_152-release-1024-b01 x86_64 JVM: OpenJDK 64-Bit Server VM
by JetBrains s.r.o Mac OS X 10.13.6
I did update Kotlin plugin, current version
Version: 1.2.70-release-Studio3.1-1
Still I could not import from Version Control- GitHub.
Manual git checkout then open build.gradle.kts with Android Studio did solve the issue.
Getting started:
1. Get an Android Studio version 3.0 and above (You got it)
2. Make sure you have install Kotlin plugin.
Go to File | Settings | Plugins | Install JetBrains plugin… and then search for and install Kotlin. If you are looking at the "Welcome to Android Studio" screen, choose Configure | Plugins | Install JetBrains plugin… You'll need to restart the IDE after this completes.
3. Make sure you have Firebase Authentication
Go to Tools | Firebase | Authentication | Connect to Firebase | Add Firebase Authentication to your app.
With this step, you don't have to manually download the Firebase AUth.
4. Done
Source : Kotlin for Android Firebase Auth
I cloned the FirebaseUI-Android project and tried to reproduce your issue. I found two solutions for it.
If you just want to build the project locally as you mentioned in one of your comment. You can use command line to do it.
First you need to create an environment variable named ANDROID_HOME in your operating system and set it to SDK location. It's required so that gradle can find all the tools required to build the project.
Open a command prompt(Windows OS) on the project root directory.
Type gradlew assembleDebug to build the project. You can also try to run other task available in gradle as per your requirement.
I tried to import project via wizard but it did not work for me as well. I then first opened a random android project in Android studio and then tried
File > Open... > Selected the FirebaseUI-Android Project > New Window
These two procedure worked for me but I'm not sure if it's the recommended way.
Note: Please make sure you set the ANDROID_HOME if you get SDK location missing issue in any of the two solutions. You will also get error in project as google-services.json is missing and I hope you know how to fix it.
My Android Studio is v3.1.4 and Kotlin Plugin is v1.2.50
The error is suggesting that the android studio cannot find your android SDK you should go to:
File -> Project Structure -> in right panel choose SDK location -> set your Android SDK location.
Try to sync project with Gradle files from Android Studio:
Step 1 - File -> Sync Project with Gradle file
Step 2 - Once sync is done :- File - Invalidate caches/Restart.
I hope this will help you.
Please resolve my issue during android programming, I am getting error as Gradle Project fail please refer screenshot and provide me the solutions.
Regards
Hussainenter image description here
1) You can try install jdk1.8.
2) In AndroidStudio File->Project Structure->SDK Location, select your directory where the JKD is located, by default Studio uses embedded JDK but for some reason it produces error=216.
3) Click Ok.
while re-importing my project android studio show's plenty of errors
after cleaning and re-importing my project i have got an red circle with “J” on my java files and i'am enable to run my project
Make sure that your gradle version is defined properly.
It seems that this project was on another PC and you imported it on your computer. I think that probably a gradle version conflict occurred and you have two options:
one is to let android studio download gradle version specified in TlaProject (gradle 2.4)
another solution is to edit app level 'build.gradle' file and change its version to a version which is available on your machine (to see which version is available on your system, please check 'gradle' folder inside installation folder of android studio)
My problem was solved by updating the version of android studio .
I'm trying to migrate my android projects from Eclipse to Android Studio v1.0.1 in MAC
If I create a new project everything works fine but if I import one of my projects from Eclipse I get the following error:
Error:A problem occurred configuring project ':MyProject'.
SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
My local.properties file already has the correct path to the SDK (which I already had installed when I downloaded the ADT bundle for Eclipse)
I also defined ANDROID_HOME environment variable like the answer of this question suggest Setting ANDROID_HOME enviromental variable on Mac OS X
but the error remains. I think there might be something wrong exporting from Eclipse with Gradle or something like that but I really have no clue how to fix it.
Hope anyone can help. Thanks in advance
you may need to move the settings.gradle file to the project folder
I had the same problem and after changing the file location to the project folder everything goes right.
Hope this helps!
I hope you are following the instructions here
https://developer.android.com/sdk/installing/migrate.html
Check if SDK location is correct
1 - Open Android Studio
2 - Up, Left corner click File->Settings
3 - Look for Appearance & Behavior -> Android SDK
4 - Click Edit, and browse you SDK location (usually is in :Users\\AppData\Local\Android\Sdk) http://i.imgur.com/JIzMebh.png
Check if path on local.properties is correctly setted too.
I've got a win8 64bit computer.
I downloaded android studio, exported from eclipse my project as gradle build.
Then I wanted to import in AndroidStudio, but it always fails with the following message:
Could not fetch model of type 'IdeaProject' using Gradle installation 'C:\Develop\gradle'.
Build file 'D:\www\DiLocSyncMobile\native\android-debug\build.gralde' line: 9
A problem occurred evaluating root proect 'android-debug'.
A problem occurred evaluating root project 'android-debug'.
The SDK directory 'C:\Applications\adt-bundle-mac\sdk' does not exist.
Consult IDE log for more details (Help | Show Log)
I tried nearly everything (downloaded gradle, added it to the path, delete .gradle folder in user directory, etc.
But nothing helped..
Some ideas?
It looks like your SDK directory is not set correctly. In fact, it seems as though it is set to the mac android developer tools.
I would suggest lookings at your local.properties file (or creating one if it is not already in the root of your project) and making sure that it has the following line:
sdk.dir=<path to your android sdk>