This is where the build system enters the picture. Now, have you ever wondered why the res folder is in the same directory as your src folder? You can do this on the command line, but you have to learn what each tool ( dx and AAPT) does in the SDK.Įclipse saved us all from these low-level, but important, fundamental details by giving us their own build system. I think the 'Add as library' step was the one I'd previously missed, and it didn't work until I cleaned it either.īefore Android Studio you were using Eclipse for your development purposes, and, chances are, you didn't know how to build your Android APK without Eclipse. I'm on Mac OS X, the command might be different on your systemĪfter I did the above four, it started working fine. Right click it and hit 'Add as library'Įnsure that compile files('libs/gson-2.2.4.jar') is in your adle file (or compile fileTree(dir: 'libs', include: '*.jar') if you are using many jar files)Įdit : Use implementation files('libs/gson-2.2.4.jar') (or implementation fileTree(dir: 'libs', include: '*.jar')) in Android Studio 3.0+ĭo a clean build (you can probably do this fine in Android Studio, but to make sure I navigated in a terminal to the root folder of my app and typed gradlew clean.Put the Gson jar (in my case, gson-2.2.4.jar) into the libs folder.I finally cracked it – here are the steps I took: I've been struggling with the same thing for many hours, trying to get the Gson jar to work no less.
0 Comments
Leave a Reply. |