The app works fine until I've modified the graddle file to put the dependecies of new jar files.
This is the dependecies of the graddle of my app:
dependencies {
compile 'com.parse.bolts:bolts-android:1.1.4'
compile 'com.android.support:support-v4:22.0.0'
provided 'com.facebook.android:facebook-android-sdk:3.23.1'
provided files('libs/Parse-1.9.2.jar') //this is the dependence that I've modified
provided files('libs/ParseFacebookUtils-1.8.4.jar')
}
And this is the dependecies of the graddle of the ParseLoginUI (a github project for integrating the facebook and parse login):
dependencies {
// Module dependency on ParseLoginUI library sources
compile project(':calligraphy-2.1.0')
compile project(':ParseLoginUI')
compile fileTree(include: 'ParseCrashReporting-*.jar', dir: 'libs')
compile 'com.facebook.android:facebook-android-sdk:3.21.1'
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.android.support:cardview-v7:21.+'
compile 'com.android.support:recyclerview-v7:21.0.+'
compile 'com.squareup.picasso:picasso:2.3.4'
}
Now I get this error when the method com.parse.ParseFacebookUtils.initialize is executed:
java.lang.IncompatibleClassChangeError: com.parse.FacebookAuthenticationProvider
at com.parse.ParseFacebookUtils.initialize(ParseFacebookUtils.java:91)
at com.unisa.unistore.MainApplication.onCreate(MainApplication.java:35)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1011)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4553)
at android.app.ActivityThread.access$1600(ActivityThread.java:147)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1357)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5256)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
Please, some one can help me?
I've resolved the problem. It seems to be a corrupted jar file or the incompatibility between Parse-1.9.2.jar and ParseFacebookUtils-1.8.4.jar to cause this problem.
Anyway these are the steps that I made to solve the problem:
Recopying the same files again, in the libs directory (i.e. Parse-1.8.4.jar and ParseFacebookUtils-1.8.4.jar);
Substituting Parse-1.9.2.jar with its 1.8.4 version.
I hope that this answer will be useful to someone.
I was getting the same error in my app.
java.lang.IncompatibleClassChangeError: com.parse.FacebookAuthenticationProvider
at com.parse.ParseFacebookUtils.initialize(ParseFacebookUtils.java:94)
I found the reason that i was using different version of libs that i kept in libs folder.
compile fileTree(dir: 'libs', include: 'Parse-*.jar')
compile fileTree(dir: 'libs', include: 'ParseFacebookUtilsV4-*.jar')
Both Parse and ParseFacebookUtilsV4 jar should have same version that i.e.
Parse-1.9.2.jar & ParseFacebookUtilsV4-1.9.2.jar
so user both libs of same version that you downloaded from parse.com .
I hope this will help ~~
Related
This is a really strange problem and I've been days stuck with it: we've got a working project (no errors whatsoever) in a git repository. Everything is OK (it's even published in Google Play) when executing the project from the creator's equip, but, when we try to clone it in a different equip (we've tried Mac, Linux and Windows), this exception is thrown:
Unable to execute dex: method ID not in [0, 0xffff]: 65536
Hereafter, even if we apply the multidex solution as described in Android Developers or delete the unused dependencies, the app raises an exception when trying to load class android.support.design.widget.NavigationView (coming from a NoClassDefFound in runtime).
I suspect maybe it has something to do with the gradle plugin or appcompat libs version, but so far, nothing we've tried has worked.
Edit: This is not a common multiDex error, I'm pretty familiarized about how to solve them, it's about one computer executing the app without problems but when you clone the same project from git in other computer, it won't run and the MultiDex error is thrown.
EDIT 2: mi dependenvy list is as follows (I ommit the company libs but they're not the problem
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:support-v4:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.mo2o.third:valnif:1.0.0'
compile 'com.android.support:recyclerview-v7:23.0.+'
compile 'de.hdodenhof:circleimageview:2.0.0'
compile('com.afollestad.material-dialogs:core:0.8.0.1#aar') {
transitive = true
}
compile 'com.android.support:percent:23.0.0'
compile 'se.emilsjolander:stickylistheaders:2.6.0'
compile 'me.grantland:autofittextview:0.2.+'
compile 'com.google.android.gms:play-services-auth:8.3.0'
compile "com.google.android.gms:play-services-gcm:8.3.0"
compile 'com.google.android.gms:play-services-plus:8.3.0'
compile 'com.squareup.picasso:picasso:2.5.2'
I downloaded opentok/opentok-android-sdk-ui application for text-chat from github.
I open this app in android studio. After compilation of application, it gives compilation error.That is,
Error:Failed to resolve: :opentok-android-sdk-ui-1.0:
In Build.Gradle file it defines dependencies like this
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile (name: 'opentok-android-sdk-ui-1.0', ext:'aar')
}
How could i resolve this issue? Please Help me.
You must find opentok-android-sdk-ui-1.0.aar file in opentok-android-sdk-ui-1.0/text-chat/build/outputs/aar. What you need to do is, Open Android Studio, go to File>Import Module> select the aar file from the directory. You will see that a module is created in your workspace. Now, in the project text-chat-sample, open app/build.gradle file and instead of this line
compile (name: 'opentok-android-sdk-ui-1.0', ext:'aar')
write:
compile project(':opentok-android-sdk-ui-1.0')
Hi all I want to use ObjectGraph in android I am using following
applicationGraph = ObjectGraph.create(getModules().toArray());
applicationGraph.inject(this);
But it gives me error as :
java.lang.RuntimeException: Unable to create application com.my.mynews.app.MyApplication: java.lang.IllegalStateException: Module adapter for class com.my.mynews.b.b could not be loaded. Please ensure that code generation was run for this module.
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4521)
at android.app.ActivityThread.access$1500(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1339)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
Caused by: java.lang.IllegalStateException: Module adapter for class com.my.mynews.b.b could not be loaded. Please ensure that code generation was run for this module.
at a.a.j.a(Unknown Source)
at a.a.j.a(Unknown Source)
at a.a.x.b(Unknown Source)
at a.a.i.a(Unknown Source)
at a.a.z.a(Unknown Source)
my build.gradle is like:
configurations {
apt
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:21.+'
compile 'com.android.support:appcompat-v7:21.+'
compile 'com.jakewharton:butterknife:5.0.+'
compile 'com.jakewharton.timber:timber:2.2.+'
compile 'com.squareup.dagger:dagger:1.2.+'
//provided 'com.squareup.dagger:dagger-compiler:1.2.+'
apt 'com.squareup.dagger:dagger-compiler:1.2.+'
compile 'com.squareup.okhttp:okhttp:2.0.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.0.0'
compile 'com.squareup.retrofit:retrofit:1.6.1'
compile 'com.fasterxml.jackson.core:jackson-databind:2.4.+'
compile 'com.fasterxml.jackson.core:jackson-core:2.4.+'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.4.+'
compile 'com.github.satyan:sugar:1.3'
compile 'com.pnikosis:materialish-progress:1.2'
compile 'com.android.support:cardview-v7:21.0.3'
compile 'com.google.android.gms:play-services-analytics:7.0.0'
compile files('libs/volley.jar')
}
If I uncomment provided in above dependencies and comment apt and make minifyEnabled false then it works perfectly. But I want to reduce code size therefore I have done minifyEnabled true and application crashesh.
Any suggestion will be appreciated. Thanks in advance
I ran into a similar problem myself. Unfortunately, Dagger 1.2+ does not appear to play nicely with proguard's minifyEnabled. So the best options I could find are:
Set minifyEnabled false and just deal with it
Upgrade to Dagger 2.0 (here's a guide: http://frogermcs.github.io/dagger-1-to-2-migration/)
Some people have had luck downgrading to Dagger 1.0.1 and eliminating dagger-compiler altogether (https://stackoverflow.com/a/23954164).
I am new to android studio.I am developing an app which uses Facebook SDK.I have downloaded Facebbok SDK and imported it as a module to my android project.I am using latest version of android studio.So I simply imported it and did not make any change in other files for this.First I am trying to use facebook login functionality.But when I build the app I am getting following error.
error: package com.facebook.android does not exist
I could see one solution as an answer to someone's question. But i could not understand it.Please somebody help me.
check you build.gradle
it should got this dependency
if you got library project:
dependencies {
compile project(':facebook');
}
if you got jar files in libs folder:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
}
or just add maven central dependency to:
dependencies {
compile 'com.github.asne.facebook:facebook:3.17.2'
}
You need to add dependencies on your gradle file :-
compile 'com.facebook.android:facebook-android-sdk:4.1.0'
above is path you need to add dependencies {} like below :-
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.facebook.android:facebook-android-sdk:4.1.0'
}
Is the facebook library is jar file or library project?
If is jar file, you just need to add jar file in libs folder and dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
} in build.gradle.
If is library project, you should modify your setting.gradle and build.gradle files.
Adding this line of code to the dependencies in the build.gradle file helped me get rid of the same error.
dependencies {
...
compile 'com.facebook.android:facebook-android-sdk:4.0.0'
}
From platform=android facebook developers
-the last line of the section "Add Facebook SDK to Your Project")
I am having this issue and seem can't figure it out when building gradle android with proguard:
Can't read [C:\Users\xxx\dev\xyz\Xyz-nextgen\build\exploded-bundles\XyzCommonXyz_volleyUnspecified.aar\libs\android-support-v13.jar(;;;;!META-INF/MANIFEST.MF)] (Duplicate zip entry [android/support/a/a/b.class == android-support-v13.jar:android/support/v13/app/FragmentCompat$FragmentCompatImpl.class])
There are 3 library projects and one app project.
All projects use only one android-support-v13.jar.
Thanks.
Andy
Open the module's gradle.build file and
In
dependencies {
compile 'com.android.support:support-v4:13.0.+'
compile files('libs/android-async-http-1.3.1.jar')
compile fileTree(dir: 'libs', include: '*.jar')
}
Change
compile 'com.android.support:support-v4:13.0.+'
To
compile 'com.android.support:support-v4:21.+'
make sure u have updated build tools in the sdk manager and let us know if that works