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>
Related
My android studio was running perfecly yesterday, but today when I started my android studio and want to run an app on mobile the following error occurred,
I searched on the internet and stackoverflow but no solution is useful
I even manually downloaded the gradle-4.6-all.zip from the gradle/distribution and pasted in ~\.gradle\wrapper\dists, but the error still there.
kindly help me with this.
The error occurs because you don't have unzipped gradle files in ~\.gradle\wrapper\dists directory.
Extract the zipped gradle-4.6-all.zip and extract it in
~\.gradle\wrapper\dists directory.
Alternatively ,Android Studio will automatically use the Gradle wrapper and pull the correct version of Gradle. Beneath your Android Studio's project tree, open the file gradle/wrapper/gradle-wrapper.properties. Check for this entry to be:
distributionUrl=http\://services.gradle.org/distributions/gradle-4.6-all.zip
Clean rebuild the project.
Download Link for Gradle Versions: http://services.gradle.org/distributions/
References:Manually install Gradle and use it in Android Studio
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.
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 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.
I am having trouble building with Android Studio on one of my computers. The same project was building fine and when I pushed to github and pulled from the other machine I get the following error
Argument 0 for #NotNull parameter of com/intellij/execution/configurations/GeneralCommandLine.setExePath must not be null
I tried generating a new default project and I get the same build error so it must be something with my setup.
Does anyone know what I can do to fix these issues? Or even how to completely uninstall Android Studio and start fresh? Thanks
I had same error. In my case it was caused because of modification some important configuration. I fixed the issue by executing following steps:
File -> Other Settings -> Default Project Structure
SDKs
Add new SDK (select JDK option)
Specify path to JDK (in my case it was "C:\Program Files\Java\jdk1.7.0_45")
Save changes
You can also check if you have configured path tho the Android SDK
Good luck!
Had the same problem. Had to uninstall Android Studio, delete all files related to it including install files, the .AndroidStudioPreview folder under your user directory, and those files made in your project's folder upon importing. This amounts to the idea folder and the [projectname].iml file. Now reinstall and re-import the project. You can reuse the same build.gradle. Mine's working now.