Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api' - android

This is the error I'm getting when I try to build my project, Please help me to solves this I'm stuck at this and I'm a beginner in android.
Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'. It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
I'm also attaching my app level and build level gradle files.
App level buld.gradle
buildscript {
repositories { maven { url 'https://maven.fabric.io/public' } }
dependencies { classpath 'io.fabric.tools:gradle:1.25.3' }
}
plugins {
id 'com.onesignal.androidsdk.onesignal-gradle-plugin' version '0.8.1'
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
repositories {
maven { url 'https://maven.google.com' }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories { maven { url 'https://maven.fabric.io/public' } }
android {
compileSdkVersion 27
useLibrary 'org.apache.http.legacy'
defaultConfig {
minSdkVersion 19
targetSdkVersion 27
versionCode 102
versionName "1.0.2"
multiDexEnabled true
// resConfigs "en"
manifestPlaceholders = [onesignal_app "code",
// Live
onesignal_google_project_number: "REMOTE"]
////
// manifestPlaceholders = [onesignal_app_id : "b35433d4-be61-473f-94f8-65364b2cd501",
// // Internal Testing
// onesignal_google_project_number: "REMOTE"]
}
android {
lintOptions {
checkReleaseBuilds false
abortOnError false
}
}
android {
buildTypes {
packagingOptions {
exclude 'META-INF/NOTICE' // will not include NOTICE file
exclude 'META-INF/LICENSE' // will not include LICENSE file
// as noted by #Vishnuvathsan you may also need to include
// variations on the file name. It depends on your dependencies.
// Some other common variations on notice and license file names
exclude 'META-INF/notice'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license'
exclude 'META-INF/license.txt'
}
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
debuggable false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
consumerProguardFiles 'proguard-file.pro'
}
}
}
dexOptions {
preDexLibraries = false
javaMaxHeapSize "12g"
}
}
repositories
{
maven { url 'https://repo.commonsware.com.s3.amazonaws.com' }
maven { url 'https://jitpack.io' }
maven { url "https://s3.amazonaws.com/repo.commonsware.com" }
}
//configurations.all {
// resolutionStrategy {
// force 'com.android.support:design:23.4.0'
//// force 'com.android.support:support-v4:23.4.0'
// force 'com.android.support:appcompat-v7:23.4.0'
// }
//}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
// implementation 'com.helpshift:android-aar:3.7.2'
implementation 'com.mcxiaoke.volley:library:1.0.19'
implementation files('libs/universal-image-loader-1.6.1-with-src.jar')
implementation project(':library')
implementation files('libs/Parse-1.8.0.jar')
implementation project(':gallery')
implementation project(':indicator')
implementation 'com.amplitude:android-sdk:2.9.2'
implementation 'com.razorpay:checkout:1.4.1'
implementation('com.crashlytics.sdk.android:crashlytics:2.6.6#aar') {
transitive = true;
}
// implementation 'com.hokolinks:hoko:2.3.0'
implementation 'cat.ereza:customactivityoncrash:1.5.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support:design:27.1.1'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'com.google.android.gms:play-services-base:15.0.1'
implementation 'com.google.firebase:firebase-appindexing:15.0.1'
implementation 'com.google.android.gms:play-services-appinvite:16.0.0'
implementation 'com.google.android.gms:play-services-gcm:15.0.1'
implementation 'com.google.android.gms:play-services-location:15.0.1'
implementation 'com.google.android.gms:play-services-plus:15.0.1'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.github.jaydeepw:poly-picker:v1.0.22'
implementation 'com.github.Commit451:NativeStackBlur:1.0.2'
implementation 'com.github.Hitta:RippleEffect:82cf00e551'
implementation 'com.github.zplesac:android_connectionbuddy:v1.0.7'
implementation 'com.github.paolorotolo:expandableheightlistview:1.0.0'
implementation 'com.github.tony19:timber-loggly:1.0.1'
implementation 'com.neumob:neumob-android:3.7.2'
implementation 'com.facebook.fresco:fresco:1.8.0'
implementation 'com.firebase:firebase-client-android:2.5.2'
implementation 'com.google.android.exoplayer:exoplayer:r1.5.10'
implementation project(':common')
implementation project(':commonwidget')
implementation project(':videowidget')
implementation 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-7'
implementation project(':Spotlight-library')
implementation 'com.onesignal:OneSignal:3.9.1#aar'
implementation files('libs/YouTubeAndroidPlayerApi.jar')
implementation files('libs/dropbox-android-sdk-1.6.3.jar')
implementation 'com.pitt.fresh.library:freshdownloadview:1.0'
implementation 'es.voghdev.pdfviewpager:library:1.0.1'
implementation('com.crashlytics.sdk.android:answers:1.3.11#aar') {
transitive = true;
}
// implementation 'com.bugsee:bugsee-android:+'
implementation 'com.stripe:stripe-android:5.0.0'
implementation 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.google.firebase:firebase-perf:16.0.0'
implementation 'io.branch.sdk.android:library:2.18.1'
implementation project(path: ':androidQuery')
implementation 'com.onesignal:OneSignal:[3.9.1, 3.99.99]'
implementation 'com.instabug.library:instabug:4.11.0'
implementation ('io.branch.sdk.android:library:2.+') {
exclude module: 'answers-shim'
}
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.firebase-perf'
Project level buld.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:3.2.0'
classpath 'com.google.firebase:firebase-plugins:1.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
maven {
url "https://maven.google.com" // Google's Maven repository
}
}
}
error screenshot
error
Host name 'repo.commonsware.com.s3.amazonaws.com' does not match the certificate subject provided by the peer (CN=*.s3.amazonaws.com, O=Amazon.com Inc., L=Seattle, ST=Washington, C=US)

