I have this gradle
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.estimote:sdk:1.4.0'
compile 'com.android.support:appcompat-v7:27.0.1'
testCompile 'junit:junit:4.12'
compile('com.crashlytics.sdk.android:crashlytics:2.7.1#aar') {
transitive = true;
}
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.afollestad.material-dialogs:core:0.9.5.0'
compile 'com.google.android.gms:play-services-maps:11.6.0'
compile 'com.google.android.gms:play-services-location:11.6.0'
}
I have problem with appcompat-v7:27.0.1 and the google play services.
if I use the 26.0.1 there is not problem with the google play services but cant use the afollestand 0.9.5.0.
I need the afollestand 0.9.5.0 that works with appcompat-v7:27
UPDATE:
Gradle image
I've had the same problem. What user raghunandan suggested helps.
Using ./gradlew app:dependencies in your Apps folder ( or ./gradlew.bat app:dependencies on Windows), you get the dependency tree of all the packages.
There you can see that 'play-services-maps' requires some support packages with version 25.2.0, but most of them get upgraded to 27.0.2. But not all for some reason. You can do this manually though, by including them directly! (They will be part of your APK anyway)
compile 'com.android.support:support-v4:27.0.2'
add that in your apps build.gradle alongside support-v7 and it'll work.
I try Everything, but the real answer was wait to and update of play-services.
now my gradle looks like:
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "xxx.YYY"
minSdkVersion 19
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
maven {
url "https://maven.google.com"
}
}
dependencies {
compile('com.crashlytics.sdk.android:crashlytics:2.7.1#aar') {
transitive = true;
}
compile 'com.android.support:appcompat-v7:27.0.2'
compile 'com.android.support:cardview-v7:27.0.2'
compile 'com.android.support:recyclerview-v7:27.0.2'
compile 'com.android.support:support-v4:27.0.2'
compile 'com.android.support:design:27.0.2'
compile 'com.google.android.gms:play-services-maps:11.8.0'
compile 'com.google.android.gms:play-services-location:11.8.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.maps.android:android-maps-utils:0.5'
compile 'com.afollestad.material-dialogs:core:0.9.6.0'
testCompile 'junit:junit:4.12'
And have 0 errors.
Related
As soon as I add
compile 'com.google.android.libraries.places:places:1.0.0'
It starts giving me error
Cause: duplicate entry: com/bumptech/glide/GeneratedAppGlideModule.class
My build.gradle code is
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.videep.carpool"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
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'
})
//noinspection GradleCompatible
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-core:11.0.4'
compile 'com.google.firebase:firebase-database:11.0.4'
compile 'com.google.firebase:firebase-auth:11.0.4'
compile 'com.google.firebase:firebase-storage:11.0.4'
compile 'com.firebase:geofire-android:2.1.1'
compile 'com.google.android.gms:play-services:11.0.4'
compile 'com.github.bumptech.glide:glide:4.3.1'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.github.jd-alexander:library:1.1.0'
testCompile 'junit:junit:4.12'
compile 'com.google.android.libraries.places:places:1.0.0'
}
apply plugin: 'com.google.gms.google-services'
Add Dependencies for Glide with the latest version.
repositories {
mavenCentral()
google()
}
dependencies {
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
}
This issue is in glide library. It is fixed in latest version. Please check link for reference.
Use the latest version of glide. This issue is fixed.
dependencies {
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
}
for more detail refer here Glide
i had a problem in my gradelle with response Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve com.mindorks:placeholderview:0.7.1.
i try like
a. settings > build exception deployment > gradle > uncheck offline work it's failed
b. clean and reburd it's failed
c. invalidate and restart failed
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '26.0.2'
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "sid.len.mobile"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
multiDexEnabled true
}
packagingOptions {
pickFirst 'META-INF/LICENSE.txt' // picks the JavaMail license file
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
jcenter()
maven {
url "https://maven.java.net/content/groups/public/"
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:27.0.0'
implementation 'com.android.support:gridlayout-v7:27.0.0'
compile 'com.android.support:support-annotations:27.0.0'
implementation 'com.android.support:recyclerview-v7:27.0.0'
compile 'com.android.support:design:27.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
compile 'com.android.support:multidex:1.0.3'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.google.android.gms:play-services-location:11.0.1'
compile 'com.google.android.gms:play-services-maps:11.0.1'
compile 'com.google.android.gms:play-services-safetynet:11.0.1'
compile 'com.google.android.gms:play-services-base:11.0.1'
compile 'com.google.android.gms:play-services-basement:11.0.1'
compile 'com.google.android.gms:play-services-tasks:11.0.1'
compile 'net.zetetic:android-database-sqlcipher:3.4.0#aar'
compile 'com.squareup.okhttp3:logging-interceptor:3.4.0'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.squareup:otto:1.3.8'
//noinspection OutdatedLibrary
compile 'com.android.volley:volley:1.1.0'
compile files('libs/jtds-1.3.1.jar')
testCompile 'junit:junit:4.12'
compile 'com.mindorks:placeholderview:0.7.1'
}
you need to add this repository:
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
while that build.gradle seems to have more than one problem, including duplicate *.jar references and a few outdated libraries (in case you may wonder why it still won't build).
at least use buildToolsVersion "27.0.3".
I create a signed APK and upload that, it crashes in all below version of marshmallow. The signed APK works on Android above version 5.0, but not on <5.0. The AppCompat Library is linked with the project in Android.
And when I normally run the same project in android 5.0 it work perfectly but signed apk not run in 5.0.
And it was also not generating the crash report.
In the AndroidManifest.xml I have declared:
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.ahgp"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
// Enabling multidex support.
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets { main { java.srcDirs = ['src/main/java', 'src/main/assets/fonts'] } }
}
allprojects {
repositories {
maven {
url "https://github.com/QuickBlox/quickblox-android-sdk-releases/raw/master/"
}
}
}
repositories {
mavenCentral()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
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.paypal.sdk:paypal-android-sdk:2.15.3') {
exclude group: 'io.card'
}
compile files('libs/twitter4j-core-4.0.3.jar')
// compile 'com.jakewharton:butterknife-compiler:8.6.0'
compile 'com.squareup.picasso:picasso:2.3.2'
compile 'com.jakewharton:butterknife:8.6.0'
compile 'com.android.support:appcompat-v7:26.0.2'
compile 'com.android.support:design:26.0.2'
compile 'com.squareup.retrofit2:retrofit:2.0.0-beta4'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
compile 'org.glassfish.main:javax.annotation:4.0-b33'
compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
compile 'com.squareup.okhttp3:okhttp:3.4.1'
compile 'com.android.support:recyclerview-v7:26.0.2'
compile 'com.android.support:support-v4:26.0.2'
compile 'com.facebook.android:facebook-android-sdk:(4,5)'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.loopj.android:android-async-http:1.4.9'
compile 'com.journeyapps:zxing-android-embedded:3.5.0'
testCompile 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0'
/* compile 'com.google.android.gms:play-services:10+'
compile 'com.google.android.gms:play-services-location:10+'
compile 'com.google.android.gms:play-services-maps:10+'
compile 'com.google.android.gms:play-services-places:10+'*/
compile 'com.quickblox:quickblox-android-sdk-videochat-webrtc:3.3.1'
compile 'com.google.android.gms:play-services:11.0.4'
compile 'com.google.firebase:firebase-messaging:11.0.4'
compile 'com.google.firebase:firebase-core:11.0.4'
implementation 'com.android.support:multidex:1.0.3'
//noinspection GradleCompatible
/* compile 'com.google.firebase:firebase-messaging:9.8.0'
compile 'com.google.firebase:firebase-core:9.8.0'*/
// glide
compile 'com.github.bumptech.glide:glide:3.7.0'
// acra crash report
compile 'ch.acra:acra:4.6.2'
}
apply plugin: 'com.google.gms.google-services'
In your build gradle file minimum os is 21 so your app will not supported below to 21.
I'm getting this error, but I'm not sure what I did wrong. I made sure I updated everything according to the instructions on the firebase website. Is this a compatibility error?
09-22 13:12:51.158 18083-18110/com.pingus.vent W/GooglePlayServicesUtil: Google Play services out of date. Requires 11020000 but found 10298480
Gradle Files:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.pingus.vent"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile fileTree(dir: 'libraries', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.google.firebase:firebase-core:11.0.4'
compile 'com.google.firebase:firebase-auth:10.0.2'
compile 'com.google.firebase:firebase-database:10.0.2'
compile 'com.android.support:design:25.2.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:25.2.0'
compile 'com.android.volley:volley:1.0.0'
compile 'com.google.android.gms:play-services:11.0.4'
compile 'cn.pedant.sweetalert:library:1.3'
testCompile 'junit:junit:4.12'
compile 'com.android.support:recyclerview-v7:25.2.0'
compile 'com.github.jd-alexander:LikeButton:0.2.1'
}
apply plugin: 'com.google.gms.google-services'
You should use the same version for all Firebase services and Google play services as well, for example:
compile 'com.google.android.gms:play-services:11.0.4'
compile 'com.google.firebase:firebase-core:11.0.4'
compile 'com.google.firebase:firebase-auth:11.0.4'
compile 'com.google.firebase:firebase-database:11.0.4'
I used to use different versions for google play services and firebase services and got crashes.
I tried to get the latest version of the google play services for the maps api, using compile 'com.google.android.gms:play-services-maps:11.2.0' in the gradle file and also put the google maven url in the project gradle.
My problem is that when i try to sync my gradle files, i get an error and android studio proposes to install repository and sync project, but when i click on it nothing happens and android studio freezes for a few seconds.
The same happens if i add the whole google play services with compile 'com.google.android.gms:play-services:11.2.0'
I tried the invalidate cache/restart technique, i uninstalled/installed the google play service in the sdk manager and i don't know what to do to resolve this problem.
The build.gradle is like this (it works with the 11.0.4 version) :
apply plugin: 'com.android.application'
def dbflow_version = "4.0.5"
android {
compileSdkVersion 25
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "not telling"
minSdkVersion 21
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
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'
})
annotationProcessor "com.github.Raizlabs.DBFlow:dbflow-processor:${dbflow_version}"
compile "com.github.Raizlabs.DBFlow:dbflow-core:${dbflow_version}"
compile "com.github.Raizlabs.DBFlow:dbflow:${dbflow_version}"
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.jakewharton:butterknife:8.8.1'
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.android.gms:play-services-identity:11.0.4'
testCompile 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
}
Do you have a way to fix this ?