I have an issue where I\'m trying to include a library in my project called the ParseLoginUI
.
The issue is it uses the provided tag instead of compile. I b
You can try this syntax:
provided (name:"", ext:'aar')
Be sure your main build.gradle has the path or maven repo to the aar package you want provided.
Try this: http://www.labouisse.com/how-to/2014/07/28/gradle-provided-scope-and-intellij/
He basically mimics the provided implementation.
According to this issue, it should be possible to do with Gradle plugin 1.3.0-beta3
. You might need to update your build tools to version 23.0.0 rc1
or above.
After try and error, I found the solution…
First of all, AAR means android archive library, which is not a JAR.
I searched something called facebook-android-sdk-4.0.1.jar
, but no luck.
The trick is download facebook code and add it as a module. Doing that, works perfectly and you can use gradle 1.2.3 with ParseLoginUI.
Go here: https://developers.facebook.com/docs/android/downloads
Download: https://developers.facebook.com/resources/facebook-android-sdk-4.0.1.zip Decompress it.
Go to your own project. -Remove in your ParseLoginUI gradle the reference to Parse
Press FILE, NEW, IMPORT MODULE.
Select a folder called facebook that is inside the zip you uncompressed.
Call that module facebook-android-sdk-4.0.1.
Now add in your parseloginui a dependency to that module, using:
compile project(':facebook-android-sdk-4.0.1’)
You also have to copy a file from the zip you downloaded to the new module folder, the file is gradle.properties. The one that has:
ANDROID_BUILD_MIN_SDK_VERSION=9
ANDROID_BUILD_TARGET_SDK_VERSION=21
ANDROID_BUILD_TOOLS_VERSION=21.1.2
ANDROID_BUILD_SDK_VERSION=21
That’s all.
Press SYNCHRONIZE and cross your fingers.
I worked in my case after several hours playing with gradle and android studio. Let me know if you get it. If you have reference problems (I had), use FILE, PROJECT STRUCTURE to add the jar references to your modules properly. (I wrote them manually and it seems it was a mistake in my parse references, probably one path or symbol, don’t know. Do that using the user interface of android studio will fix the problem). BTW, you can use a version of parse in ParseLoginUI and another more recent in your project (I didn’t test that for facebook version).
This is what I have in my ParseLoginUI gradle file:
compile 'com.parse.bolts:bolts-android:1.2.0'
compile 'com.android.support:support-v4:22.0.0'
compile project(':facebook-android-sdk-4.0.1')
compile files('libs/Parse-1.9.1.jar')
compile files('libs/ParseFacebookUtilsV4-1.9.1.jar')
And this is what I have in my app gradle:
compile 'com.google.android.gms:play-services:7.5.0'
compile project(':facebook-android-sdk-4.0.1')
compile 'com.parse.bolts:bolts-android:1.2.0'
compile files('libs/Parse-1.9.2/Parse-1.9.2.jar')
compile files('libs/Parse-1.9.2/ParseFacebookUtilsV4-1.9.2.jar')
compile project(':ParseLoginUI’)
Note: I use Gradle version 2.4 and android plugin version 1.2.3. Selct that in FILE, PROJECT STRUCTURE, PROJECT.
Good luck.
you have already mentioned that it is an open issue in Gradle. If you are using ParseLoginUI as library module. Just change the build.gradle file in ParseLoginUI itself.
provided 'com.facebook.android:facebook-android-sdk:4.0.1'
to
compile 'com.facebook.android:facebook-android-sdk:4.0.1'
instead of that,
Clone ParseLoginUI from here
Import ParseLoginUI as a module and include these on gradle
compile project(':ParseLoginUI')
compile 'com.facebook.android:facebook-android-sdk:4.0.1'
Hope this helps