Failed to resolve: recyclerview - android

While adding dependency implementation 'com.android.support:recyclerview-v7:28.0.0' to my project, Android Studio throws exception ERROR: Failed to resolve: recyclerview. Then I tried adding dependency for recyclerview. Still getting same error.
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.itook.myapplication"
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.background.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0'
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.10'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.github.florent37:bubbletab:1.0.2'
implementation 'com.android.support:design:28.0.0'
implementation 'junit:junit:4.12'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.ss.bannerslider:bannerslider:1.8.0'
implementation 'com.github.hamsaadev:Persian-Date-Picker-Dialog:V1.2'
implementation 'com.anton46:stepsview:0.0.2'
implementation 'pub.devrel:easypermissions:2.0.1'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.zarinpal:purchase:0.0.8-beta'
implementation 'com.github.bumptech.glide:glide:3.7.0'
}

Try this
implementation 'androidx.recyclerview:recyclerview:1.1.0'

Your project migrated to android x
Use this:
implementation 'com.google.android.material:material:1.0.0'
Instead of
implementation 'com.android.support:design:28.0.0'
Then you don't have to implmenet different library of Design. It will add all library.

Related

error: cannot find symbol class Observer while implementing observers

Am working with an MVVM design pattern ,implementing Observers and things. but all of the sudden Observer Class not found.
error: cannot find symbol class Observer
I have tried
Rebuilding project
clean project
Invalidate/caches & restart
But still no Improvement
here is my gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
dataBinding{
enabled=true
}
defaultConfig {
applicationId "com.istrides.petool"
minSdkVersion 17
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
// implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
testImplementation 'junit:junit:4.12'
compile project(':horizontalcalendar')
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.17'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
implementation 'com.synnapps:carouselview:0.1.5'
implementation 'com.github.bumptech.glide:glide:4.9.0'
implementation 'com.google.android.libraries.places:places:2.0.0'
implementation 'com.facebook.shimmer:shimmer:0.1.0#aar'
//mvvm
def lifecycle_version = "2.1.0"
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
annotationProcessor "androidx.lifecycle:lifecycle-compiler:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-livedata:$lifecycle_version"
//retrofit
implementation 'com.squareup.retrofit2:retrofit:2.6.1'
implementation 'com.squareup.okhttp3:logging-interceptor:3.9.1'
implementation 'com.squareup.retrofit2:converter-gson:2.6.2'
}
Please try adding these libraries in build.gradle
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel:2.1.0'

Failed to transform file 'library-1.2.0.aar' to match attributes {artifactType=processed-aar} using transform JetifyTransform

I am migrating my existing project to Androidx . After adding this 2 line
android.useAndroidX=true
android.enableJetifier=true
in gradle.properties , I get a bunch of compile error . I found many solution but nothing worked for me . Please help me out.Thanks
gradle(app-level)
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.faridabadtaxirider"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
buildToolsVersion '28.0.3'
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.0.0-beta01'
implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
//Add library
implementation 'com.github.aarsy.googlemapsanimations:googlemapsanimations:1.0.5'
implementation 'com.facebook.android:account-kit-sdk:4.29.0'
implementation 'io.paperdb:paperdb:2.6'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'me.zhanghai.android.materialratingbar:library:1.2.0'
implementation 'com.google.maps.android:android-maps-utils:0.5+'
implementation 'com.google.firebase:firebase-messaging:19.0.1'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.3.0'
implementation 'com.github.glomadrian:MaterialAnimatedSwitch:1.1#aar'
implementation 'com.firebase:geofire-android:2.1.2'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'com.google.android.gms:play-services-places:17.0.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.gms:play-services-auth:17.0.0'//Fix crash account kit
implementation 'com.github.d-max:spots-dialog:1.1#aar'
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
implementation 'com.google.firebase:firebase-core:17.0.1'
implementation 'com.google.firebase:firebase-database:18.0.1'
implementation 'com.google.firebase:firebase-storage:18.1.1'
implementation 'com.google.android.material:material:1.0.0-beta01'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
implementation 'androidx.cardview:cardview:1.0.0-beta01'
implementation 'com.google.android.libraries.places:places:1.1.0'
implementation 'com.google.code.gson:gson:2.8.5'
}
apply plugin: 'com.google.gms.google-services'
Seems like 'me.zhanghai.android.materialratingbar:library:1.2.0' is not compatible with AndroidX. Try to use the latest version of that lib.

unable to merge dex android studio

