Reputation: 667
I have imported an external jar-library find-local-devices.jar
into Android Studio project. I've put it into libs
folder, right-clicked and chosen Add as library, ensured about dependency in build.gradle
, cleaned and built again the project - everything as described, e.g., here.
, but I cannot still use the classes from jar:
Could somebody tell me what I do wrong?
Upvotes: 4
Views: 2209
Reputation: 132
Try "Invalidate Caches and restart" on Android Studio.
Also try deleting you current module and everything referring to it. And add it as the official google documentation is showing you too. The image is from here : https://developer.android.com/studio/projects/android-library.html
Upvotes: 3
Reputation: 560
Try another way of importing jar/aar packages into Android studio.
Goto File -> New Module -> import .JAR/.AAR package -> Select file path and say Finish.
Then add this line in Gradle.
compile project(':your_imported_file_name')
Upvotes: 0
Reputation: 21
compile fileTree(dir: 'libs', include: ['*.jar'])
try this in gradle file and rebuild
Upvotes: 0