Glide cannot find android sdk in Android Studio 3.4

64 views
Skip to first unread message

Anil Philip

unread,
Jul 1, 2019, 11:29:43 AM7/1/19
to Glide
I need to display in my android app, video thumbnails of clips on the internet.
Trying to learn Glide and trying to get the gallery sample to build in android studio.
I was able to build from command line and run it on my phone.

However in Android Studio 3.4, I get error: 

"ERROR: SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable."

In File|Project Structure|SDK Location,
it is correctly set, I also defined an ANDROID_HOME variable, and it is also in local.properties.



Róbert Papp

unread,
Jul 1, 2019, 12:18:11 PM7/1/19
to Glide
Hi, try this:
  1. Exit Android Studio (fully close it)
  2. Double-check that ANDROID_HOME points to a location that contains platforms\android-xx folders.
  3. Delete local.properties
  4. Start Android Studio to make sure it picks up the new/edited variable.
  5. Verify in AS that Tools > SDK Manager > Android SDK Location points to the same place.
  6. Sync, build, run.

likejudo

unread,
Jul 1, 2019, 6:30:47 PM7/1/19
to Glide


  1. Verify in AS that Tools > SDK Manager > Android SDK Location points to the same place.
Thanks for your reply. When I performed the steps, I noticed that SDK Manager is missing from the Tools menu. (see screenshot)
This was when I opened samples/gallery in AS 3.4
However when I open any other android project, it is intact.
 
glide error sample.JPG

Róbert Papp

unread,
Jul 1, 2019, 7:43:23 PM7/1/19
to Glide
Huh, your .java files are also not recognized as code, which means that Gradle sysnc didn't complete to tell IDEA the source folders. I guess this is your main problem. Check your Gradle sync's log for hints.

If it's only complaining about the SDK location, I suggest you copy local.properties from a working project and see if that helps.

It may be possible that Glide project is not AS 3.4 compatible, Did you follow the guide at https://bumptech.github.io/glide/dev/contributing.html ?
Also you need to have git on PATH working from command line: https://github.com/bumptech/glide/blob/master/settings.gradle#L2, but you said it works through gradlew ...

likejudo

unread,
Jul 1, 2019, 8:25:43 PM7/1/19
to Glide
I followed the steps for installing and starting Glide.
In the meantime since I really need to get this sample working, 
As a workaround I created an empty android project in AS 3.4 and copy-pasted the files from the gallery sample. But I did not copy over the build.gradle files.
(I added mavenCentral and also glide dependency).

However I am seeing red lines at GlideApp and also RequiresApi. (changed to kitkat)
Doing a search for it in the master sample dir shows it as a generated java class.
So that didn't work either.

likejudo

unread,
Jul 1, 2019, 8:26:43 PM7/1/19
to Glide


glide error sample.JPG

Reply all
Reply to author
Forward
0 new messages