This is my Gradle file and it gives unable to merge dex error and cant run my app can any one solve it please???????I'm trying to run my project, but for some reason it gives me that error
Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'. com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.ahmed.farid.gonerve"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
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'
//Design library for Coordinator Layout and Toolbars
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
//BottomNavigationViewEx library
implementation 'com.github.ittianyu:BottomNavigationViewEx:1.2.4'
//Circle ImageView
implementation 'de.hdodenhof:circleimageview:2.1.0'
//Universal image loader
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
implementation 'com.github.danylovolokh:video-player-manager:0.2.0'
implementation 'com.google.code.findbugs:jsr305:2.0.1'
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
implementation 'com.firebase:geofire-android:2.1.1'
implementation 'com.github.glomadrian:MaterialAnimatedSwitch:1.1#aar'
//Design library for Coordinator Layout and Toolbars
//BottomNavigationViewEx library
implementation'com.android.support:cardview-v7:27.1.1'
implementation 'com.google.guava:guava:27.0-android'
//noinspection GradleCompatible
//firebase
implementation 'com.google.firebase:firebase-core:11.0.2'
//firebase auth
implementation 'com.google.firebase:firebase-auth:11.0.2'
implementation 'com.google.firebase:firebase-database:11.0.2'
implementation 'com.google.firebase:firebase-storage:11.0.2'
implementation 'com.google.android.gms:play-services-location:11.0.2'
implementation 'com.google.android.gms:play-services-maps:11.0.2'
implementation 'com.google.android.gms:play-services:11.0.2'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'com.android.support:recyclerview-v7:27.1.1'
}
apply plugin: 'com.google.gms.google-services'
Try this in
android/build.gradle
android {
defaultConfig {
multiDexEnabled true
}
}

android studio : creating two of my application while debugging or building

my App suddenly started to build another app on my phone with the real one ..
and the two are opening the same app
and when i remove one the other is removed also
so what is the problem
why its doing this
even after i made a release from it ..
its generating two versions .. two apps
and this is my gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
vectorDrawables.useSupportLibrary = true
applicationId "app.example.example"
minSdkVersion 17
targetSdkVersion 28
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
// implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:customtabs:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:exifinterface:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation "androidx.constraintlayout:constraintlayout:1.1.3"
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 'com.android.support:multidex:1.0.3'
// Butter Knife
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
// Circle ImageView
implementation 'de.hdodenhof:circleimageview:2.2.0'
// ImageCropping
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.+'
// https://github.com/ArthurHub/Android-Image-Cropper
// EasyPermissions
implementation 'pub.devrel:easypermissions:1.2.0'
// https://github.com/googlesamples/easypermissions
// FireBase
implementation 'com.firebaseui:firebase-ui-firestore:4.0.0'
implementation 'com.firebaseui:firebase-ui-auth:4.0.0'
implementation 'com.firebaseui:firebase-ui-storage:4.0.0'
implementation 'com.google.firebase:firebase-messaging:17.0.0'
implementation 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.facebook.android:facebook-login:[4,5)'
implementation 'id.zelory:compressor:2.1.0'
// fonts to all app
implementation 'uk.co.chrisjenx:calligraphy:2.2.0'
// Glide
implementation 'com.github.bumptech.glide:glide:4.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
// https://github.com/bumptech/glide
implementation('com.mikepenz:materialdrawer:5.9.5#aar') {
transitive = true
exclude group: 'com.android.support'
}
implementation 'com.github.ganfra:material-spinner:2.0.0'
implementation 'com.github.aakira:expandable-layout:1.6.0#aar'
implementation "commons-io:commons-io:+"
}
apply plugin: 'com.google.gms.google-services'
Double check your AndroidManifest.xml file for two main activities. Typically an app will only have one activity with an intent filter with a main action and launcher category.

Getting this update when trying to update proile pic firebaseAuth on Android

I keep getting the same error and the app stops working when I try and select an image to upload for user using google firease firebaseAuth on android. Here is the error I keep getting: Caused by:
java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.internal.zzbq"
gradle build is as follows :
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.dissertation.studentscanner"
minSdkVersion 23
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
configurations.all {
resolutionStrategy {
force 'com.android.support:support-annotations:26.1.0'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:design:26.1.0'
implementation 'com.google.firebase:firebase-storage:11.8.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 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-firestore:17.0.3'
implementation 'com.google.firebase:firebase-crash:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com.firebaseui:firebase-ui-auth:3.3.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'me.dm7.barcodescanner:zxing:1.9'
implementation 'com.github.bumptech.glide:glide:4.7.1'
implementation 'com.google.firebase:firebase-ml-vision:16.0.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
}
apply plugin: 'com.google.gms.google-services'
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
To solve this, please change the following lines of code:
implementation 'com.google.firebase:firebase-storage:11.8.0'
implementation 'com.google.firebase:firebase-firestore:17.0.3'
implementation 'com.firebaseui:firebase-ui-auth:3.3.0'
to
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.google.firebase:firebase-firestore:17.0.4'
implementation 'com.firebaseui:firebase-ui-auth:4.1.0'
Don't also forget to add in your top level build.gradle file, the following Google Service plugin:
classpath 'com.google.gms:google-services:4.0.2'

Categories

Resources