I'm using Android Studio 0.6.1, with Crouton library and today after gradle sync I got next error:
Error:A problem occurred configuring root project 'project_name'.
Module version de.keyboardsurfer.android.widget:crouton:1.8.4 depends on libraries but is not a library itself
That's going on?
This issue due to com.android.support-v4 recent update.
So I changed
compile 'com.android.support:support-v4:20.+'
to
compile 'com.android.support:support-v4:19.1.+'
and crouton works fine
Different workaround is to use #aar:
compile('de.keyboardsurfer.android.widget:crouton:1.8.4#aar') {
exclude group: 'com.google.android', module: 'support-v4'
}
My solution according to #Revedko answer, using #aar and change all supports to version lower than 21 -> 20.+
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.loopj.android:android-async-http:1.+'
compile "com.bugsense.trace:bugsense:3.5"
compile('de.keyboardsurfer.android.widget:crouton:1.8.4#aar') {
exclude group: 'com.google.android', module: 'support-v4'
}
compile 'com.android.support:appcompat-v7:20.+'
compile 'com.google.android.gms:play-services:5.0.77'
}
Related
Why am getting this error it will not occurred when I sync the Gradle but when I'm running the project I am getting this error .
Error:Execution failed for task ':app:transformClassesWithJarMergingForRelease'. > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/common/base/FinalizableReference.class
I don't know which dependency cause this error, My dependencies are .
dependencies {
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:support-v4:25.3.1'
compile 'com.android.support:customtabs:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:percent:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.facebook.android:facebook-android-sdk:4.19.0'
compile 'com.google.android.gms:play-services-auth:11.0.0'
compile 'com.google.android.gms:play-services-location:11.0.0'
compile 'com.google.android.gms:play-services-maps:11.0.0'
compile 'com.google.android.gms:play-services-places:11.0.0'
compile 'com.google.maps.android:android-maps-utils:0.3.4'
compile 'io.nlopez.smartlocation:library:3.3.1'
compile 'com.appeaser.sublimenavigationviewlibrary:sublimenavigationviewlibrary:0.0.1'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.android.volley:volley:1.0.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.slider:library:1.1.5#aar'
compile 'com.afollestad:sectioned-recyclerview:0.4.1'
compile 'com.github.medyo:fancybuttons:1.8.3'
compile 'com.basgeekball:awesome-validation:2.0'
compile 'com.github.michaelye.easydialog:easydialog:1.4'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
Edit
I figured it out play service dependencies causing this problem. when I'm using 10.2.6 instead of 11.0.0 app is working perfectly, I just change dependecies to
compile 'com.google.android.gms:play-services-auth:10.2.6'
compile 'com.google.android.gms:play-services-location:10.2.6'
compile 'com.google.android.gms:play-services-maps:10.2.6'
compile 'com.google.android.gms:play-services-places:10.2.6'
but I want to use latest version of play-services 11.0.0 but it gives me the above problem. How to resolve this problem? Any help would be appriciated Thanks.
Finally problem is solved. Seems like its a bug google resolved this issue in updated version.
Use play Service Version 11.0.1
In project level gradle use
classpath 'com.google.gms:google-services:3.1.0'
Sometimes, this issue happens because of including different version of play-services (or some other libraries). Have a look at app dependencies using below:
gradle app:dependencies
or if you are using Gradle wrapper
./gradlew app:dependencies
There might be some other third party library that is using an older version of library. If that is the case, exclude the older library from the third party library and include the latest one.
You can do something like this:
compile ('com.thirdpartylib.android:library-sdk:8.3.0') {
exclude group: 'com.android.support', module: 'support-v4'
exclude group: 'com.android.support', module: 'support-annotations'
exclude group: 'com.google.android.gms', module: 'play-services-gcm'
compile 'com.android.support:support-v4:26.0.0'
compile 'com.android.support:support-annotations:26.0.0'
compile 'com.google.android.gms:play-services-gcm:11.2.0'
}
This should resolve any duplicate entry, the main reason for the issue
I've the below dependence in my Android app build.gradle
compileSdkVersion 25
buildToolsVersion "25.0.2"
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:design:25.0.0'
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-messaging:10.0.1'
compile 'com.firebase:firebase-jobdispatcher-with-gcm-dep:0.6.0'
compile 'com.google.firebase:firebase-appindexing:10.0.1'
compile 'com.google.firebase:firebase-ads:10.0.1'
testCompile 'junit:junit:4.12'
compile 'com.android.support:multidex:1.0.1'
}
but getting an error about versions compatibility, as shown below, what is the one to be changed here, i could not figure it out :(
I had same problem what i did was compile the higher version of libraries ,which were creating this error,in app:gradle only.
for example in your case
compile 'com.android.support:mediarouter-v7:25.0.0'
Add this in app:gradle.
There may be more like this mediarouter libraries if it still give error add them jst like this(making them higher version).
First you need to find out where's what consists of a conflicting version of the library. The easiest way to do so is to:
Open Terminal pane in your Android Studio.
Type in: ./gradlew androidDependencies
Find the row that represents the ENCLOSING library consisting of a conflict.
Then just use exclude statement for the conflicting library, like so:
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
(the example assuming com.android.support.test.espresso:espresso-core:2.2.2 was the ENCLOSING library, and com.android.support:support-annotations being the conflict)
I am integrating my project into another app in android studio but it shows the below error, I am googling the issue but no use.
Error:Execution failed for task ':app:packageAllDebugClassesForMultiDex'.
> java.util.zip.ZipException: duplicate entry: android/support/v4/accessibilityservice/AccessibilityServiceInfoCompatJellyBeanMr2.class
below is my app dependencies
configurations { all*.exclude group: 'com.android.support', module: 'support-annotations' }
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':waleteros')
compile 'com.android.support:recyclerview-v7:+'
compile 'com.squareup.picasso:picasso:2.4.0'
compile 'com.jakewharton:butterknife:5.1.2'
compile files('src/libs/android_sync_service_library.jar')
compile "com.google.android.gms:play-services:3.1.+"
compile('com.crashlytics.sdk.android:crashlytics:2.2.2#aar') {
transitive = true;
}
and here is my library dependencies
configurations { all*.exclude group: 'com.android.support', module: 'support-v4' }
configurations { all*.exclude group: 'com.android.support', module: 'support-annotations' }
dependencies {
compile project(':ingosdk')
compile 'com.google.code.gson:gson:2.2.4'
compile files('libs/A2iA.Mobility.jar')
compile files('libs/acra-4.5.0.jar')
compile files('libs/bugsense-3.5.jar')
compile files('libs/deviceprint-lib-1.0.0.jar')
compile files('libs/FlurryAnalytics-5.3.0.jar')
compile files('libs/httpmime-4.1.2.jar')
compile files('libs/libGoogleAnalyticsServices.jar')
compile files('libs/volley.jar')
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0#aar'
compile files('libs/android-support-v13.jar')
}
If you have the android-support-v4.jar in your libs folder.. delete it!
That solved my problem.
Even though the file is not added in the build.gradle file.. gradle includes it in the build anyway.
I had the same problem after upgrading the android SDK. I was able to run the application in the buildToolsVersion '23.0.1', I got the same error when I changed to buildToolsVersion '24.0.3'
I resolved the problem by updating my java version from 1.7 to 1.8 with compileSdkVersion 24
Similar issue, I'd just imported
compile 'fr.avianey.com.viewpagerindicator:library:2.4.1.1'
and was getting this error, after adding "#aar", the problem was solved
compile 'fr.avianey.com.viewpagerindicator:library:2.4.1.1#aar'
In my opinion this error is happened by duplicate jar file.
I delete my support-V4 jar file into my library and then clean build it works fine.
Thanks
My project build.gradle dependencies are:
dependencies {
...
compile 'com.google.code.gson:gson:2.3.1'
compile 'com.google.android.gms:play-services-maps:8.4.0'
compile 'com.google.android.gms:play-services-analytics:8.4.0'
compile 'com.google.android.gms:play-services-appinvite:8.4.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'co.realtime:messaging-android:2.1.58'
}
And the co.realtime:messageing-android build.gradle dependencies are:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile ('com.android.support:appcompat-v7:21.0.3'){
transitive = true;
}
compile ('com.google.android.gms:play-services:6.1.71'){
transitive = true;
}
compile ('com.googlecode.json-simple:json-simple:1.1'){
transitive = true;
}
}
If I try to compile my project I get the following error:
Error:Gradle: Execution failed for task
':app-module:processProdDebugResources'.
Error: more than one library with package name 'com.google.android.gms' You can temporarily disable this error with
android.enforceUniquePackageName=false However, this is temporary
and will be enforced in 1.0
If I use enforceUniquePackageName(false) I get:
cannot resolve symbol to GoogleCloudMessaging.INSTANCE_ID_SCOPE
So I guess I'll have to solve this by managing the dependencies. I've tried:
compile ('co.realtime:messaging-android:2.1.58'){
exclude module: 'com.google'
}
compile ('co.realtime:messaging-android:2.1.58'){
exclude group: 'com.google.android.gms', module: 'play-services-gcm'
}
But nothing seams to work... How can I solve this?
Thanks.
The problem was in 'play-services-gcm' instead of 'play-services'
compile ('co.realtime:messaging-android:2.1.58'){
exclude group: 'com.google.android.gms', module: 'play-services'
}
grrr those typo mistakes... Well I thought I could delete this question but, once in a while someone has the same issue, so I will leave this here hoping perhaps it helps someone in need.
I just imported my project which worked fine from Eclipse to Android Studio v1.2.11 and now the project is no longer working with the following error which make the app crashes at onCreate() method:
java.lang.NoClassDefFoundError: android.support.v7.app.AppCompatDelegateImplV11.
I have updated updated my app to the latest v7 library, i.e. 22.1.1. below is my gradle.build dependencies:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile('com.android.support:support-v4:19.1.0') {
force = true
}
compile('com.google.android.gms:play-services-base:7.3.0') {
force = true
}
compile 'com.google.android.gms:play-services-plus:7.3.0'
compile 'joda-time:joda-time:2.7'
compile 'com.google.http-client:google-http-client-gson:1.20.0'
compile 'com.parse.bolts:bolts-android:1.1.2'
compile('com.facebook.android:facebook-android-sdk:3.22.0#aar') {
exclude group: 'com.android.support', module: 'support-v4'
exclude module: 'bolts'
}
compile 'com.google.guava:guava:18.0'
compile project(':PullToRefreshListView')
compile project(':CircularImageView')
compile project(':CountryPicker')
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.android.support:support-v13:22.1.1'
}
configurations {
// to avoid double inclusion of support libraries
all*.exclude group: 'com.android.support', module: 'support-v4'
}
NB: I am using Theme.AppCompat.Light in my styles which I believe supports ActionBar. What I want to achieve is the Nav. drawer but the app doesn't go past the onCreate(). Any help with this exception will be highly appreciated
For anyone having similar issue, I was able to solve this and thought I should share with others. The error was due to my configuration as I was excluding the android.support in my project. Once I commented it, it just vanished.
Make sure your class dependency is in your application specific build.gradle file, not your global build.gradle file.