Well, I decided to try out the Volley networking library for Android and the new Android Studio IDE at the same time.. However, I'm running into some problems.
I built volley.jar, copied it into my libs folder for a new project, edited build.gradle to include volley, and setup a static ImageLoader and RequestQueue in my main activity. However, when I load the app onto an emulator (4.2), I end up getting
E/AndroidRuntime: FATAL EXCEPTION: main java.lang.NoClassDefFoundError: com.android.volley.toolbox.Volley
when invoking Volley as follows:
queue = Volley.newRequestQueue(this);
Gradle edits to support the library:
dependencies { compile files('libs/android-support-v4.jar') compile files('libs/volley.jar') }
Anyone mind pointing me in the right direction?
Exception java.lang.NoClassDefFoundError: com.google.android.gms.common.AccountPicker
Found the fix here.
Basically, open a command prompt (or terminal) and navigate to your project directory. Use the following command on Windows:
For Windows users: gradlew.bat clean
And for mac users type: ./gradlew clean
Then reload Android Studio and try again!
I'm sure your method works too, but I didn't even mess around with the gradle build stuff. Instead, I simply copied the com folder into my java src folder in Android Studio. It works for Eclipse too.
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