Hi please replace or update your play service version with the bellow, It will remove the warning
classpath 'com.google.gms:google-services:3.2.0'

It's not an error it's an warning. Simply for now don't bother.
Change this part like this :
BEFORE:
repositories {
jcenter()
}
AFTER:
repositories {
jcenter()
mavenCentral()
google()
}

Related

ERROR: Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve com.google.android.gms:play-services-base

As you can see here are the errors I'm getting when I'm trying to sync my project I'm getting this issue again and again. Gradle is in Online mode. I also tried offline mode but I found the same issue.
I also tried so many methods but still, I can't able to solve this problem.
Gradle Sync Error
ERROR: Unable to resolve dependency for ':app#debugUnitTest/compileClasspath': Could not resolve com.google.android.gms:play-services-base:[10.2.1, 16.1.99]
Build.gradle (project)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath 'com.google.gms:google-services:4.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenLocal()
jcenter()
maven { url "https://maven.google.com" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Build.gradle (:app)
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.6, 0.99.99]'
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
repositories {
maven { url 'https://maven.google.com' }
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
useLibrary 'org.apache.http.legacy'
defaultConfig {
vectorDrawables {
useSupportLibrary = true
}
vectorDrawables.useSupportLibrary = true
applicationId "com.game.pubg.best.tournaments"
// TODO: Please update the OneSignal ID below to yours!
manifestPlaceholders = [onesignal_app_id: '6554b669-a188-4110-8836-b181ff64894b',
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: 'REMOTE']
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath false
}
}
}
repositories {
mavenCentral()
maven { url 'http://repo1.maven.org/maven2' }
maven { url "http://jcenter.bintray.com" }
maven { url "https://www.jitpack.io" }
maven { url "https://maven.google.com" }
maven { url 'https://dl.bintray.com/drummer-aidan/maven' }
maven { url "https://s3-ap-southeast-1.amazonaws.com/godel-release/godel/" }
jcenter()
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
// debug {
// minifyEnabled true
// proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
// }
}
}
apply plugin: 'com.google.gms.google-services'
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:support-vector-drawable:28.0.0'
// implementation 'ai.devsupport.instamojo:instamojolib:0.1.6'
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.2',
{
exclude group: 'com.android.support', module: 'support-annotations'
}
)
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:design:28.0.0'
// implementation 'com.google.android.gms:play-services-ads:17.0.0'
implementation 'de.hdodenhof:circleimageview:3.1.0'
implementation 'com.facebook.shimmer:shimmer:0.5.0'
implementation 'me.zhanghai.android.materialprogressbar:library:1.6.1'
implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation 'com.onesignal:OneSignal:[3.13.0, 3.99.99]'
implementation('com.paytm:pgplussdk:1.3.3')
{
transitive = true
}
implementation 'org.jsoup:jsoup:1.13.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.android.gms:play-services-auth:18.0.0'
}
Add apply plugin: 'com.google.gms.google-services' to build.gradle (:app)
Try dependencies of answer of this question: Android Studio can't find Kotlin dependency

