Android Studio: Add jar as library?

I’ve been struggling with the same thing for many hours, trying to get the Gson jar to work no less. I finally cracked it – here are the steps I took: Put the Gson jar (in my case, gson-2.2.4.jar) into the libs folder Right click it and hit ‘Add as library’ Ensure that compile files(‘libs/gson-2.2.4.jar’) … Read more

What’s the difference between implementation, api and compile in Gradle?

tl;dr Just replace: compile with implementation (if you don’t need transitivity) or api (if you need transitivity) testCompile with testImplementation debugCompile with debugImplementation androidTestCompile with androidTestImplementation compileOnly is still valid. It was added in 3.0 to replace provided and not compile. (provided introduced when Gradle didn’t have a configuration name for that use-case and named … Read more