Android Studio 3.3.2 kotlin Compiler Warning - android

I am using,
Android Studio Version - 3.3.2
minSdkVersion 19
targetSdkVersion 27
Kotling plugin :
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
kotlin build file :
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
In top level build-gradle
ext.kotlin_version = '1.3.21'
classpath 'com.android.tools.build:gradle:3.3.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.2.0'
classpath 'io.fabric.tools:gradle:1.27.1'
My Issue is Its giving me Lots of Kotlin Compiler Warning.
I have not issue with this warning but I want to add,
shrinkResources true
minifyEnabled true
in my application, but due to warning this giving me an error to solve warning first.
Please see my number of warning in screen shot, and if any have having solutions of it then please give ans here.
Edit
Following is my build.gradle file
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'io.fabric'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.myapp"
minSdkVersion 19
targetSdkVersion 27
versionCode 1
versionName "10.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
debuggable false
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
debug {
debuggable true
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dexOptions {
// Prevent OutOfMemory with MultiDex during the build phase
javaMaxHeapSize "4g"
}
dataBinding {
enabled = true
}
}
kapt {
generateStubs = true
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.intuit.sdp:sdp-android:1.0.6'
implementation 'com.facebook.android:facebook-login:4.39.0'
implementation 'com.amitshekhar.android:rx2-android-networking:1.0.2'
implementation 'com.twitter.sdk.android:twitter-core:3.3.0'
implementation 'com.twitter.sdk.android:twitter:3.3.0'
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.android.gms:play-services-places:16.0.0'
implementation 'com.google.android.gms:play-services-base:16.0.1'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.8'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
implementation 'com.wang.avi:library:2.1.3'
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation project(':multipleimageselect')
implementation 'com.github.bumptech.glide:glide:4.8.0'
// location
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'id.zelory:compressor:2.1.0'
annotationProcessor 'com.android.databinding:compiler:3.1.4'
implementation project(':library_slider')
implementation 'de.hdodenhof:circleimageview:3.0.0'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'com.flurry.android:analytics:11.5.0#aar'
implementation 'com.google.android.libraries.places:places:1.0.0'
implementation 'com.google.code.findbugs:jsr305:3.0.2'
implementation 'com.braintreepayments.api:braintree:1.7.10'
}
apply plugin: 'com.google.gms.google-services'

Related

I am getting this error message at the minute and cannot workout why "java.lang.reflect.InvocationTargetException (no error message)"

