Build failed with bytecode error in Android Studio - android

I have this error:
I have enabled multidex but still it gives me multidex files define issues.
compile fileTree(include: ['*.jar'], dir: 'libs')
// Navigation Drawer Library
compile('com.mikepenz:materialdrawer:5.3.0#aar') {
transitive = true
}
// Debugger Tools libraries
debugCompile 'com.facebook.stetho:stetho:1.2.0'
debugCompile 'com.parse:parseinterceptors:0.0.2'
//Google, Inc (Play services) Libraries
compile 'com.google.android.gms:play-services-maps:9.2.0'
// Google, Inc (Support) Libraries
compile 'com.android.support:support-v13:25.1.0'
compile 'com.android.support:support-v4:25.1.0'
compile 'com.android.support:design:25.1.0'
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:multidex:1.0.1'
compile 'org.florescu.android.rangeseekbar:rangeseekbar-library:0.3.0'
// Parse Server API SDK
compile project(':ParseUI-Widget')
compile 'com.parse:parse-android:1.13.1'
compile 'com.parse.bolts:bolts-android:1.4.0'
compile 'com.github.tgio:parse-livequery:1.0.3'
compile 'com.parse:parsefacebookutils-v4-android:1.10.3#aar'
// Facebook, Inc SDKs
compile 'com.facebook.android:audience-network-sdk:4.18.0'
compile 'com.facebook.android:facebook-android-sdk:4.7.0'
compile 'com.facebook.android:account-kit-sdk:4.+'
// Libraries for loading images
compile 'com.facebook.fresco:imagepipeline-okhttp3:0.11.0+'
compile 'com.facebook.fresco:fresco:1.0.0'
// Location Helper Library
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit:converter-gson:2.0.0-beta1'
// Time library
compile 'joda-time:joda-time:2.9.7'
// Accelaration library
//compile 'com.neumob:neumob-android:3.2.4'
// Others
compile 'com.skyfishjy.ripplebackground:library:1.0.1'
compile 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile files('libs/mint-4.4.0.jar')
I have added build.gradle file.
I don't know how to solve Multidex issue in Android. My app has lots of SDKs integration, I went through lots of tutorials and blogs. I got so many solutions. One of them is below mentioned as part of my gradle.

apply plugin: 'com.google.gms.google-services'
classpath 'com.google.gms:google-services:3.1.1'

Related

The library com.google.android.gms:play-services-base is being requested by various other libraries at [[15.0.1,15.0.1]], but resolves to 16.0.1. - f

those my dependencies, I tied this : com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
but still having the same issue
dependencies {
implementation fileTree(include: '*.jar', dir: 'libs')
// SUB-PROJECT DEPENDENCIES START
implementation project(path: 'CordovaLib')
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
implementation 'com.google.firebase:firebase-inappmessaging-display:17.0.2'
compile 'com.google.android.gms:play-services-ads:17.0.0'
compile 'com.facebook.android:facebook-android-sdk:4.35.0'
compile 'com.google.gms:google-services:4.1.0'
compile 'com.google.android.gms:play-services-tagmanager:16.0.4'
compile 'com.google.firebase:firebase-core:16.0.4'
compile 'com.google.firebase:firebase-messaging:17.3.3'
compile 'com.google.firebase:firebase-config:16.0.1'
compile 'com.google.firebase:firebase-perf:16.1.2'
compile 'com.google.firebase:firebase-dynamic-links:16.1.2'
compile 'com.google.android.gms:play-services-analytics:16.0.4'
compile 'com.google.android.gms:play-services-auth:16.0.1'
compile 'com.google.android.gms:play-services-identity:16.0.0'
compile 'com.loopj.android:android-async-http:1.4.9'
compile 'com.android.support:support-v4:24.1.1+'
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support.constraint:constraint-layout:1.0.+'
// SUB-PROJECT DEPENDENCIES END
}
You should use the latest version for each dependencies, you can check what those are in the Maven repository
Also you should use implementation instead of compile, it is being deprecated at the end of the year

Unable to build android studio project cannot access zzbcc class file for com.google.android.gms.internal.zzbcc not found

