android-oauth-client icon indicating copy to clipboard operation
android-oauth-client copied to clipboard

Error:Module 'com.wu-man:android-oauth-client:0.4.4' depends on one or more Android Libraries but is a jar

Open coderbec opened this issue 8 years ago • 7 comments

getting this build error in gradle.

one work around is to force it to use the aar by putting

compile 'com.wu-man:android-oauth-client:0.4.4@aar' in the gradle dependecies

coderbec avatar Jun 20 '16 03:06 coderbec

What is the solution for this problem? I am facing the same issue

akhatriST avatar Jun 24 '16 10:06 akhatriST

As above, instead of using the gradle line wuman has in the docs, you need to but @aar in it which forces gradle to pull a valid format. I'm guess wuman hasn't configured the library correctly in the root directory or something.

coderbec avatar Jun 25 '16 01:06 coderbec

Putting an @aar in the end resolved the build error, but now what is happening that it did not get all the dependencies of this library like JacksonFactory, ClientParametersAuthentication, etc... Do I have to add these missing dependencies of this library in my project? or is it the library should have got them.

akhatriST avatar Jun 26 '16 06:06 akhatriST

Er yeah no idea what's going on with gradle... At this point best option is to download the actual .jar, import it to the libs folder, right click and add as a library ¯_(ツ)_/¯

coderbec avatar Jun 26 '16 07:06 coderbec

Are you talking about the jar from maven? Will adding this jar of this library resolve all the dependencies? or still I will need to add those explicitly in my app?

akhatriST avatar Jun 27 '16 05:06 akhatriST

Finally I've got it to work. I ve added the library project provided in the repo to my project as a dependency in my build.gradle compile project (':library'). and It got all the underlying dependencies of the library as well.

akhatriST avatar Jun 27 '16 07:06 akhatriST

This is what I did to resolve my issue. Thanks to this issue.

    compile 'com.wu-man:android-oauth-client:0.4.5@aar'
    compile('com.google.api-client:google-api-client-android:1.20.0') {
        exclude group: 'com.google.android.google-play-services', module: 'google-play-services'
        exclude group: 'junit', module: 'junit'
        exclude group: 'com.google.android', module: 'android'
    }
    compile 'com.google.oauth-client:google-oauth-client-java6:1.20.0'
    compile 'com.google.http-client:google-http-client-jackson:1.20.0'

You can update the versions of the dependencies for this project to newer versions if you'd like. If you are pulling in the @aar for this project, then you will also need to open your AndroidManifest.xml and add the tools namespace xmlns:tools="http://schemas.android.com/tools" and also tools:replace="android:allowBackup" to the <application> tag.

praneetloke avatar Jul 02 '16 19:07 praneetloke