This is my gradle.build file
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services' // Google Services Gradle plugin
// Apply the Crashlytics Gradle plugin
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'kotlin-android'
//apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
android {
/* signingConfigs {
config_release {
storePassword 'android123'
keyAlias = 'android'
keyPassword 'android123'
storeFile file('D:\\Jennifer\\December\\support\\cyw-user\\cyw-user\\app\\key.jks')
}
}*/
compileSdkVersion 33
defaultConfig {
applicationId "com.cyw_encrypted"
minSdkVersion 28
targetSdkVersion 33
versionCode 5
multiDexEnabled true
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
ndk.abiFilters 'arm64-v8a','x86_64' // 'armeabi-v7a','x86',
}
buildFeatures{
viewBinding = true
}
buildTypes {
debug {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
// signingConfig signingConfigs.config_release
}
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
// signingConfig signingConfigs.config_release
}
}
compileOptions {
sourceCompatibility "1.8"
targetCompatibility "1.8"
}
lint {
abortOnError false
checkReleaseBuilds false
}
}
dependencies {
implementation files('libs/jxl.jar')
implementation 'com.android.support:multidex:1.0.3'
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation platform('com.google.firebase:firebase-bom:30.4.1')
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'com.intuit.ssp:ssp-android:1.0.4'
implementation 'com.intuit.sdp:sdp-android:1.0.5'
implementation 'com.google.android.gms:play-services-location:20.0.0'
implementation 'de.hdodenhof:circleimageview:2.1.0'
//FCM============================================
implementation 'com.google.firebase:firebase-messaging-ktx:23.0.8'
implementation 'com.google.firebase:firebase-core:21.1.1'
implementation 'com.google.firebase:firebase-analytics-ktx'
//implementation 'com.google.firebase:firebase-messaging-ktx:23.0.8'
implementation 'com.google.firebase:firebase-crashlytics-ktx:18.2.13'
// socket
implementation('io.socket:socket.io-client:1.0.0') {
// excluding org.json which is provided by Android
exclude group: 'org.json', module: 'json'
}
implementation 'com.github.bumptech.glide:glide:4.9.0'
kapt 'com.github.bumptech.glide:compiler:4.9.0'
implementation 'android.arch.persistence.room:runtime:1.1.1'
kapt "android.arch.persistence.room:compiler:1.1.1"
implementation "com.squareup.retrofit2:retrofit:$rootProject.retroVersin"
implementation "com.squareup.retrofit2:converter-gson:$rootProject.retroVersin"
implementation "com.squareup.okhttp3:logging-interceptor:$rootProject.retroLoginterceptor"
implementation "com.google.dagger:dagger:2.28.3"
kapt "com.google.dagger:dagger-compiler:2.28.3"
implementation files('libs/opencsv-2.4.jar')
implementation files('libs/jxl.jar')
implementation("com.github.esafirm.android-image-picker:imagepicker:2.1.0") {
exclude group: 'com.github.bumptech.glide', module: 'glide'
}
implementation 'com.github.yesterselga:country-picker-android:1.0'
implementation 'com.ajts.androidmads.SQLite2Excel:library:1.0.4'
implementation 'com.github.tcking:giraffecompressor:0.1.4'
implementation 'com.droidninja:filepicker:2.2.1'
implementation 'com.squareup:otto:1.3.8'
implementation 'com.squareup.okhttp3:okhttp:3.11.0'
// implementation 'org.glassfish:javax.annotation:10.0-b28'
implementation 'org.greenrobot:eventbus:3.2.0'
}
kapt { correctErrorTypes true }
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
This is the error it is giving me
It wont let me build at all. I have spent the last 2 days crawling the web for answers but I cannot find one that will work. I dont know where to go from here as I cannot even build the app. This happened when I upgraded a lot of the libraries, kotlin version and gradle version, but to do all of that it had to restart android studio so I cannot press undo anymore.
Any help will be much appreciated,
Thanks,
Jack

error: cannot find symbol import android.widget.selector;