Everything was fine building but recently in on week time, now the project is not building,
cannot access zzbcc class file error is related to maps maybe
as it occurs on Add marker method for google map code i have used in my project
This is my current gradle build file
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}}
dependencies {
/*For Facebook Sign in*/
compile files('libs/YouTubeAndroidPlayerApi.jar')
//fort lib
compile project(':FORTSDKv1.4')
compile project(':likebutton')
compile project(':infiniteviewpager')
compile 'com.android.support:support-v4:27.0.0'
compile 'com.android.support:appcompat-v7:27.0.0'
compile 'com.intuit.sdp:sdp-android:1.0.4'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:design:27.0.0'
compile 'com.android.support:recyclerview-v7:27.0.0'
compile 'com.android.support:cardview-v7:27.0.0'
compile 'com.android.support:palette-v7:27.0.0'
compile 'com.github.clans:fab:1.6.2'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'uk.co.chrisjenx:calligraphy:2.1.0'
compile 'com.squareup.okhttp3:okhttp:3.5.0'
compile 'com.github.florent37:arclayout:1.0.1'
compile 'com.flaviofaria:kenburnsview:1.0.7'
compile 'com.jakewharton:butterknife:8.4.0'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
// compile 'com.google.android.gms:play-services-auth:9.2.1'
compile 'com.facebook.android:facebook-android-sdk:4.0.1'
// compile 'com.google.android.gms:play-services-appindexing:9.2.1'
compile 'com.yayandroid:ParallaxRecyclerView:1.1'
compile 'com.github.scottyab:showhidepasswordedittext:0.8'
compile 'com.txusballesteros:bubbles:1.2.1'
compile 'com.victor:lib:1.0.1'
compile 'com.shamanland:fonticon:0.1.8'
compile 'com.google.guava:guava:19.0'
compile 'org.bouncycastle:bcprov-jdk16:1.46'
compile 'commons-codec:commons-codec:1.10'
compile 'com.vinaygaba:creditcardview:1.0.3'
// compile 'com.google.android.gms:play-services-maps:9.2.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.github.damson:Bright:v1.1.0-release'
// compile 'com.google.android.gms:play-services:9.2.1'
compile 'com.yalantis:ucrop:2.2.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.wang.avi:library:2.1.3'
testCompile 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
compile('com.crashlytics.sdk.android:crashlytics:2.6.8#aar') {
transitive = true;
}
// OneSignal SDK
compile 'com.onesignal:OneSignal:[3.6.1,3.99.99)'
compile 'com.google.android.gms:play-services:11.2.2'
compile 'com.google.android.gms:play-services-auth:11.2.2'
compile 'com.google.android.gms:play-services-maps:11.2.2'
compile 'com.google.firebase:firebase-appindexing:11.2.2'
compile 'com.google.firebase:firebase-messaging:11.2.2'
compile 'com.google.code.gson:gson:2.8.2'
//compile 'com.adjust.sdk:adjust-android-criteo:4.2.3'
compile 'com.adjust.sdk:adjust-android:4.11.4'
compile 'com.google.android.gms:play-services-analytics:11.2.2'
}
apply plugin: 'com.google.gms.google-services'
Clean builds successfull but cannot run app or generate signed apk,
I have seen multiple simmilar questions they point towards dependency issue but in this case firebase and google play services both are same.
Resolved
By making firebase and google play service dependencies same and also using latest stable version for both
Update to latest google play version and firebase in gradle dependencies
I just had to change dependency version in gradle to latest and all build issue were resolved.
thanks.

Which version of Firebase Auth support Authentication on android using phone number?

This is build.gradle file.
Currently using dependencies given below:
compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.android.support:design:25.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.firebaseui:firebase-ui-database:1.0.1'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.google.android.gms:play-services-safetynet:10.0.1'
compile 'com.google.android.gms:play-services-basement:10.0.1'
compile 'com.google.android.gms:play-services-auth:10.0.1'
}
apply plugin: 'com.google.gms.google-services'
Starting from this version of firebase supports the phone authentication
compile 'com.google.firebase:firebase-auth:11.0.0'
I guess you should add this one to your gradle file and should work out of the box.
The latest one is give below.
compile 'com.google.firebase:firebase-auth:11.4.2'
Link to guide

ZipExcepton: duplicate entry: com/google/android/gms/internal/zzpi.class