Execution failed for task ':app: lintVitalRelease' due to `Could not find multidex-instrumentation.aar`

When I try to sync my app module inside android studio it prompts error:
ERROR: Failed to resolve: multidex-instrumentation Affected Modules:
app
When I try to run gradlew assemble
Execution failed for task ':app:lintVitalRelease'.
Could not resolve all artifacts for configuration ':app:debugAndroidTestRuntimeClasspath'.
Could not find multidex-instrumentation.aar (androidx.multidex:multidex-instrumentation:2.0.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/androidx/multidex/multidex-instrumentation/2.0.0/multidex-instrumentation-2.0.0.aar
solutions listed in this question did not fix my issue.
And an strange thing is that nothing as multidex-instrumentation-2.0.0 does not exist and I don't know why my app looks for such dependency.
Multidex-instrumentation 2.0.0 exists in Maven Repository.
Here are my build.gradle and app.gradle:
app.gradle
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
google()
jcenter()
maven {
url "https://maven.google.com"
}
maven { url 'https://maven.fabric.io/public' }
}
android {
// flavorDimensions ("resrouce")
compileSdkVersion 28
buildToolsVersion '28.0.3'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions{
disable 'MissingTranslation'
// checkReleaseBuilds false
// abortOnError false
}
defaultConfig {
applicationId 'com.myapp.android'
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName '1.0'
multiDexEnabled true
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath true
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
buildConfigField "boolean", "enableCrashlytics", "true"
ext.enableCrashlytics = true
}
releaseNonObfuscated {
minifyEnabled false
debuggable true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro', 'proguard-rules-debug.pro'
buildConfigField "boolean", "enableCrashlytics", "true"
ext.enableCrashlytics = false
}
debug {
versionNameSuffix '-DEBUG'
debuggable true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
buildConfigField "boolean", "enableCrashlytics", "true"
ext.enableCrashlytics = true
}
}
dexOptions {
javaMaxHeapSize "2g"
}
sourceSets {
main {
res.srcDirs = [
'src/main/res',
'src/main/res/layout',
'src/main/res/layouts/product',
'src/myapp_eve/res'
]
}
}
productFlavors {
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
configurations {
all*.exclude group: 'com.google.guava', module: 'listenablefuture'
}
}
ext {
//support_library_version = '28.0.0'
smooch_chat_librar_version = '5.16.3'
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//implementation 'com.android.support:28.0.0'
// implementation 'com.android.support:support-fragment:28.0.0'
// implementation 'androidx.appcompat:appcompat:1.0.0-beta01'
// implementation 'com.android.support:collections:28.0.0'
// implementation 'com.android.support:versionedparcelable:28.0.0'
// implementation 'com.android.support:collections:28.0.0'
// implementation 'de.greenrobot:eventbus:2.4.0'
// implementation 'org.roboguice:roboguice:3.0.1'
// compileOnly 'org.roboguice:roboblender:4.0.0'
// annotationProcessor 'org.roboguice:roboblender:4.0.0'
// implementation 'com.github.JakeWharton:ViewPagerIndicator:2.4.1'
// compile 'com.paypal.sdk:paypal-android-sdk:2.12.4'
// compile 'com.braintreepayments.api:braintree:2.3.9'
// compile 'com.braintreepayments.api:drop-in:2.3.8'
// implementation 'com.facebook.android:facebook-android-sdk:4.23.+'
//implementation 'org.roboguice:roboblender:4.0.0'
// implementation 'com.jakewharton:butterknife:10.0.0'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.exifinterface:exifinterface:1.0.0'
implementation 'androidx.vectordrawable:vectordrawable-animated:1.1.0-alpha01'
implementation 'androidx.legacy:legacy-support-core-ui:1.0.0'
implementation 'androidx.browser:browser:1.0.0'
implementation 'androidx.gridlayout:gridlayout:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.palette:palette:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0-alpha04'
implementation 'com.google.android.material:material:1.1.0-alpha05'
implementation 'com.google.android.material:material:1.1.0-alpha05'
implementation 'androidx.core:core:1.1.0-alpha05'
implementation 'androidx.annotation:annotation:1.1.0-beta01'
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation 'com.squareup.okhttp3:okhttp:3.12.1'
implementation 'com.squareup.okhttp3:logging-interceptor:3.12.1'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'org.greenrobot:eventbus:3.1.1'
implementation 'com.github.rey5137:material:1.2.5'
implementation 'com.pnikosis:materialish-progress:1.5'
// implementation 'com.daimajia.slider:library:1.1.5#aar'
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'com.commonsware.cwac:merge:1.1.2'
implementation 'org.florescu.android.rangeseekbar:rangeseekbar-library:0.3.0'
implementation 'com.google.code.findbugs:jsr305:3.0.2'
implementation 'com.marshalchen.ultimaterecyclerview:library:0.3.18'
implementation 'com.github.markomilos:paginate:0.5.1'
implementation 'com.google.android.gms:play-services-vision:17.0.2'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'com.malinskiy:superrecyclerview:1.1.1'
implementation 'com.daimajia.swipelayout:library:1.2.0#aar'
implementation 'com.flipboard:bottomsheet-core:1.5.0'
implementation 'com.flipboard:bottomsheet-commons:1.5.0'
implementation 'org.apmem.tools:layouts:1.10#aar'
implementation(name: 'persiandatepicker-release', ext: 'aar')
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
implementation('com.crashlytics.sdk.android:crashlytics:2.9.8#aar') {
transitive = true;
}
implementation 'com.jakewharton:butterknife:10.0.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0'
implementation 'com.binjar.prefsdroid:prefs-droid:1.1.0'
implementation 'com.google.firebase:firebase-messaging:17.6.0'
implementation 'com.google.firebase:firebase-core:16.0.8'
implementation 'org.jetbrains:annotations-java5:15.0'
implementation 'com.google.inject:guice:4.2.2'
implementation "io.smooch:core:${smooch_chat_librar_version}"
implementation "io.smooch:ui:${smooch_chat_librar_version}"
}
apply plugin: 'com.google.gms.google-services'
build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
maven { url 'https://s3.amazonaws.com/repo.commonsware.com' }
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url 'https://jitpack.io' }
}
dependencies {
//vahhab change to 3.2.0
classpath 'com.android.tools.build:gradle:3.3.1'
//classpath 'com.android.tools.build:gradle:3.2.1'
//classpath 'com.google.gms:google-services:2.0.0-alpha3'
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
// These docs use an open ended version so that our plugin
// can be updated quickly in response to Android tooling updates
// We recommend changing it to the latest version from our changelog:
// https://docs.fabric.io/android/changelog.html#fabric-gradle-plugin
classpath 'io.fabric.tools:gradle:1.27.1'
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://s3.amazonaws.com/repo.commonsware.com' }
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url 'https://jitpack.io' }
flatDir { dirs 'libs' }
}
}
You should enable jetifier in the gradle.properties file.
android.enableJetifier=true
delete .gradle and .idea folders then rebuild the project.

