Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.NoClassDefFoundError #120

Closed
imdutch21 opened this issue Feb 1, 2018 · 8 comments
Closed

java.lang.NoClassDefFoundError #120

imdutch21 opened this issue Feb 1, 2018 · 8 comments
Assignees

Comments

@imdutch21
Copy link

imdutch21 commented Feb 1, 2018

I seem to be having a problem with using the api. I've made a little program for testing the capabilities of the api, but after trying to build a new instance of the api
Api api = Api.builder().accessToken(oauthToken).clientId(CLIENT_ID).redirectURI(UIR).build();
the following error is given:
java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/impl/conn/PoolingHttpClientConnectionManager;

Full error log: https://pastebin.com/N9ihEaJt

I've looked online for solutions, but I can't seem to find any fixes that work. Has anyone got any clue for how to fix this?

Dependencies:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    compile 'com.spotify.sdk:spotify-player-24-noconnect-2.20b@aar'
    compile 'com.android.support:appcompat-v7:26.+'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.spotify.android:auth:1.0.0-alpha'
    testCompile 'junit:junit:4.12'

    compile('se.michaelthelin.spotify:spotify-web-api-java:1.7.3') {
        exclude group: "commons-beanutils", module: "commons-beanutils"

    }
    compile 'commons-beanutils:commons-beanutils:20030211.134440'
}
@dargmuesli
Copy link
Member

dargmuesli commented Feb 1, 2018

I'll look into this. Are you using Android? You may use kaaes/spotify-web-api-android instead.

@imdutch21
Copy link
Author

Oh yes I am. I've tried that api as well, but I was having a different issue with that one. I actually thought this one was for android as well. If the issue has no easy fix, I'll look into kaaes' wrapper again

@dargmuesli dargmuesli self-assigned this Feb 1, 2018
@dargmuesli
Copy link
Member

Could you please give me an exact explanation on how you've set up your project? Tools, files, ...
I haven't used Gradle myself yet and did never develop for Android, so examining this would take long without this information.

@imdutch21
Copy link
Author

Sure
I'm using android studio 2.3, but I think that shouldn't matter
Main: https://pastebin.com/LRHB0N7t
Main XML: https://pastebin.com/Nwa1iJyT
Gradle: https://pastebin.com/0aRv9S6K

For the virtual device I use the Pixel XL with api 24
If you need anything else, I'm happy to help

@imdutch21
Copy link
Author

Actually I forgot to mention I'm also using Spotify's android sdk for authentication

@dargmuesli
Copy link
Member

Have you tried using the new version 2.0.0-RC1 of this project? Does the same problem still occur?

@dargmuesli
Copy link
Member

dargmuesli commented Feb 6, 2018

Ok, I've narrowed down the issue. Sadly, this cannot be fixed. Other people call this issue

a colossal cock-up

on which I must fully agree.

It boils down to Android's included, but very very outdated and thus incompatible version of the httpclient dependency this project relies on too (even v2). There are efforts making usage of the current dependency versions possible, but this would mean that we'd need to include a different package and not the original. As far as I can see this would make no sense for this project as there are others (like kaaes') that are specifically made for Android.

Further explanation: HttpClient for Android

Sorry for the inconvenience, I'll change the README accordingly. Good luck with your project!

@imdutch21
Copy link
Author

Okay I understand! Thank you for all your effort and I will try to make the best out of my project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants