I cant add any library - android-studio

when I try to add any library then I have simple this error:
Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve androidx.recyclerview:recyclerview:1.2.0.
Show Details
Affected Modules: app
I only add a RecyclerView.
my gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.abbasmehdipur.myapplication"
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.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.recyclerview:recyclerview:1.2.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}

finally I found problem!!! just a bad proxy setting.

Related

Dependencies using groupId com.android.support and androidx.* can not be combined

i synced my project, then i got those error, my manifest code is:
android {
compileSdkVersion 28
defaultConfig {
applicationId "chtaibi.yahya.footballcards"
minSdkVersion 15
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(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
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'
implementation 'com.google.android.gms:play-services-ads:18.1.1'
}
Can you help me please?
***** It looks like your post is mostly code; please add some more details.
You can migrate an existing project to AndroidX by selecting Refactor > Migrate to AndroidX from the menu bar.
AndroidX replaces the original support library APIs with packages in
the androidx namespace. Only the package and Maven artifact names
changed; class, method, and field names did not change.
Upgrade version
compileSdkVersion 29
defaultConfig {
targetSdkVersion 29
buildToolsVersion '29.0.2'
}
Your dependencies will
implementation 'com.google.android.material:material:1.2.0-alpha03'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'

Failed to resolve: com.google.android.gms:play-services-clearcut:12.0.1

when I implement google places dependency and sync the Gradle file then it shows an error
Failed to resolve: com.google.android.gms:play-services-clearcut:12.0.1
App-level build. Gradle file
apply plugin : 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.hatimtekri.googlemap"
minSdkVersion 22
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
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:28.0.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
//noinspection UseOfBundledGooglePlayServices
implementation 'com.google.android.gms:play-services:12.0.1'
implementation 'com.google.android.libraries.places:places:2.0.0'
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'
}
dependency
implementation 'com.google.android.libraries.places:places:2.0.0'
please please solve this error

Failed to load AppCompat ActionBar with unknown error. Tip: Try to refresh the layout

I looked for already asked question but they was on older version of android studio and they doesn't work. As you can see I don;t have buildToolsVersion,compile and classpath
.My gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.illuminat.button"
minSdkVersion 22
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
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'
}
Open app Build.gradle file.
In dependencies replace: 'com.android.support:appcompat-v7:28.0.0-alpha3'by
'com.android.support:appcompat-v7:28.0.0-alpha1'
Clic en Sync.
In res/values/style.xml change style tag to

unable to find attribute constraintSet

I had this error after I accidentally deleted something on a .debug file.
Error:In ConstraintLayout_Layout, unable to find attribute layout_constraintBaseline_creator
Error:In ConstraintSet, unable to find attribute layout_constraintBaseline_creator
Here is my build.gradle code
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "myapp.project.com.myapp"
minSdkVersion 19
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'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
Do you have an idea how to fix this error? This error has not been removed even if I pull a new project from git. Thank you in advance.

Why is it giving an error cause compileSdkVersion is not specified in android studio?

apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.debu.mrsarkar.bangalighyam"
minSdkVersion 21
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'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.firebase:firebase-core:11.8.0'
implementation 'com.google.firebase:firebase-storage:11.8.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.squareup.okhttp:okhttp:2.7.2'
testImplementation 'junit:junit:4.12'
implementation 'com.firebaseui:firebase-ui-database:3.1.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
compile 'com.google.android.gms:play-services-basement:11.8.0'
compile 'com.google.android.gms:play-services-auth:11.8.0'
compile 'com.android.support:recyclerview-v7:26.1.0'
compile 'com.android.support:support-vector-drawable:26.1.0'
}
apply plugin: 'com.google.gms.google-services'
Please see bottom left side. The error is showing again and again.
Please help me in solving the error.Please!!

Resources