fire base and google play services can't resolve exception

I'm trying to build my application with the following gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '28.0.0 rc1'
defaultConfig {
applicationId "com.wallet"
minSdkVersion 17
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
vectorDrawables.useSupportLibrary true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled = true
}
dexOptions {
javaMaxHeapSize "4g"
}
lintOptions {
abortOnError false
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-
core:2.2.2', {
exclude group: 'com.android.support', module: 'support-
ancom.android.supportnotations'
})
implementation('com.alibaba.android:ultraviewpager:1.0.6.1#aar') {
transitive = true
}
implementation 'com.android.support:percent:27.1.1'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.jakewharton:butterknife:8.8.1'
implementation 'com.koushikdutta.ion:ion:2.2.1'
implementation 'com.airbnb.android:lottie:2.5.4'
implementation 'org.apache.commons:commons-lang3:3.4'
implementation 'org.greenrobot:eventbus:3.0.0'
implementation 'com.orhanobut:logger:2.1.1'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-crash:16.0.1'
implementation 'com.google.firebase:firebase-messaging:17.1.0'
implementation 'com.google.android.gms:play-services-gcm:15.0.1'
implementation 'com.google.android.gms:play-services-base:15.0.1'
implementation 'com.google.android.gms:play-services-vision:15.0.2'
implementation 'com.google.android.gms:play-services-ads-identifier:15.0.1'
implementation 'io.michaelrocks:libphonenumber-android:8.8.2'
implementation 'com.github.tamir7.contacts:contacts:1.1.7'
implementation 'com.cleveroad:slidingtutorial:1.0.8'
implementation "android.arch.persistence.room:runtime:1.1.1"
implementation "android.arch.lifecycle:runtime:1.1.1"
implementation "android.arch.lifecycle:extensions:1.1.1"
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
annotationProcessor "android.arch.persistence.room:compiler:1.1.1"
implementation 'com.appyvet:materialrangebar:1.4'
implementation "com.github.nisrulz:qreader:2.1.2"
implementation project(':library')
testImplementation 'junit:junit:4.12'
annotationProcessor "android.arch.lifecycle:compiler:1.1.1"
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
}
apply plugin: 'com.google.gms.google-services'
project' gradle file:
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.google.gms:google-services:4.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://jitpack.io' }
maven { url 'https://maven.google.com' }
maven { url "https://dl.bintray.com/krazykira/maven" }
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I'm getting the following error:
Failed to resolve: play-services-base
Failed to resolve: play-services-ads-identifier
when I change the play-services-base version to 15.0.0 this error is fixed but when I do the same for play-services-ads-identifier there's no change. Is there anyway for me to understand what is the problem or how can I make the app work with the current versions?
Any help would be appreciated 3>
For reasons unknown to me, google() must appear before jcenter() in the list of repositories, as is shown in the documentation.
buildscript {
repositories {
google() // <== CHANGED
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.google.gms:google-services:4.0.1'
}
}
allprojects {
repositories {
google() // <= CHANGED
jcenter()
maven { url 'https://jitpack.io' }
maven { url 'https://maven.google.com' }
maven { url "https://dl.bintray.com/krazykira/maven" }
}
}