I am running into this issue every time I am trying to run my project.
I am getting this error:
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzpi.class
Here is my build script:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
// The Fabric Gradle plugin uses an open ended version to react
// quickly to Android tooling updates
classpath 'io.fabric.tools:gradle:1.15.2'
}
}
apply plugin: 'com.android.application'
//Put Fabric plugin after Android plugin
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile files('libs/commons-collections4-4.0.jar')
compile files('libs/YouTubeAndroidPlayerApi.jar')
compile files('libs/graphview-3.1.jar')
testCompile 'junit:junit:4.12'
compile project(':progresslibrary')
compile files('libs/gson-2.6.2.jar')
compile('com.crashlytics.sdk.android:crashlytics:2.6.2#aar') {
transitive = true;
}
apt 'com.github.hotchemi:permissionsdispatcher-processor:2.1.2'
apt 'com.github.hotchemi:permissionsdispatcher-processor:2.1.2'
compile 'com.android.support:multidex:1.0.0'
compile 'com.hrules:charter:1.4.0'
compile 'com.github.hotchemi:permissionsdispatcher:2.1.2'
//noinspection GradleCompatible
compile 'com.google.android.gms:play-services-analytics:8.4.0'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.15'
compile 'com.android.support:multidex:1.0.0'
compile 'com.hrules:charter:1.4.0'
compile 'com.google.android.gms:play-services-analytics:8.4.0'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.15'
compile 'com.github.hotchemi:permissionsdispatcher:2.1.2'
compile 'com.amazonaws:aws-android-sdk-core:2.+'
compile 'com.amazonaws:aws-android-sdk-s3:2.+'
compile 'eu.the4thfloor.volley:com.android.volley:2015.05.28'
compile 'com.facebook.android:facebook-android-sdk:4.0.0'
compile 'com.snappydb:snappydb-lib:0.5.2'
compile 'com.google.android.gms:play-services-auth:9.4.0'
compile 'com.google.android.gms:play-services-plus:8.4.0'
compile 'com.google.android.gms:play-services-gcm:9.4.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.google.android.gms:play-services-location:8.4.0'
compile 'com.wdullaer:materialdatetimepicker:2.2.0'
compile 'com.oguzdev:CircularFloatingActionMenu:1.0.2'
compile 'com.shamanland:fab:0.0.8'
compile 'org.florescu.android.rangeseekbar:rangeseekbar-library:0.3.0'
compile 'com.android.support:design:23.2.0'
compile 'com.android.support:support-v4:23.2.0'
compile 'com.android.support:recyclerview-v7:23.2.0'
compile 'com.android.support:cardview-v7:23.2.0'
compile 'org.jsoup:jsoup:1.9.1'
compile 'com.flurry.android:analytics:6.2.0'
compile 'com.google.android.gms:play-services-fitness:8.4.0'
compile 'com.google.android.gms:play-services-appindexing:8.4.0'
compile 'com.github.danielemaddaluno.androidupdatechecker:library:1.0.2'
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
}
android {
packagingOptions {
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/LICENSE.txt'
}
}
apply plugin: 'build-announcements'
please tell me what is wrong with my build script
At a quick glance, I can tell you that the problem exists in Google Play Services. And I am going to guess that these all need to be the same version (grouped by same version here).
compile 'com.google.android.gms:play-services-analytics:8.4.0'
compile 'com.google.android.gms:play-services-plus:8.4.0'
compile 'com.google.android.gms:play-services-location:8.4.0'
compile 'com.google.android.gms:play-services-fitness:8.4.0'
compile 'com.google.android.gms:play-services-appindexing:8.4.0'
compile 'com.google.android.gms:play-services-auth:9.4.0'
compile 'com.google.android.gms:play-services-gcm:9.4.0'
In order to efficiently do that, you can define an ext block in you Gradle file for keeping the version numbers consistent.
Additional note: This line compile fileTree(include: ['*.jar'], dir: 'libs')... It says compile all JAR files in the libs/ directory, therefore, these lines are pointless, and you can remove them while you try to identify where the error occurs.
compile files('libs/commons-collections4-4.0.jar')
compile files('libs/YouTubeAndroidPlayerApi.jar')
compile files('libs/graphview-3.1.jar')
compile files('libs/gson-2.6.2.jar')
Sample build.gradle
ext {
// Variables to keep libraries consistent
supportLibrary = "23.2.0"
googlePlayServicesVersion = '9.4.0'
// Support Libraries dependencies
supportDependencies = [
design : "com.android.support:design:${supportLibrary}",
recyclerView : "com.android.support:recyclerview-v7:${supportLibrary}",
cardView : "com.android.support:cardview-v7:${supportLibrary}",
appCompatV7 : "com.android.support:appcompat-v7:${supportLibrary}"
]
googlePlayServicesDepends = [
analytics : "com.google.android.gms:play-services-analytics:${googlePlayServicesVersion}"
plus : "com.google.android.gms:play-services-plus:${googlePlayServicesVersion}"
location : "com.google.android.gms:play-services-location:${googlePlayServicesVersion}"
fitness : "com.google.android.gms:play-services-fitness:${googlePlayServicesVersion}"
appindexing : "com.google.android.gms:play-services-appindexing:${googlePlayServicesVersion}"
auth : "com.google.android.gms:play-services-auth:${googlePlayServicesVersion}"
gcm : "com.google.android.gms:play-services-gcm:${googlePlayServicesVersion}"
]
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
// compile supportDependencies.appCompatV7
// compile supportDependencies.recyclerView
// recommended - includes those above
compile supportDependencies.design
// extras
compile supportDependencies.cardView
// The correct Volley library
compile 'com.android.volley:volley:1.0.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile "com.google.code.gson:gson:2.6.2"
// Google Play Services
compile googlePlayServicesDepends.location
// TODO: Add others
}