My Android Studio Build fails with this error message, after updating several dependencies. I also switched from using "dataBinding{
enabled = true
}"
to "viewBinding true" I can't find a resolution for this anywhere. I already tried cleaning, rebuilding, invalidating caches and restarting the computer multiple times. Previous suggestions to similar questions didn't resolve this either. Do i have to start a new android studio project and copy over my code?
C:\Users\seric\AndroidStudioProjects\Futlytics\app\build\generated\data_binding_base_class_source_out\debug\out\com\futlytics\databinding\ToggleStyleBinding.java:7: error: cannot find symbol
import android.widget.selector;
I dont even use anything called ToggleStyleBinding.
My gradle files look like this:
Module
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
//apply plugin: 'kotlin-android-extensions'
apply plugin: "androidx.navigation.safeargs.kotlin"
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 30
buildToolsVersion "30.0.0"
defaultConfig {
applicationId "com.futlytics"
minSdkVersion 22
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
/*dataBinding{
enabled = true
}*/
buildFeatures {
mlModelBinding true
viewBinding true
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
//implementation 'androidx.navigation:navigation-fragment:2.3.4'
//implementation 'androidx.navigation:navigation-ui:2.3.4'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.4'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.4'
implementation 'org.tensorflow:tensorflow-lite-support:0.1.0-rc1'
implementation 'org.tensorflow:tensorflow-lite-metadata:0.1.0-rc1'
implementation 'org.tensorflow:tensorflow-lite-gpu:2.2.0'
implementation 'com.google.firebase:firebase-auth:20.0.3'
implementation 'com.google.android.gms:play-services-auth:19.0.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
implementation 'com.google.android.gms:play-services-vision:20.1.3'
implementation 'com.google.android.gms:play-services-mlkit-text-recognition:16.1.3'
implementation 'androidx.preference:preference-ktx:1.1.1'
// CameraX
implementation "androidx.camera:camera-camera2:1.1.0-alpha03"
implementation "androidx.camera:camera-lifecycle:1.1.0-alpha03"
implementation "androidx.camera:camera-view:1.0.0-alpha23"
//Firebase
implementation platform('com.google.firebase:firebase-bom:26.7.0')
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.google.firebase:firebase-firestore-ktx'
implementation 'com.google.firebase:firebase-auth-ktx:20.0.3'
}
Projectapply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
//apply plugin: 'kotlin-android-extensions'
apply plugin: "androidx.navigation.safeargs.kotlin"
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 30
buildToolsVersion "30.0.0"
defaultConfig {
applicationId "com.futlytics"
minSdkVersion 22
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
/*dataBinding{
enabled = true
}*/
buildFeatures {
mlModelBinding true
viewBinding true
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
//implementation 'androidx.navigation:navigation-fragment:2.3.4'
//implementation 'androidx.navigation:navigation-ui:2.3.4'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.4'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.4'
implementation 'org.tensorflow:tensorflow-lite-support:0.1.0-rc1'
implementation 'org.tensorflow:tensorflow-lite-metadata:0.1.0-rc1'
implementation 'org.tensorflow:tensorflow-lite-gpu:2.2.0'
implementation 'com.google.firebase:firebase-auth:20.0.3'
implementation 'com.google.android.gms:play-services-auth:19.0.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
implementation 'com.google.android.gms:play-services-vision:20.1.3'
implementation 'com.google.android.gms:play-services-mlkit-text-recognition:16.1.3'
implementation 'androidx.preference:preference-ktx:1.1.1'
// CameraX
implementation "androidx.camera:camera-camera2:1.1.0-alpha03"
implementation "androidx.camera:camera-lifecycle:1.1.0-alpha03"
implementation "androidx.camera:camera-view:1.0.0-alpha23"
//Firebase
implementation platform('com.google.firebase:firebase-bom:26.7.0')
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.google.firebase:firebase-firestore-ktx'
implementation 'com.google.firebase:firebase-auth-ktx:20.0.3'
}
Project
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.4.31"
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.3.4"
classpath 'com.google.gms:google-services:4.3.5'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I had this issue when accidentally placed xml with <selector> to "layout" folder (instead of "drawable"). Android Studio then tries to make a Binding for it as for layout.
build.gradle(:app) -> just change TRUE to FALSE. (idk what viewBiding does, but my quite advanced app works (again) without error)
buildFeatures {
viewBinding false
}

Debug app working but release app not working?

Is there any changes that i want to do in gradle file to work the release app properly. I have recently shifted from normal app to androidx. When i have debug the app and run in my phone it's working properly but when i have installed the release app the it's not working so how to fix it ? When i have move my app to android-x then it has requesting me to change the setShiftingMode(false) to setShifting(false) the problem has been occured due to this or not. How i can fix the above issue ?
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/'}
}
dependencies {
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.8, 0.99.99]'
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
defaultConfig {
applicationId "com.example.demo"
manifestPlaceholders = [onesignal_app_id : "fa5f9ac7-sdfdf-dfdf-exampleid-6f",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "REMOTE"]
minSdkVersion 19
targetSdkVersion 29
versionCode 5
versionName "5.1.11"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
multiDexEnabled true
}
android {
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
debuggable false
shrinkResources true
minifyEnabled true
useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
implementation 'com.squareup.okhttp3:okhttp-urlconnection:3.10.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'com.jakewharton:butterknife:10.0.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0'
implementation 'com.github.clans:fab:1.6.4'
implementation 'com.devbrackets.android:exomedia:4.2.1'
implementation 'com.daimajia.numberprogressbar:library:1.4#aar'
debugImplementation 'com.amitshekhar.android:debug-db:1.0.3'
implementation 'com.miguelcatalan:materialsearchview:1.4.0'
implementation project(':library')
implementation('com.github.afollestad.material-dialogs:core:0.8.5.1#aar') {
transitive = true
}
implementation 'org.jsoup:jsoup:1.11.1'
implementation 'com.github.faruktoptas:FancyShowCaseView:1.0.1'
implementation 'com.onesignal:OneSignal:[3.15.0, 3.99.99]'
implementation 'com.google.android.gms:play-services-ads:19.3.0'
implementation 'com.google.firebase:firebase-core:17.4.4'
implementation 'com.loopj.android:android-async-http:1.4.9'
implementation 'io.branch.sdk.android:library:2.+'
implementation project(':jiaozivideoplayer')
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'

Latest firebase sdk will keep causing crash to app

I'm trying to add following dependencies in build.gradle -
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
But app will keep crashing with following message -
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/util/zzq;
If i'm going to remove firebase from here then the crash will go away. I have tried with firebase version 16.0.6 too but still it will keep crashing.
Following is my app level build.gradle -
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
//apply plugin: 'io.fabric'
android {
compileSdkVersion 28
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
checkReleaseBuilds false
}
defaultConfig {
minSdkVersion 22
targetSdkVersion 28
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
}
repositories {
maven {
url "https://github.com/QuickBlox/quickblox-android-sdk-releases/raw/master/"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:design:28.0.0-rc01'
implementation 'com.android.support:support-vector-drawable:28.0.0-rc02'
implementation 'com.android.support:support-v4:28.0.0-rc02'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'androidx.appcompat:appcompat:1.0.0-alpha1'
implementation 'androidx.slice:slice-core:1.0.0-alpha1'
implementation 'androidx.slice:slice-builders:1.0.0-alpha1'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support:recyclerview-v7:28.0.0-alpha1'
implementation 'com.google.firebase:firebase-core:16.0.5'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
// implementation 'com.crashlytics.sdk.android:crashlytics:2.9.8'
}
Following is my project level build.gradle -
buildscript {
ext.kotlin_version = '1.2.60'
repositories {
google()
jcenter()
maven {
url "https://github.com/QuickBlox/quickblox-android-sdk-releases/raw/master/"
}
maven { url 'https://jitpack.io' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0-rc02'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.2.0'
}
}
allprojects {
repositories {
google()
jcenter()
maven {
url "https://github.com/QuickBlox/quickblox-android-sdk-releases/raw/master/"
}
maven { url 'https://jitpack.io' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
You should update your dependencies in app gradle file like:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
//apply plugin: 'io.fabric'
android {
compileSdkVersion 28
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
checkReleaseBuilds false
}
defaultConfig {
minSdkVersion 22
targetSdkVersion 28
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
}
repositories {
maven {
url "https://github.com/QuickBlox/quickblox-android-sdk-releases/raw/master/"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-vector-drawable:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.slice:slice-core:1.0.0'
implementation 'androidx.slice:slice-builders:1.0.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
// implementation 'com.crashlytics.sdk.android:crashlytics:2.9.8'
}
And project gradle:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
//apply plugin: 'io.fabric'
android {
compileSdkVersion 28
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
checkReleaseBuilds false
}
defaultConfig {
minSdkVersion 22
targetSdkVersion 28
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
}
repositories {
maven {
url "https://github.com/QuickBlox/quickblox-android-sdk-releases/raw/master/"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-vector-drawable:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.slice:slice-core:1.0.0'
implementation 'androidx.slice:slice-builders:1.0.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
// implementation 'com.crashlytics.sdk.android:crashlytics:2.9.8'
}
Hope this help you!
you'd have to add apply plugin: "com.google.gms.google-services" at the bottom of the module level's build.gradle (so that the values of google-services.json will be applied to the resources; this file can be downloaded from the Firebase console). most likely, you'd also have to add implementation "com.google.android.gms:play-services-base:16.1.0" to the dependencies, in order to provide that one missing class.
and there are also duplicate com.android.support vs. androidx dependencies; for example:
// implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'androidx.appcompat:appcompat:1.0.2'
...even if it won't throw NoClassDefFoundError, there will be duplicates unless these are fixed. better first fully migrate to androidx and then try to fix the issue with Play Services; because while being right within the half-done process of refactoring, it is rather difficult to attribute an issue to something.

resource style/Widget.Design.CoordinatorLayout not found after updating to API 28

Today I updated my project from API 27 to API 28. Before the update I was not getting any error. I am getting the below error while building the gradle after changing the compileSdkVersion and buildVersion. I am using Kotlin as my primary programming language for the project. This is the error:
Execution failed for task ':app:processReleaseResources'.
> Android resource linking failed
Output: /Users/sagarsuri/Downloads/MyProject/app/build/intermediates/incremental/mergeReleaseResources/merged.dir/values/values.xml:2778: error: resource style/Widget.Design.CoordinatorLayout (aka com.sagar.myproject:style/Widget.Design.CoordinatorLayout) not found.
/Users/sagarsuri/Downloads/MyProject/app/build/intermediates/incremental/mergeReleaseResources/merged.dir/values/values.xml:4480: error: resource style/Widget.Design.CoordinatorLayout (aka com.sagar.myproject:style/Widget.Design.CoordinatorLayout) not found.
error: failed linking references.
This is my app module build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'io.objectbox'
androidExtensions {
experimental = true
}
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.sagar.myproject"
minSdkVersion 21
targetSdkVersion 27
// Enabling multidex support.
multiDexEnabled true
versionCode 11
versionName "2.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
debug {
minifyEnabled false
shrinkResources false
useProguard false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
release {
minifyEnabled true
shrinkResources true
useProguard true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
buildToolsVersion '28.0.2'
}
ext {
supportLibraryVersion = '28.0.0'
glideLibraryVersion = '4.6.1'
retrofitLibraryVersion = '2.4.0'
rxJavaVersion = '2.1.0'
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "com.android.support:appcompat-v7:$supportLibraryVersion"
implementation "com.android.support:cardview-v7:$supportLibraryVersion"
implementation "com.android.support:support-v4:$supportLibraryVersion"
implementation "com.android.support:support-v13:$supportLibraryVersion"
implementation "com.android.support:design:$supportLibraryVersion"
implementation "com.android.support:recyclerview-v7:$supportLibraryVersion"
//Glide library
implementation "com.github.bumptech.glide:glide:$glideLibraryVersion"
kapt "com.github.bumptech.glide:compiler:$glideLibraryVersion"
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
//Retrofit
implementation "com.squareup.retrofit2:retrofit:$retrofitLibraryVersion"
implementation "com.squareup.retrofit2:converter-gson:$retrofitLibraryVersion"
implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofitLibraryVersion"
//RxJava
implementation "io.reactivex.rxjava2:rxandroid:$rxJavaVersion"
//ObjectBox
implementation "io.objectbox:objectbox-android:$objectboxVersion"
implementation "io.objectbox:objectbox-kotlin:$objectboxVersion"
kapt "io.objectbox:objectbox-processor:$objectboxVersion"
//MaterialDialog
implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
//ReactiveNetwork
implementation 'com.github.pwittchen:reactivenetwork-rx2:0.12.3'
//MultiDex
implementation 'com.android.support:multidex:1.0.3'
//Fotoapparat
implementation 'io.fotoapparat.fotoapparat:library:2.2.0'
//ChartView
implementation 'com.github.razerdp:AnimatedPieView:1.2.4'
implementation 'com.leinardi.android:speed-dial:2.0.0'
implementation 'com.google.android.gms:play-services-auth:16.0.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'me.shaohui.advancedluban:library:1.3.5'
implementation 'com.github.antonKozyriatskyi:CircularProgressIndicator:1.0.5'
testImplementation 'junit:junit:4.12'
// implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
Please let me the know what is causing the error. The version of Android Studio is 3.2
Did you try this answer on SO? It helped me. I have multimodule project. You need to replace
style/Widget.Design.CoordinatorLayout
with
#style/Widget.Support.CoordinatorLayout
In all your styles.xml files. This issue happened with me when I tried to migrate on AndroidX (not only updated to API 28)

Categories

Resources