Could not find cardview.jar (androidx.cardview:cardview:1.0.0) - android

My project worked fine but today when I opened that, that has this error, although I didn't use any cardview. My other project build fine but only that project doesn't build.
Could not find cardview.jar (androidx.cardview:cardview:1.0.0).
my class path is: classpath 'com.android.tools.build:gradle:3.5.1'
I have added cardview library manually but it didn't work too.
I have added
maven {
url "https://maven.google.com"
}
but it didn't work too.
I have added cardview library manually but it didn't work too.
this is my gradle code project level
buildscript {
repositories {
google()
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
// 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' }
maven {
url "https://maven.google.com"
}
maven { url 'https://maven.fabric.io/public' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
and this is my gradle code app level
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.intechdev.tcommerce"
minSdkVersion 21
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.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'io.reactivex.rxjava2:rxjava:2.1.9'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
implementation 'com.squareup.retrofit2:retrofit:2.6.2'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'androidx.exifinterface:exifinterface:1.0.0'
implementation 'com.github.tiper:MaterialSpinner:1.3.3'
implementation 'de.hdodenhof:circleimageview:3.0.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.2.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
implementation 'com.mikhaellopez:circularimageview:4.0.2'
implementation "androidx.preference:preference:1.1.0"
implementation 'com.android.support:multidex:1.0.3'
implementation "com.github.bumptech.glide:glide:4.9.0"
implementation 'com.iarcuschin:simpleratingbar:0.1.5'
annotationProcessor "com.github.bumptech.glide:compiler:4.9.0"
implementation "com.github.firdausmaulan:GlideSlider:1.5.1"
api 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
implementation 'com.justkiddingbaby:vercodeedittext:1.1.0'
implementation 'com.google.android.material:material:1.1.0-beta01'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

Just remove
implementation "com.github.firdausmaulan:GlideSlider:1.5.1"
and use another slider library.

you didn't add the CardView library.
add this to your dependencies in a new line:
implementation 'androidx.cardview:cardview:1.0.0'
and then sync your Gradle files it should solve the problem.

The Gradle version is not compatible with your Android Studio version.
In this section, upgrade your Gradle version
File > ProjectStructure > Project

Related

Android studio could not resolve retrofit2 converter scalars 2.5.0

Android studio displays this strange error whenever I add some dependency to the grade file. It was working perfectly earlier. Further it displays no cached version of retrofit2 scalars available for offline mode.
Currently I tried almost all options from uninstalling and reinstalling android studio but no luck. I am running out of time so please help me resolve this.
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.example.protabler"
minSdkVersion 23
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.navigation:navigation-fragment:2.0.0'
implementation 'androidx.navigation:navigation-ui:2.0.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
implementation 'androidx.preference:preference:1.1.0-alpha05'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation "androidx.cardview:cardview:1.0.0"
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.5.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'de.hdodenhof:circleimageview:3.0.1'
}
// 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.5.3'
// 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
}

Error:Could not find: vectordrawable-animated-1.1.0

I have a problem with gradle. it was working fine but all of sudden when I was rebuilding the project it gives me this error:
Could not find vectordrawable-animated-1.1.0.jar (androidx.vectordrawable:vectordrawable-animated:1.1.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/androidx/vectordrawable/vectordrawable-animated/1.1.0/vectordrawable-animated-1.1.0.jar
I can't find out what my problem is?
My app.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 30
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.example.pakagename"
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
defaultConfig {
vectorDrawables.useSupportLibrary = true
}
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.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'de.hdodenhof:circleimageview:3.1.0'
implementation 'com.airbnb.android:lottie:3.4.1'
//noinspection GradleCompatible
implementation 'com.android.support:design:28.0.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.loopj.android:android-async-http:1.4.10'
implementation 'com.github.mreram:showcaseview:1.1'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.github.dhaval2404:imagepicker-support:1.5'
implementation 'com.github.aliab:Persian-Date-Picker-Dialog:1.5.2'
implementation 'com.wang.avi:library:2.1.3'
implementation 'com.github.mukeshsolanki:android-otpview-pinview:2.1.0'
implementation 'com.github.smarteist:autoimageslider:1.3.7-appcompat'
implementation 'com.wang.avi:library:2.1.3'
implementation 'com.android.support:design:28.0.0'
implementation 'com.github.jaiselrahman:FilePicker:1.3.2'
implementation 'ir.he.meowdatetimepicker:library:1.0.2'
implementation 'cat.ereza:customactivityoncrash:2.3.0'
}
and my build.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:4.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
maven { url 'https://maven.google.com' }
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
allprojects {
repositories {
maven { url 'https://jitpack.io' }
maven { url 'https://dl.bintray.com/tapsellorg/maven' }
}
}
I guess this is due to not proper download of packages (sanctions and ...).
I did following steps and worked:
Connect to VPN
Remove caches and deamons folder from ~/.gradle.
Run gradlew clean inside android folder (cleaned project gradle).
Re run the project
first remove it from you library dependency
and download aar file from below link:
https://mvnrepository.com/artifact/androidx.vectordrawable/vectordrawable-animated/1.1.0

How to resolve 'com.github.d-max:spots-dialog:0.7#aar'

I have done all the solution but none of them worked. Whenever I add this library in my project. I face error like
unable to resolve this library (disable offline work option)).
After disabling it, the error come
No cached version available in offline mode(Enable offline work option)).
How I resolve it pls help
This is my gradle file(module app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.amazone_ecommerce"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
api 'com.google.firebase:firebase-messaging:17.4.0'
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.1.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.google.firebase:firebase-core:16.0.7'
implementation 'com.google.firebase:firebase-database:16.1.0'
implementation 'com.github.jd-alexander:android-flat-button:v1.1'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'io.paperdb:paperdb:2.1'
implementation 'com.github.rey5137:material:1.2.4'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.firebaseui:firebase-ui-database:1.2.0'
implementation 'com.squareup.picasso:picasso:2.3.2'
implementation 'com.cepheuen.elegant-number-button:lib:1.0.2'
implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
implementation 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
implementation 'com.github.mancj:MaterialSearchBar:0.7.1'
implementation 'com.stepstone.apprating:app-rating:2.0.0'
implementation 'com.squareup.retrofit2:retrofit-converters:2.5.0'
implementation 'com.squareup.retrofit2:converter-gson:2.5.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'
}
apply plugin: 'com.google.gms.google-services'
This is my gradle file(root level)
// 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.3.1'
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
}
}
allprojects {
repositories {
maven { url 'https://jitpack.io' }
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
You should try this as it's stated in the documentation:
dependencies {
implementation 'com.github.d-max:spots-dialog:1.1#aar'
}
That's a newer version of the lib. I think this should solve your problem.
Best

Firebase Fatal Exception: java.lang.NoSuchFieldError

I'm using firebase UI-Auth for authentication but after adding analytics dependency I'm getting this error. The app crashes after some time being idle. Sometimes it crashes at the initial start up after restarting it couple of times it runs fine. I have also updated all the libraries to their latest versions but this also doesn't help.
Fatal Exception: java.lang.NoSuchFieldError No field
PREFER_HIGHEST_OR_REMOTE_VERSION_NO_FORCE_STAGING of type
Lcom/google/android/gms/dynamite/DynamiteModule$VersionPolicy; in
class Lcom/google/android/gms/dynamite/DynamiteModule; or its
superclasses (declaration of
'com.google.android.gms.dynamite.DynamiteModule' appears in base.apk)
This is my build.gradle
import com.google.gms.googleservices.GoogleServicesPlugin
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.26.1'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.hussain.podcastapp"
minSdkVersion 23
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.jakewharton:butterknife:9.0.0-SNAPSHOT'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.github.devlight.navigationtabstrip:navigationtabstrip:1.0.4'
implementation 'com.squareup.retrofit2:converter-simplexml:2.3.0'
implementation 'com.github.florent37:glidepalette:2.1.2'
implementation 'androidx.palette:palette:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.airbnb.android:lottie:2.6.1'
implementation "com.mikepenz:materialdrawer:6.0.9"
implementation 'com.google.android.exoplayer:exoplayer-core:2.8.1'
implementation 'com.google.android.exoplayer:exoplayer-dash:2.8.0'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.8.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.github.bumptech.glide:glide:4.8.0'
implementation 'com.firebase:firebase-jobdispatcher:0.8.5'
implementation 'com.firebaseui:firebase-ui-auth:4.1.0'
implementation 'com.google.firebase:firebase-database:16.0.3'
implementation 'androidx.room:room-runtime:2.0.0'
annotationProcessor 'androidx.room:room-compiler:2.0.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-SNAPSHOT'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0-beta02'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-beta02'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.google.android.gms:play-services-ads:17.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
implementation 'com.crashlytics.sdk.android:answers:1.4.3'
}
apply plugin: 'com.google.gms.google-services'
GoogleServicesPlugin.config.disableVersionCheck = true
This is my project level build.gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

android studio Multiple dex files define Lcom/google/common/reflect/Types$WildcardTypeImpl;

I use firebase database, storage, auth and google cloud vision.
I got this error
Multiple dex files define Lcom/google/common/reflect/Types$WildcardTypeImpl;
I think that this project gradle conflicts
this is my gradle(Module:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "*************************"
minSdkVersion 19
targetSdkVersion 27
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
buildTypes.each {
it.buildConfigField 'String', 'API_KEY', '"**********************"'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
implementation 'com.google.api-client:google-api-client-android:1.23.0' exclude module: 'httpclient'
implementation 'com.google.http-client:google-http-client-gson:1.23.0' exclude module: 'httpclient'
implementation 'com.google.apis:google-api-services-vision:v1-rev369-1.23.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:appcompat-v7:27.1.1'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:animated-vector-drawable:27.1.1'
implementation 'com.android.support:support-media-compat:27.1.0'
implementation 'com.github.bumptech.glide:glide:4.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
implementation 'com.firebaseui:firebase-ui-storage:3.2.2'
implementation 'com.jaredrummler:colorpicker:1.0.1'
implementation 'com.android.support:multidex:1.0.3'
//firebase 구글 로그인 원래 16.0.2
implementation 'com.google.android.gms:play-services-auth:16.0.0'
// ++++++++ 2018.11.08 ++++++++
implementation 'com.android.support:design:27.1.1'
implementation 'com.firebaseui:firebase-ui-database:0.6.2'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'org.parceler:parceler-api:1.1.11'
annotationProcessor 'org.parceler:parceler:1.1.11'
//////////
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-database:16.0.3'
implementation 'com.google.firebase:firebase-firestore:17.1.1'
implementation 'com.google.firebase:firebase-storage:16.0.3'
implementation 'com.google.firebase:firebase-auth:16.0.4'
implementation 'com.google.firebase:firebase-messaging:17.3.3'
implementation 'com.google.firebase:firebase-config:16.0.1'
implementation 'com.google.firebase:firebase-invites:16.0.4'
implementation 'com.google.firebase:firebase-ads:16.0.1'
implementation 'com.google.firebase:firebase-appindexing:16.0.2'
implementation 'com.google.firebase:firebase-perf:16.1.2'
implementation 'com.google.firebase:firebase-functions:16.1.1'
implementation 'com.google.firebase:firebase-ml-vision:17.0.1'
implementation 'com.google.firebase:firebase-ml-model-interpreter:16.2.2'
}
apply plugin: 'com.google.gms.google-services'
this is my gradle(Project)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
// classpath 'com.android.tools.build:gradle:2.2.3'
// classpath 'com.google.gms:google-services:3.1.0'
classpath 'com.android.tools.build:gradle:3.0.1'
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 {
google()
jcenter()
mavenCentral()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
What can I do? ;(
I think gradle has some problems, but I dont' know what to do.
I put almost all codes found from googling
Help me :(
FirebaseUI has transistive dependencies on Firebase and Google Play libraries. It's important to specify a compatible set of libraries in your build.
You are using the most recent versions of the Firebase libraries, but very old versions of FirbaseUI. As a first step, make these changes to use a compatible version of FirebaseUI:
implementation 'com.firebaseui:firebase-ui-storage:4.2.1'
...
implementation 'com.firebaseui:firebase-ui-database:4.2.1'

Categories

Resources