when using facebook, firebase-database account kit alone both work fine but when I am using both in same time in a project it give error-
java.lang.NoSuchMethodError: No static method zzb(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; in class Lcom/google/android/gms/common/internal/zzac; or its super classes (declaration of 'com.google.android.gms.common.internal.zzac' appears in /data/app/com.neccargo-2/split_lib_dependencies_apk.apk:classes14.dex)
I am using 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.android.support:appcompat-v7:26.+'
compile 'com.android.support:design:26.+'
compile 'com.android.volley:volley:1.0.0'
compile 'com.android.support:recyclerview-v7:26.+'
compile 'com.android.support:cardview-v7:26.+'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.facebook.android:account-kit-sdk:4.+'
compile 'com.karumi:dexter:4.1.1'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.slider:library:1.1.5#aar'
compile 'fr.avianey.com.viewpagerindicator:library:2.4.1.1#aar'
compile 'com.wdullaer:materialdatetimepicker:2.3.0'
compile 'com.jakewharton:butterknife:8.7.0'
compile 'com.flaviofaria:kenburnsview:1.0.7'
compile 'com.google.firebase:firebase-database:10.0.1'
testCompile 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.7.0'
}
apply plugin: 'com.google.gms.google-services'
I am stuck about to find solution.
Try adding firebase core library.
compile 'com.google.firebase:firebase-core:10.0.1'
I find my solution after many failure. In dependencies use those -
compile 'com.google.firebase:firebase-core:11.0.1'
compile 'com.google.firebase:firebase-database:11.0.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.android.gms:play-services:11.0.1'
and then add multiDexEnabled true in build.gradle
then add those line in buildscript-
classpath 'com.google.gms:google-services:3.1.0'
classpath 'com.google.firebase:firebase-plugins:1.0.4'
in there also add in allprojects-
maven {
url "https://maven.google.com"
}
Then create a class like -
public class AppUtils extends Application {
#Override
public void onCreate() {
super.onCreate();
FirebaseApp.initializeApp(getApplicationContext());
}
}
add this class name in AndroidManifest like-
android:name=".AppUtils"
That's the process I overcome that problem.
Related
I am trying to make a splash screen which is animated, but facing an error (in title) while syncing the project.
Code in gradleFile is:
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
Dependencies are as follows:
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.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile 'com.github.VikaaSkool:AwesomeSplash:v1.0.0'
}
you have:
compile 'com.github.VikaaSkool:AwesomeSplash:v1.0.0'
instead of :
compile 'com.github.ViksaaSkool:AwesomeSplash:v1.0.0'
notice VikaaSkool instead of ViksaaSkool
also, consider using implementation instead of compile, as it will be deprecated soon
How to fix this issue while compiling release build in Android Studio 3.0
Error:Error: json defines classes that conflict with classes now
provided by Android. Solutions include finding newer versions or
alternative libraries that don't have the same problem (for example,
for httpclient use HttpUrlConnection or okhttp instead), or
repackaging the library using something like jarjar.
[DuplicatePlatformClasses]
Here's the build.gradle
dependencies {
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:multidex:1.0.2'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:animated-vector-drawable:25.3.1'
compile 'com.android.support:mediarouter-v7:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-vector-drawable:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.8.1'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.google.android.gms:play-services-base:11.4.2'
compile 'com.google.android.gms:play-services-gcm:11.4.2'
compile 'com.google.android.gms:play-services-auth:11.4.2'
compile 'com.google.android.gms:play-services-maps:11.4.2'
compile 'com.google.android.gms:play-services-analytics:11.4.2'
compile 'com.facebook.android:facebook-android-sdk:4.27.0'
compile 'com.github.bumptech.glide:glide:3.8.0'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.github.firdausmaulan:GlideSlider:1.0.0'
compile 'com.arifian.networkstatelistener:lib:1.0.0'
compile 'com.arifian.view:centeredtoolbar:1.0.5'
compile 'com.sherlockshi.widget:aspectratioimageview:1.0.1'
compile 'com.wdullaer:materialdatetimepicker:3.2.2'
compile 'com.github.rey5137:material:1.2.4'
compile 'com.pkmmte.view:circularimageview:1.1'
compile 'com.wefika:horizontal-picker:1.1.1'
compile 'com.mixpanel.android:mixpanel-android:5.1.4'
compile 'com.github.nkzawa:socket.io-client:0.5.2'
compile 'com.google.firebase:firebase-core:11.4.2'
compile 'com.google.firebase:firebase-messaging:11.4.2'
testCompile 'junit:junit:4.12'
annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0'
}
My app.gradle file contains :-
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.android.support:appcompat-v7:26.+'
compile 'com.android.support:design:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.volley:volley:1.0.0'
compile 'com.google.code.gson:gson:2.8.1'
compile 'com.github.bumptech.glide:glide:4.0.0'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
testCompile 'junit:junit:4.12'
}
Gradle console error output
What went wrong:
Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : Attribute meta-data#android.support.VERSION#value value=(26.0.0-alpha1) from [com.android.support:design:26.0.0-alpha1] AndroidManifest.xml:27:9-38
is also present at [com.android.support:cardview-v7:25.3.1] AndroidManifest.xml:24:9-31 value=(25.3.1).
Suggestion: add 'tools:replace="android:value"' to element at AndroidManifest.xml:25:5-27:41 to override.
You have to use latest Facebook SDK.
You should use this.
compile 'com.facebook.android:facebook-android-sdk:4.25.0'
Then clean and rebuild the project.
Hope it helps.
I'm trying to exclude a class from jar, but it doesn't work.
Let me know hot to do it.
This is my code:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.1.1'
compile ('com.google.android.gms:play-services-gcm:8.3.0') {
exclude module: 'com.google.android.gms.iid/zzb'
}
compile 'org.xwalk:xwalk_core_library:14.43.343.17'
compile 'com.google.code.gson:gson:2.4'
compile 'commons-io:commons-io:2.4'
compile 'com.google.android.gms:play-services-analytics:10.2.1'
compile project(":adjust")
}
This is the error message:
Error:Execution failed for task ':app:packageAllReleaseClassesForMultiDex'.
> java.util.zip.ZipException: duplicate entry: com/google/android/gms/iid/zzb$zza$zza.class
In plain Gradle, what you are looking for can be achieved as:
dependencies {
compile('com.example.m:m:1.0') {
exclude group: 'org.unwanted', module: 'x
}
compile 'com.example.l:1.0'
}
This would exclude the module X from the dependencies of M, but will still bring it if you depend on L.
please help me to solve bug with Batch error
this error appears after run
and i make Sync but nothing happened
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.android.support:appcompat-v7:24.2.1'
testCompile 'junit:junit:4.12'
compile 'com.android.support:support-v4:23'
compile 'com.mcxiaoke.volley:library:1.0.18'
compile 'com.firebase:firebase-client-android:2.5.2+'
compile 'com.google.android.gms:play-services:7.0.0'
compile 'com.google.android.gms:play-services-gcm:7.0.0'
compile 'com.google.android.gms:play-services-ads:7.0.0'
compile 'com.batch.android:batch-sdk:1.5+'
compile 'com.squareup.picasso:picasso:2.5.2'
}
import com.batch.android.Batch;
import com.batch.android.Config;
import com.firebase.client.Firebase;
import com.google.android.gms.common.api.Batch;
This lib is available only at http://maven.batch.com/release maven repository, so check out, whether your configuration points to this repository too< like so:
repositories {
...
maven {
url "http://maven.batch.com/release"
}
}