Closed StuStirling closed 8 years ago
Hi @StuStirling: For the minSdkVersion, aar and support library issues, I will take a look and response you later. For the crash issue, you need
compile files('../libs/ParseFacebookUtilsV4-1.10.2.jar')
in your app's gradle.
Since in :ParseUI-Login
, we provided not complied the ParseFacebookUtilsV4
.
Just for completeness, the warning that appears when leaving the support dependency version as 22.0.0 is as follows:
Warning:Project ParseUI-Login: apk dependencies can only be jars. com.android.support:support-v4:aar:22.0.0 is an Android Library.
So I have included the compile files('../libs/ParseFacebookUtilsV4-1.10.2.jar)
in my app's build.grade
file.
Here are my updated build.gradle
files.
ParseUI-Login build.gradle
apply plugin: 'android-library'
dependencies {
compile 'com.android.support:support-v4:23.0.1'
compile 'com.parse:parse-android:1.10.1'
provided 'com.facebook.android:facebook-android-sdk:4.6.0'
provided files("$rootProject.projectDir/libs/ParseFacebookUtilsV4-1.10.2.jar")
provided files("$rootProject.projectDir/ParseUI-Login/libs/ParseTwitterUtils-1.10.1.jar")
}
android {
compileSdkVersion 21
buildToolsVersion "21.1.1"
defaultConfig {
minSdkVersion 15
targetSdkVersion 21
}
}
app build.gradle
// PARSE - https://www.parse.com/apps/quickstart#parse_data/mobile/android/native/existing
compile 'com.parse.bolts:bolts-android:1.+'
compile files('../libs/Parse-1.10.2.jar')
compile project(':ParseUI-Login')
// compile project(':ParseUI-Widget')
compile files('../libs/ParseFacebookUtilsV4-1.10.2.jar')
// compile files('../libs/ParseTwitterUtils-1.10.1.jar')
Now the error I get on build is about sex issues. Usually because there are duplicate libraries present. Enabling multiDex usually resolves these issues but I don't really want to if I can help it due to performance hits etc. Here is the error
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2```
And if I do enable multiDex I get the following error (might help point to conflicting libraries)
Error:Execution failed for task ':app:packageAllDebugClassesForMultiDex'.
> java.util.zip.ZipException: duplicate entry: com/parse/AbstractQueryController$1.class
Check #73, it seems you import Parse
twice. We already import Parse
from maven in :ParseUI-Login
, but you still import your local jar.
Ok so removed compile files('../libs/Parse-1.10.2.jar')
from my app's build.gradle file and it now builds and runs but is now crashing on startup. It can't find the com.parse.FacebookAuthenticationProvider
when calling ParseFacebookUtils.initialize(this);
.
10-08 09:06:53.442 13388-13388/? E/AndroidRuntime: java.lang.NoClassDefFoundError: com.parse.FacebookAuthenticationProvider
10-08 09:06:53.442 13388-13388/? E/AndroidRuntime: at com.parse.ParseFacebookUtils.initialize(ParseFacebookUtils.java:96)
10-08 09:06:53.442 13388-13388/? E/AndroidRuntime: at com.parse.ParseFacebookUtils.initialize(ParseFacebookUtils.java:81)
10-08 09:06:53.442 13388-13388/? E/AndroidRuntime: at com.corecoders.ski2themoon.S2TMApplication.onCreate(S2TMApplication.java:48)
10-08 09:06:53.442 13388-13388/? E/AndroidRuntime: at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1012)
10-08 09:06:53.442 13388-13388/? E/AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4553)
10-08 09:06:53.442 13388-13388/? E/AndroidRuntime: at android.app.ActivityThread.access$1500(ActivityThread.java:151)
10-08 09:06:53.442 13388-13388/? E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364)
10-08 09:06:53.442 13388-13388/? E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
10-08 09:06:53.442 13388-13388/? E/AndroidRuntime: at android.os.Looper.loop(Looper.java:135)
10-08 09:06:53.442 13388-13388/? E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5254)
10-08 09:06:53.442 13388-13388/? E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
10-08 09:06:53.442 13388-13388/? E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:372)
10-08 09:06:53.442 13388-13388/? E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
10-08 09:06:53.442 13388-13388/? E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Ok I've got it working. Here are my working files. Note the following.
ParseUI-Login build.grade
/*
* Copyright (c) 2014, Parse, LLC. All rights reserved.
*
* You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
* copy, modify, and distribute this software in source code or binary form for use
* in connection with the web services and APIs provided by Parse.
*
* As with any software that integrates with the Parse platform, your use of
* this software is subject to the Parse Terms of Service
* [https://www.parse.com/about/terms]. This copyright notice shall be
* included in all copies or substantial portions of the software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
apply plugin: 'android-library'
dependencies {
compile 'com.android.support:support-v4:23.0.1'
compile 'com.parse:parse-android:1.10.2'
provided 'com.facebook.android:facebook-android-sdk:4.6.0'
provided files("$rootProject.projectDir/libs/ParseFacebookUtilsV4-1.10.2.jar")
provided files("$rootProject.projectDir/ParseUI-Login/libs/ParseTwitterUtils-1.10.1.jar")
}
android {
compileSdkVersion 21
buildToolsVersion "21.1.1"
defaultConfig {
minSdkVersion 15
targetSdkVersion 21
}
}
App Module's build.gradle
compile 'com.facebook.android:facebook-android-sdk:4.6.0'
compile project(':ParseUI-Login')
compile files('../libs/ParseFacebookUtilsV4-1.10.2.jar')
I can now login to my Parse app via Facebook using the ParseUI-Login widget.
Hi,
Trying to implement the latest Parse SDK with the ParseLoginUI and Facebook SDK V 4.6.0 but can't do it.
This is the furthest I've got. I can get the ParseLoginActivity to display but I'm crashing when I select the "LoginWithFacebook" button.
Here are my different build.gradle files.
ParseUI-Login build.grade I had to increase the minSdkVersion to 15 so there was no longer a conflict between the latest FacebookSDK. I also had to increase the support library version as before it complained about not being able to depend on a .aar file in a library module.
My App Module's build.grade So this is the only structure that has worked for me. As soon as I try to include any of the Parse SDK files (following the read me) it breaks the ParseUI-Login. I've only shown the bit of the file that matter.
I have included the ParseLoginActivity declaration in my manifest file and I open it like this.
When the application crashes when I click the "Login with Facebook" button it looks like this.