Can't add both Google Play Services and Appcompat-v7 dependencies

I am trying to clean up and update the libraries on a project. As part of this I moved from using the classic library folder dependency to one through gradle, for Google Play Services. I started getting an dexDebug error when compiling debug (see Android Studio - UNEXPECTED TOP-LEVEL EXCEPTION: ). From what I understand this error shows up if you have a double dependency somehow.
Below is the dependencies part of my gradle file. If I comment out appcompat-v7 completely, everything works fine. Does play-services already depend on appcompatv7 and automatically bringing it in or what's going on?
dependencies {
compile 'com.google.android.gms:play-services:7.0.0'
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.google.maps.android:android-maps-utils:0.3'
//compile files('libs/commons-codec-1.8-sources.jar')
compile files('libs/engine.io-client-0.2.3.jar')
compile files('libs/ffmpeg.jar')
compile files('libs/Java-WebSocket-1.3.0.jar')
compile files('libs/socket.io-client-0.1.3.jar')
//compile files('libs/javacpp.jar')
compile files('libs/javacv.jar')
compile files('libs/json-simple-1.1.1.jar')
compile files('libs/opencv.jar')
//compile files('libs/twitter4j-async-4.0.2.jar')
compile files('libs/twitter4j-core-4.0.2.jar')
//compile files('libs/twitter4j-media-support-4.0.2.jar')
//compile files('libs/twitter4j-stream-4.0.2.jar')
}
It turns out there was an exact duplicate to this question:
After update of AS to 1.0, getting "method ID not in [0, 0xffff]: 65536" error in project
I fixed it by adding (this alone will fix the original problem):
defaultConfig {
...
multiDexEnabled true
}
and by cutting down on the massive Google Play Services, and using only subsets of it (this alone will also fix the original problem):
dependencies {
//compile 'com.google.android.gms:play-services:7.0.0'
compile 'com.google.android.gms:play-services-maps:7.0.0'
compile 'com.google.android.gms:play-services-location:7.0.0'
compile 'com.google.android.gms:play-services-gcm:7.0.0'
compile 'com.google.android.gms:play-services-plus:7.0.0'
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.google.maps.android:android-maps-utils:0.3+'
compile files('libs/engine.io-client-0.2.3.jar')
compile files('libs/ffmpeg.jar')
compile files('libs/Java-WebSocket-1.3.0.jar')
compile files('libs/socket.io-client-0.1.3.jar')
compile files('libs/javacv.jar')
compile files('libs/json-simple-1.1.1.jar')
compile files('libs/opencv.jar')
compile files('libs/twitter4j-core-4.0.2.jar')
}

Categories

Resources