I am looking for the answer that can help me to solve this problem. I am trying to solve this problem for last 2 days.But still, I didn't get the answer that can solve my problem. I have tried so many solutions which are given here.But no solution worked for me.
Please help me to solve this problem.Any help will be appreciated.
The actual problem is:
Error:Execution failed for task
':app:transformDexArchiveWithExternalLibsDexMergerForGlobalServerDebug'.
java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
this is occurring every time when I run my existing project on android studio 3.0
I have tried so many solutions for this like:
1- To add mutidexenabled true in gradle
2- To change the version of dependencies
3- To change the compile keyword with the implementation
4- To clean and rebuild the project
5- Delete the Gradle file(this was so difficult because when you again
restarted the project no Gradle file will be auto-regenerated) etc.
I am looking for the solutions which are other than those which are mentioned above. Please help me out. Please...
code of gradle file is given below:
apply plugin: 'com.android.application'
buildscript {
repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'io.fabric'
repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
flatDir {
dirs 'libs'
}
}
repositories {
maven { url 'http://clojars.org/repo' }
}
android {
signingConfigs {
config {
keyAlias 'example'
keyPassword 'example'
storeFile file('/Users/standarduser/Documents/Android_Projects/example.jks')
storePassword '########'
}
}
compileSdkVersion 25
buildToolsVersion '26.0.2'
defaultConfig {
applicationId 'com.example.example'
minSdkVersion 16
targetSdkVersion 24
versionCode 9 // both Latest
versionName "2.0.7"
multiDexEnabled true
useLibrary 'org.apache.http.legacy'
vectorDrawables.useSupportLibrary = true
signingConfig signingConfigs.config
}
dexOptions {
incremental = true
preDexLibraries = false
javaMaxHeapSize "4g"
}
aaptOptions.cruncherEnabled = false
aaptOptions.useNewCruncher = false
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
android {
packagingOptions
{
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
}
lintOptions{
abortOnError false
}
}
dependencies {
compile files('libs/httpcore-4.4.1.jar')
compile('com.twitter.sdk.android:twitter:2.1.1#aar') { //1.6.1#aar
transitive = true;
}
compile('com.github.afollestad.material-dialogs:core:0.8.5.2#aar') {
transitive = true
}
compile('io.socket:socket.io-client:0.8.2') { // 0.6.3
// excluding org.json which is provided by Android
exclude group: 'org.json', module: 'json'
}
testCompile 'junit:junit:4.12'
compile 'com.writingminds:FFmpegAndroid:0.3.2'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'io.nlopez.smartlocation:library:3.2.9'
// compile 'com.android.volley:volley:1.0.0'
compile 'com.google.android.gms:play-services-appinvite:9.8.0'
//9.0.1
compile 'com.google.android.gms:play-services-gcm:9.8.0'
compile 'com.google.android.gms:play-services-location:9.8.0'
compile 'com.google.android.gms:play-services-places:9.8.0'
compile 'com.google.android.gms:play-services-maps:9.8.0'
compile 'com.google.android.gms:play-services-ads:9.8.0'
compile 'com.google.android.gms:play-services-auth:9.8.0'
compile 'com.google.android.gms:play-services-plus:9.8.0'
//noinspection GradleCompatible
compile 'com.android.support:appcompat-v7:25.3.0'
compile 'com.android.support:design:25.0.1'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.google.code.gson:gson:2.4'
compile 'org.apache.httpcomponents:httpmime:4.3.5'
// implementation 'org.apache.httpcomponents:httpmime:4.3.6'
// implementation 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.facebook.android:facebook-android-sdk:4.23.0'
compile 'com.pusher:pusher-java-client:1.1.2'
compile 'com.android.support:recyclerview-v7:25.0.1'
compile 'com.android.support:cardview-v7:25.0.1'
compile 'com.daimajia.swipelayout:library:1.2.0#aar'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.6'
compile 'com.amazonaws:aws-android-sdk-mobileanalytics:2.2.9'
compile 'com.commit451:PhotoView:1.2.4'
compile 'commons-lang:commons-lang:2.3'
compile 'com.karumi:dexter:2.3.1'
compile 'com.jakewharton:butterknife:8.5.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
implementation 'com.android.support:multidex:1.0.2'
compile 'org.ocpsoft.prettytime:prettytime:3.2.7.Final'
compile 'com.koushikdutta.async:androidasync:2.+'
compile 'com.soundcloud.android:android-crop:1.0.1#aar'
compile 'net.danlew:android.joda:2.9.4.1'
compile 'com.albinmathew:photo-crop-library:1.0.3'
compile 'com.amazonaws:aws-android-sdk-core:2.2.+'
compile 'com.amazonaws:aws-android-sdk-s3:2.2.+'
compile 'com.wang.avi:library:2.1.3'
compile 'com.wowza.gocoder.sdk.android:com.wowza.gocoder.sdk:1.0b7#aar'
compile 'com.theartofdev.edmodo:android-image-cropper:2.3.+'
compile('com.crashlytics.sdk.android:crashlytics:2.6.4#aar') {
transitive = true;
}
compile 'com.google.code.gson:gson:2.7'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
// compile 'com.cocosw:bottomsheet:1.+#aar'
compile project(':libbambuser7')
compile 'com.squareup.okhttp:okhttp:2.0.0'
}
apply plugin: 'com.google.gms.google-services'
Add this in your build.gradle
android {
defaultConfig {
multiDexEnabled true
}
}
First sync gradle then
From the Build menu -> press the Clean Project button.
When task completed, press the Rebuild Project button from the Build menu.
compile is now deprecated so it's better to use implementation or api
hope this helps you.
Try this
Use this
com.google.android.gms:play-services:11.6.0
com.google.android.gms:play-services-location:11.6.0
Instead of this
com.google.android.gms:play-services:9.8.0
after Sync -> clean -> rebuild
Related
Hello guys this is the error which I faced while I was running the app. I am fresher to android so I cant get the results.I already gone through some tech websites it suggested to change versions (compile SDK version and Build tools version ) yet I cant solve this. Can any one help me to solve this ?.
Error Message :
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
Android Build.gradle file.
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.24.4'
}
}
apply plugin: 'com.android.application'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
apply plugin: 'io.fabric'
android {
compileSdkVersion 25
buildToolsVersion "26.0.2"
repositories {
maven {
url 'https://maven.google.com'
}
maven { url 'https://maven.fabric.io/public' }
}
defaultConfig {
applicationId "com.smartgladiator.link"
minSdkVersion 21
targetSdkVersion 25
// Enabling multidex support.
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
versionCode 2
// versionName "1.0.37.1"
versionName "1.0.38"
}
dexOptions {
jumboMode true
javaMaxHeapSize "4g"
}
buildTypes {
release {
minifyEnabled false
shrinkResources false
zipAlignEnabled true
debuggable false
lintOptions {
disable 'MissingTranslation'
disable 'ResourceType'
}
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/ASL2.0'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
useLibrary 'org.apache.http.legacy'
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
//noinspection GradleCompatible
compile 'com.android.support:appcompat-v7:25.4.0'
compile 'com.android.support:design:25.4.0'
compile 'com.android.support:customtabs:25.4.0'
compile 'com.android.support:multidex:1.0.2'
compile 'com.android.support:support-v13:25.4.0'
//compile 'com.android.support:multidex:1.0.1'
//to make supported components
compile 'com.android.support:support-v4:25.4.0'
compile 'com.android.support:recyclerview-v7:25.4.0'
compile 'org.glassfish.tyrus.tests.servlet:tyrus-tests-servlet-autobahn-server:1.12'
compile 'org.glassfish.tyrus.tests:tyrus-tests-servlet-autobahn-server:1.0-b13'
compile 'com.github.nkzawa:socket.io-client:0.3.0'
compile 'com.baoyz.actionsheet:library:1.1.7'
compile 'com.baoyz.swipemenulistview:library:1.3.0'
compile 'com.daimajia.swipelayout:library:1.2.0#aar'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.makeramen:roundedimageview:2.3.0'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.fasterxml.jackson.core:jackson-databind:2.7.3'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.3.1'
compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
compile 'com.daimajia.swipelayout:library:1.2.0#aar'
compile('com.crashlytics.sdk.android:crashlytics:2.6.8#aar') {
transitive = true;
}
compile project(':speech')
// debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.4'
}
Make sure android sdk localtion is set correctly
ANDROID_HOME = home/user/android_sdk/ "this is correct location"
ANDROID_HOME = home/user/android_sdk/tools "wrong path"
or
downgrade your gradle version
This question already has answers here:
Android dependency has different version for the compile and runtime
(18 answers)
Closed 3 years ago.
Error:Execution failed for task ':app:preDebugBuild'.
Android dependency 'com.google.android.gms:play-services-ads' has different version for the compile (11.8.0) and runtime (11.0.4) classpath. You should manually set the same version via DependencyResolution
My project gradle:
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
My module gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '26.0.2'
defaultConfig {
applicationId 'com.bezets.cityappar'
minSdkVersion 16
targetSdkVersion 25
versionCode 4
versionName '1.3.0'
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
javaMaxHeapSize "2g"
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/LICENSE-FIREBASE.txt'
}
productFlavors {
}
lintOptions {
disable 'InvalidPackage'
abortOnError false
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'com.google.android.gms:play-services-ads:11.8.0'
implementation 'com.google.firebase:firebase-messaging:11.8.0'
compile fileTree(include: ['*.jar'], dir: 'libs')
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:design:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:palette-v7:25.3.1'
compile 'com.jakewharton:butterknife:7.0.1'
compile files('libs/volley.jar')
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.firebase:firebase-core:11.0.4'
compile 'com.google.firebase:firebase-database:11.0.4'
compile 'com.google.firebase:firebase-storage:11.0.4'
compile 'com.google.android.gms:play-services-auth:11.0.4'
compile 'com.google.android.gms:play-services-maps:11.0.4'
compile 'com.google.android.gms:play-services-location:11.0.4'
compile 'com.google.maps.android:android-maps-utils:0.4'
compile 'com.google.firebase:firebase-auth:11.0.4'
compile 'com.google.firebase:firebase-crash:11.0.4'
compile 'com.google.firebase:firebase-ads:11.0.4'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.okhttp:okhttp:2.3.0'
compile 'com.squareup:otto:1.3.6'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'uk.co.chrisjenx:calligraphy:2.2.0'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.github.paolorotolo:appintro:3.3.0'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
How can I fix it error?
My error is similar with yours, solved with these way.
Error is shown below :
Android dependency 'com.google.android.gms:play-services-tasks' has different version for thecompile (11.4.2) and runtime (15.0.1) classpath. You should manually set the same version via DependencyResolution
Then in file : android/build.gradle ,
I add this script :
allprojects {
...
configurations.all {
resolutionStrategy.force "com.google.android.gms:play-services-
tasks:15.0.1"
}
}
Please see this answer
You can solve it in one of two ways: Define a resolution strategy or include the offending version in your dependencies.
Hope this helps!
Set all Google/Firebase dependency to Same version 11.8.0
After 2 months i reopened a project that needs to be updated but i keep getting this error:
Gradle sync failed: Manifest Tasks does not support the manifestOutputFile property any more, please use the manifestOutputDirectory instead.
For more information, please check https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html
Consult IDE log for more details (Help | Show Log)
And I use Gradle:3.0.1
This is app gradle file:
apply plugin: 'com.android.application'
apply plugin: 'io.sentry.android.gradle'
repositories {
maven { url "https://jitpack.io" }
maven { url 'https://dl.bintray.com/drummer-aidan/maven' }
maven { url "http://dl.bintray.com/tbruyelle/tbruyelle" }
mavenCentral()
jcenter()
maven {
google()
}}
android {
signingConfigs {
config {
keyAlias 'user'
keyPassword 'pas'
storeFile file('../extra/file.jks')
storePassword 'pass'
}
}
compileSdkVersion 27
buildToolsVersion '27.0.2'
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/notice.txt'
exclude 'META-INF/ASL2.0'
}
defaultConfig {
applicationId "com.app.go"
targetSdkVersion 27
versionCode 19
versionName "1.2.0"
multiDexEnabled true
}
dexOptions {
javaMaxHeapSize "4g"
}
productFlavors {
// Define separate dev and prod product flavors.
prod {
// The actual minSdkVersion for the application.
minSdkVersion 19
}
}
flavorDimensions "default"
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
}
}
}
dependencies {
compile project(':sweet_alert_dialog')
compile 'com.google.android.gms:play-services-maps:11.6.2'
compile 'com.google.android.gms:play-services-location:11.6.2'
compile 'com.helpshift:android-aar:3.8.0'
compile 'com.google.maps.android:android-maps-utils:0.4'
compile 'com.google.code.gson:gson:2.8'
compile 'com.loopj.android:android-async-http:1.4.9'
compile 'de.greenrobot:eventbus:2.4.0'
compile 'com.balysv:material-ripple:1.0.2'
compile 'pl.charmas.android:android-reactive-location:0.9#aar'
compile 'io.reactivex:rxjava:1.1.5'
compile 'com.dlazaro66.wheelindicatorview:WheelIndicatorView:1.0.0'
compile 'com.rengwuxian.materialedittext:library:2.1.4'
compile 'com.jakewharton:butterknife:8.8.1'
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'joda-time:joda-time:2.9.1'
compile 'com.google.android.gms:play-services-gcm:11.6.2'
compile 'com.google.firebase:firebase-core:11.6.2'
compile 'com.google.firebase:firebase-messaging:11.6.2'
compile 'com.minimize.library:seekbar-compat:0.2.3'
compile 'com.afollestad.material-dialogs:core:0.9.0.2'
compile 'com.googlecode.libphonenumber:libphonenumber:7.1.1'
compile 'com.android.support:cardview-v7:27.0.2'
compile 'com.android.support:support-v4:27.0.2'
compile 'com.android.support:appcompat-v7:27.0.2'
compile 'com.android.support:design:27.0.2'
compile 'fr.avianey.com.viewpagerindicator:library:2.4.1#aar'
compile 'com.tbruyelle.rxpermissions:rxpermissions:0.8.0#aar'
compile 'com.braintreepayments.api:braintree:2.4.1'
compile 'com.braintreepayments:card-form:3.0.1'
compile 'io.smooch:core:5.7.1'
compile 'io.smooch:ui:5.7.1'
compile 'us.belka:androidtoggleswitch:1.1.1'
compile 'com.github.yasevich:endless-recycler-view:1.1.0'
compile 'com.android.support:multidex:1.0.2'
compile 'com.github.bumptech.glide:glide:4.3.1'
compile 'de.cketti.mailto:email-intent-builder:1.0.0'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.9.0'
compile 'com.github.jrvansuita:CheckNewAppVersionAvailable:v1.0.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.wdullaer:materialdatetimepicker:3.2.0'
compile 'io.sentry:sentry-android:1.2.0'
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.2'
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.2'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.2'
}
apply plugin: 'io.sentry.android.gradle'
This was causing the error, removing it solved it.
I try to connect my app to firebase database to receiving a list of data from firebase displayed using recyclerview and cardview, but there are many errors when add Dependencies
I get this error when run app .
The first mistake -
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/firebase/iid/zzc.class
this my app build gradle
android {
compileSdkVersion 23
buildToolsVersion "23.0.0"
defaultConfig {
applicationId "com.seu.hh.mm"
minSdkVersion 14
targetSdkVersion 26
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.firebase:firebase-client-android:2.4.0'
compile 'com.google.firebase:firebase-crash:10.0.1'
compile 'com.google.firebase:firebase-storage:10.0.1'
compile 'com.android.support:recyclerview-v7:23.0.0'
compile 'com.android.support:cardview-v7:23.0.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:support-v4:23.0.0'
compile 'com.firebaseui:firebase-ui-database:2.1.1'
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
}
apply plugin: 'com.google.gms.google-services'
this my build gradle project
allprojects {
repositories {
maven {
url "https://maven.google.com"
}
jcenter()
}
}
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.google.gms:google-services:3.1.0'
}
}
allprojects {
repositories {
jcenter()
}
}
please help me :(
how can solve this problem and make app run
You are mixing compile 'com.firebaseui:firebase-ui-database:2.1.1' with compile 'com.google.firebase:firebase-database:10.0.1' and that's why you have a duplicate.
So first off all you need to remove this line of code:
compile 'com.firebaseui:firebase-ui-database:2.1.1'
Change this lines of code:
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.google.firebase:firebase-crash:10.0.1'
compile 'com.google.firebase:firebase-storage:10.0.1'
compile 'com.android.support:recyclerview-v7:23.0.0'
compile 'com.android.support:cardview-v7:23.0.0'
with
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.google.firebase:firebase-core:11.0.1'
compile 'com.google.firebase:firebase-database:11.0.1'
compile 'com.google.firebase:firebase-crash:11.0.1'
compile 'com.google.firebase:firebase-storage:11.0.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
In this way you'll have the lates versions.
I've started getting java.lang.NoClassDefFoundError: for random class and that class changes on my every teammates machine and it's only happening for 5.x devices, we tested on 6.0 and 7.0 but everything is working fine there.
This started happening after adding 'com.android.support.constraint:constraint-layout:1.0.2'
We decide to start using constraint layout in app and since then we're getting this error
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
mavenCentral()
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'realm-android'
repositories {
maven { url 'https://maven.fabric.io/public' }
maven { url "https://jitpack.io" }
maven { url 'https://zendesk.artifactoryonline.com/zendesk/repo' }
}
def minSdk = hasProperty ('minSdk') ? minSdk : 19
//for debug builds add username to version as suffix
def username = readVersion()
android {
compileSdkVersion 25
buildToolsVersion '25.0.0'
dataBinding {
enabled = true
}
lintOptions {
abortOnError false
disable 'MissingTranslation'
disable 'ExtraTranslation'
}
defaultConfig {
applicationId "xxx.xxxx.xxxxxx"
minSdkVersion minSdk
targetSdkVersion 25
maxSdkVersion 25
versionCode 27
versionName "0.0.00"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
ndk {
abiFilters "armeabi-v7a", "x86","armeabi"
}
packagingOptions {
exclude "lib/arm64-v8a"
}
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
}
debug {
minifyEnabled false
debuggable true
versionNameSuffix "${username}"
}
}
dexOptions {
incremental true
javaMaxHeapSize "4g"
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:cardview-v7:25.2.0'
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:design:25.2.0'
compile 'com.android.support:support-v4:25.2.0'
compile 'com.android.support:support-v13:25.2.0'
compile 'com.google.android.gms:play-services-gcm:10.2.0'
compile 'com.google.android.gms:play-services-maps:10.2.0'
compile 'com.google.android.gms:play-services-auth:10.2.0'
compile 'com.google.android.gms:play-services-location:10.2.0'
compile 'com.google.android.gms:play-services-places:10.2.0'
compile 'com.google.android.gms:play-services-plus:10.2.0'
compile 'com.google.maps.android:android-maps-utils:0.5'
compile 'com.google.http-client:google-http-client-gson:1.19.0'
compile 'com.pkmmte.view:circularimageview:1.1'
compile 'com.github.rahatarmanahmed:circularprogressview:2.5.0'
compile 'com.squareup.picasso:picasso:2.5.2'
//image picker
compile 'com.soundcloud.android:android-crop:1.0.1#aar'
compile 'com.android.support:multidex:1.0.1'
compile 'com.github.johnkil.android-appmsg:appmsg:1.2.0'
compile 'cn.pedant.sweetalert:library:1.3'
compile 'com.mobsandgeeks:android-saripaar:2.0.2'
compile 'com.github.jd-alexander:library:1.1.0'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.google.code.gson:gson:2.7'
compile('com.crashlytics.sdk.android:crashlytics:2.6.5#aar') {
transitive = true;
}
//expandable textview
compile 'com.ms-square:expandableTextView:0.1.4'
//favourite button
compile 'com.github.ivbaranov:materialfavoritebutton:0.1.2'
compile 'org.osmdroid:osmdroid-mapsforge:5.5:release#aar'
compile 'org.mapsforge:mapsforge-map-android:0.6.1'
// compile 'org.mapsforge:mapsforge-map:0.6.1' //not in use
compile 'com.pubnub:pubnub:4.2.0'
compile 'com.github.fernandodev.easyratingdialog:easyratingdialog:+'
compile 'com.zopim.android:sdk:1.3.2.1'
compile 'com.zendesk:sdk:1.7.3.1'
compile files('libs/YouTubeAndroidPlayerApi.jar')
compile 'com.zopim.android:sdk:1.3.2.1'
compile 'com.zendesk:sdk:1.7.3.1'
// Android SDK
compile 'com.facebook.android:facebook-android-sdk:4.+'
/*// Audience Network SDK. Only versions 4.6.0 and above are available
compile 'com.facebook.android:audience-network-sdk:4.+'
// Account Kit
compile 'com.facebook.android:account-kit-sdk:4.+'*/
// compile 'net.ypresto.androidtranscoder:android-transcoder:0.2.0'
// compile 'com.github.arimorty:floatingsearchview:1.1.2'
compile 'com.flurry.android:analytics:6.4.2'
//Webview dependancy
compile 'com.thefinestartist:finestwebview:1.2.7'
//autofit textview
compile 'me.grantland:autofittextview:0.2.+'
compile 'com.readystatesoftware.systembartint:systembartint:1.0.3'
//compile 'com.facebook.android:facebook-android-sdk:3.21.1'
//video compression
compile project(':ffmpeg4android_lib')
compile files('libs/SCTNotifier.jar')
compile "com.mixpanel.android:mixpanel-android:5.+"
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.maps.android:android-maps-utils:0.5+'
}
String readVersion() {
def version = "whoami".execute().text.trim()
version = version.replace("\\", ".")
version = version.replace(" ", ".")
return "_reboot_" + version
}
Update:
I've removed constraint layout from xml's and removed this line:
compile 'com.android.support.constraint:constraint-layout:1.0.2'
And now app is working fine.
Four reasons are generate NoClassDefFoundError in android:
1) The class is not available in Java Classpath.
2) You might be running your program using jar command and class was not defined in manifest file's ClassPath attribute.
3) Any start-up script is overriding Classpath environment variable.
4) Because NoClassDefFoundError is a subclass of java.lang.LinkageError it can also come if one of it dependency like native library may not available.
Before build apk clean your project.