Databinding Redirection to xml is not working in android studio 3.1.2

I have updated android studio to latest version(3.1.2) and now when I click on BindingClass with ctrl it's not opening xml file for it which was working in previous version. And I have tried the same thing with creating new project in same version of android studio but it's working on it.
So I am thinking that I have added some wrong dependencies or I have done something wrong. So please guide me regarding this issue.
Here is the build.gradle
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.firebase-perf'
apply plugin: 'realm-android'
apply plugin: 'io.fabric'
android {
compileSdkVersion 27
defaultConfig {
applicationId = "xxx.xxx.xxx"
minSdkVersion 18
targetSdkVersion 27
versionCode 9
versionName "1.0.8"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
}
dexOptions {
javaMaxHeapSize "4g"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
// signingConfig signingConfigs.config
buildConfigField 'Boolean', 'enableCrashlytics', 'false'
}
debug {
buildConfigField 'Boolean', 'enableCrashlytics', 'false'
}
}
flavorDimensions "default"
productFlavors {
basic {
// applicationIdSuffix ".basic"
// versionName "0.1.9"
}
admin {
// applicationIdSuffix ".admin"
// versionName "0.1.9-admin"
}
}
dataBinding {
enabled = true
}
packagingOptions {
exclude 'META-INF/maven/com.squareup.okhttp3/okhttp/pom.properties'
exclude 'META-INF/maven/com.squareup.okhttp3/okhttp/pom.xml'
exclude 'META-INF/maven/com.squareup.okio/okio/pom.properties'
exclude 'META-INF/maven/com.squareup.okio/okio/pom.xml'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation(name: 'wikitudesdk', ext: 'aar')
androidTestImplementation('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.1.0'
implementation 'com.android.support:design:27.1.0'
implementation 'com.google.android.gms:play-services-maps:11.6.0'
implementation 'com.google.android.gms:play-services-location:11.6.0'
implementation 'com.google.android.gms:play-services-analytics:11.6.0'
testImplementation 'junit:junit:4.12'
implementation 'com.squareup.okhttp3:okhttp:3.5.0'
implementation('com.squareup.retrofit2:retrofit:2.1.0') {
exclude module: 'okhttp'
}
implementation('com.squareup.retrofit2:adapter-rxjava:2.1.0') {
exclude module: 'okhttp'
}
implementation('com.squareup.retrofit2:converter-gson:2.1.0') {
exclude module: 'okhttp'
}
implementation('com.squareup.okhttp3:logging-interceptor:3.5.0') {
exclude module: 'okhttp'
}
implementation 'com.google.dagger:dagger:2.8'
annotationProcessor 'com.google.dagger:dagger-compiler:2.8'
implementation 'io.reactivex:rxandroid:1.2.1'
implementation 'io.reactivex:rxjava:1.1.6'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.android:flexbox:0.3.0-alpha2'
annotationProcessor 'org.parceler:parceler:1.1.6'
implementation 'org.parceler:parceler-api:1.1.6'
implementation 'com.google.guava:guava:20.0'
implementation 'me.zhanghai.android.materialprogressbar:library:1.3.0'
implementation 'com.facebook.fresco:fresco:1.1.0'
implementation 'com.facebook.fresco:animated-gif:1.1.0'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'com.caverock:androidsvg:1.2.1'
implementation 'joda-time:joda-time:2.9.3'
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'io.realm:android-adapters:1.3.0'
implementation 'com.mobsandgeeks:android-saripaar:2.0.2'
implementation 'org.greenrobot:eventbus:3.0.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.jakewharton.timber:timber:4.5.1'
implementation('com.crashlytics.sdk.android:crashlytics:2.7.1#aar') {
transitive = true
}
implementation 'com.github.JakeWharton:ViewPagerIndicator:2.4.1'
implementation 'com.google.android.exoplayer:exoplayer:r2.2.0'
implementation 'com.github.faruktoptas:FancyShowCaseView:0.1.0'
implementation 'com.google.firebase:firebase-messaging:11.6.0'
implementation 'com.facebook.android:facebook-android-sdk:4.28.0'
implementation 'com.shawnlin:number-picker:2.4.4'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.google.maps.android:android-maps-utils:0.5'
implementation 'com.intuit.sdp:sdp-android:1.0.4'
implementation 'com.google.firebase:firebase-perf:11.6.0'
implementation 'com.facebook.stetho:stetho:1.5.0'
implementation 'com.uphyca:stetho_realm:2.1.0'
// debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'
// releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
// testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
}
repositories {
flatDir {
dirs 'libs'
}
maven { url 'https://maven.fabric.io/public' }
}
apply plugin: 'com.google.gms.google-services'
Here is the Project Level build.gradle
buildscript {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath "io.realm:realm-gradle-plugin:3.0.0"
classpath 'io.fabric.tools:gradle:1.+'
classpath 'com.google.gms:google-services:3.1.1'
classpath 'me.tatarka:gradle-retrolambda:3.6.1'
classpath 'com.google.firebase:firebase-plugins:1.1.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {url "https://jitpack.io"}
maven {url 'https://github.com/uPhyca/stetho-realm/raw/master/maven-repo'}
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Thank you so much.
For opening related XML
Android Studio has a new icon for related XML redirection. My AS version is 3.2.1.
An hack for opening Binding Class.
Ctrl + N (Open File)
Type ActivityMainBinding {or first letters - Amb for ActivityMainBinding if you are smart enough :)
Hit enter on ActivityMainBinding
FYI I faced this problem in Java class only, [Go to declaration] works well with kotlin.
add below code into the project level gradle file.
jcenter()
below gradle file in the project it working fine.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

Android Studio "Unable to merge dex"

I keep getting this error. I cleaned everything, build, Rebuild, jumbomode, MultidexApplication I tried everything as possible I can, but everything didn't work out.
Sometimes it is necessary to remove the dependency one by one, but now it is useless.
I got stuck on this error from this error more than a week. anybody knows how to fix it out?
There's my config files below.
app.gradle
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven {
url 'https://maven.fabric.io/public'
}
}
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId ""
minSdkVersion 21
targetSdkVersion 26
versionCode 6
versionName "1.0.5"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
/*manifestPlaceholders = [ onesignal_app_id: "",
onesignal_google_project_number: "REMOTE" ]*/
manifestPlaceholders = [
manifestApplicationId : "${applicationId}",
onesignal_app_id : "",
onesignal_google_project_number: ""
]
}
dexOptions {
// jumboMode true
javaMaxHeapSize "4g"
preDexLibraries = false
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
ext.enableCrashlytics = false
}
}
dataBinding {
enabled = true
}
}
dependencies {
//noinspection GradleCompatible
implementation 'com.android.support:design:26.1.0'
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:support-v4:26.1.0'
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
// implementation 'com.android.support:customtabs:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
// one signal
implementation 'com.onesignal:OneSignal:3.7.1#aar'
// zendesk
implementation 'com.zendesk:sdk:1.10.0.1'
implementation('com.zendesk:sdk:1.10.0.1#aar') {
transitive = true
}
// UnifyID
implementation 'id.unify.sdk:sdk:0.8.1'
implementation 'com.android.support:multidex:1.0.2'
// circle ImageView
implementation 'de.hdodenhof:circleimageview:2.1.0'
// fabric
implementation('com.crashlytics.sdk.android:crashlytics:2.6.8#aar') {
transitive = true
}
// fitChart
implementation 'com.txusballesteros:FitChart:1.0'
// retrofit2
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
// google play services(google fit, google map, location)
//noinspection GradleCompatible,UseOfBundledGooglePlayServices
// implementation 'com.google.android.gms:play-services:11.8.0'
//noinspection GradleCompatible
implementation 'com.google.android.gms:play-services-fitness:11.8.0'
implementation 'com.google.android.gms:play-services-maps:11.8.0'
// implementation 'com.google.android.gms:play-services-location:11.8.0'
// implementation 'com.google.android.gms:play-services-places:11.8.0'
// firebase
implementation 'com.google.firebase:firebase-core:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
// facebook
implementation 'com.facebook.android:facebook-android-sdk:4.25.0'
implementation 'com.twitter.sdk.android:twitter:3.1.1'
// glide
implementation 'com.github.bumptech.glide:glide:4.5.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.5.0'
}
project.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
//apply plugin: 'com.jfrog.artifactory'
//apply plugin: 'maven-publish'
buildscript {
repositories {
jcenter()
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
maven { url "https://maven.google.com" }
//maven { url "https://artifacts.unify.id" }
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.1.0'
classpath 'io.fabric.tools:gradle:1.25.1'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
// classpath 'io.fabric.tools:gradle:1.22.1'
//classpath "org.jfrog.buildinfo:build-info-extractor-gradle:latest.release"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
maven {
url "http://gradle.unify.id/artifactory/gradle-release"
credentials {
username = ""
password = ""
}
}
maven { url 'https://zendesk.jfrog.io/zendesk/repo' }
maven { url "https://maven.google.com" }
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Try the different version combinations of gms:play-services:X.X.X library and also try by adding this code in your app module build.gradle file
android {
defaultConfig {
multiDexEnabled true
}
}
If u overridinig your Application class you need to do this
public class MyApplication extends SomeOtherApplication {
#Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
}
if that is not the case than u should in your manifest file in your application tag add this
<application
android:name="android.support.multidex.MultiDexApplication" >
...
</application>
Hope this will help you,in my app I have multidex and everything is working fine.

Categories

Resources