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:
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With