I'm trying to build my Android Studio project, but I keep getting this "Failed to resolve: com.android.support" error.
This is how the build.gradle looks like:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "app.training.linus.trainingapp"
minSdkVersion 26
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.exercise_card.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:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.google.android.gms:play-services-plus:15.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.exercise_card:runner:1.0.2'
androidTestImplementation 'com.android.support.exercise_card.espresso:espresso-core:3.0.2'
}
And the other gradle file:
// 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.1.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
}
I can't figure out why I can't build properly, I have the correct SDK version downloaded and everything.
Thanks in advance!
Removing
androidTestImplementation 'com.android.support.exercise_card:runner:1.0.2'
androidTestImplementation 'com.android.support.exercise_card.espresso:espresso-core:3.0.2'
Seems to have solved it!
Will You show me the error to know problem decently?
generally, the integration problem occur if you update your studio
reinstall the studio and connect with SDK
you should check
dependency in android studio
'dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.google.android.gms:play-services-plus:15.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.exercise_card:runner:1.0.2'
androidTestImplementation 'com.android.support.exercise_card.espresso:espresso-core:3.0.2'
}'
you need to add in the project level gradle in allprojects
maven {
url "https://maven.google.com"
}
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
google()
}
}
Related
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
I'm working on home work on Android studio, every thing was Ok, and I shut down my pc till next day, when i opened android studio i found this error message
ERROR: Could not find method implementation() for arguments [directory 'libs'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.13-beta-3'
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:26.0.0-alpha1'
// Displaying images
implementation 'com.github.bumptech.glide:glide:4.9.0'
implementation 'com.google.firebase:firebase-core:16.0.9'
// Realtime database
implementation 'com.google.firebase:firebase-database:17.0.0'
implementation 'com.android.support:support-v4:28.0.0'
}
Build file App Level :
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.appname"
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:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-vector-drawable: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'
//Add others below
}
Build file for Project Level :
buildscript {
repositories {
google()
jcenter()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
// 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
}
After having the same as above, you perform clean and then rebuild.
This error because of Glide library:
add following dependency too with glide dependency:
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
also if you are using androidx then you need to add :
annotationProcessor 'androidx.annotation:annotation:1.0.2'
Hope it will helps you.
This happens because the buildscript dependencies are outdated; update them to the current version, then it will know about implementation() and api() - or just use previous compile().
buildscript {
repositories {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
}
}
That version number always equals the version number of Android Studio; eg. build-tools 3.4.1 requires Android Studio 3.4.1 to build... updating the whole installation should automatically fix it.
I have a problem doing "Generate Signed Bundle" with information "Generate Signed Bundle: Errors while building Bundle file. You can find the errors in the 'Messages' view."
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "net.persmaeuridice.rppkurikulum2013revisi"
minSdkVersion 16
targetSdkVersion 28
versionCode 3
versionName "3.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
apply plugin: 'com.google.gms.google-services'
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
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:gridlayout-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.android.gms:play-services-ads:17.1.3'
implementation 'com.github.barteksc:android-pdf-viewer:2.8.2'
implementation 'com.firebaseui:firebase-ui:0.6.2'
implementation 'com.github.hani-momanii:SuperNova-Emoji:1.0'
implementation 'com.github.lguipeng:BubbleView:1.0.1'
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'
}
I have done many ways to find a solution to the limits of my ability, for that I need your help to solve my problem
where did I make a mistake?
// 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.2.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 {
google()
jcenter()
maven {
url "https://maven.google.com"
}
maven {url "https://jitpack.io",}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
there is a conflict between this two library
implementation 'com.google.android.gms:play-services-ads:17.1.3'
implementation 'com.firebaseui:firebase-ui:0.6.2'
try to remove if any one is not needed
I'm trying to resolve this problem looking for the similar question as mine in Stackoverflow, I have spend 6 hours and I am not able to solve it.
I've created a new project in AndroidStudio (version 3.2) and I've installed Firebase Google. One mistake appear in Gradle, I show with a image:enter image description here
The code of app gradle:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.android.estermateossaldana.cadenadefavores"
minSdkVersion 19
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.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'
implementation 'com.google.firebase:firebase-auth:16.0.1:15.0.0'
implementation 'com.google.firebase:firebase-database:16.0.1:15.0.0'
implementation 'com.google.firebase:firebase-storage:16.0.1:15.0.0'
}
The code of build gradle:
// 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.2.0'
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()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Trying to solve with the indications of you, the code is like:
Gradel Build code:
// 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.2.0'
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 {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
And the Gradle App code now is:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.android.estermateossaldana.cadenadefavores"
minSdkVersion 19
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'
implementation 'com.android.support:support-media-compat: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.firebase:firebase-database:16.0.1:15.0.0'
implementation 'com.google.firebase:firebase-auth:16.0.3:15.0.0'
implementation 'com.google.firebase:firebase-storage:16.0.1:15.0.0'
}
I show you the error in the image:enter image description here
Version of Android Studio and Gradle: enter image description here
The option of Use default gradle wrapper is checked.
-------> New screenshot: enter image description here
Try to add this to your build.gradle dependency too:
implementation 'com.android.support:support-v4:28.0.0'
So the dependencies in app/build.gradle should be:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
implementation 'com.android.support:support-v4:28.0.0' // added this
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-auth:16.0.4'
implementation 'com.google.firebase:firebase-database:16.0.3'
implementation 'com.google.firebase:firebase-storage:16.0.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'
}
Remember to check the samples and the libraries section.
i been try to add grade build on dependencies into andriod studio. its says failed to resolve. i need help...
failed to resolve com.szagurskii:patternedtextwatcher:0.5.0
implementation 'com.squareup.retrofit2:converted-gson:2.3.0'
Here my gradle build
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "my.wedee.com.wedeeapplication"
minSdkVersion 14
targetSdkVersion 27
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:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.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.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
implementation 'com.szagurskii:patternedtextwatcher:0.5.0'
implementation 'com.github.d-max:spots-dialog:0.7#aar'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converted-gson:2.3.0'
}
patternedtextwatcher is distributed via jCenter rather than Maven
https://bintray.com/zsavely/maven/patternedtextwatcher/0.5.0
Ensure you have jcenter in your project level build.gradle, something like this;
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
failed to resolve com.szagurskii:patternedtextwatcher:0.5.0
You should add below in your PROJECT LEVEL build.gradle section.
You can use SNAPSHOT
implementation 'com.szagurskii:patternedtextwatcher:0.6.0-SNAPSHOT'
Then
allprojects {
repositories {
google()
jcenter()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
}
}
Then Clean-Rebuild-Run (With Internet).