Im currently using Android Studio 3.0 i just created project on it the gradle offline work is already disabled and it says
Error:Unable to resolve dependency for
':app#debugAndroidTest/compileClasspath': Could not resolve
com.android.support:appcompat-v7:26.0.0-beta1.
Open File<br>Show Details
screen shot
Buid Gradle app
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.ivan.notification"
minSdkVersion 15
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.0.0-beta1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:0.5'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:2.2.2'
}
Remove the -beta1 from your appcompat support library dependency:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:0.5'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:2.2.2'
}
Then, sync your project.
Related
ERROR: Unable to resolve dependency for ':app#debugUnitTest/compileClasspath': Could not download accessibility-test-framework.jar (com.google.android.apps.common.testing.accessibility.framework:accessibility-test-framework:2.1)
Show Details
Affected Modules: app
Using Accessibility Test Framework Library to test for common accessibility issues.
This is my build.gradle(Module: App)
apply plugin: 'com.android.application'
repositories {
maven {
url 'https://repo1.maven.org/maven2/'
}
}
android {
compileSdkVersion 26
buildToolsVersion '26.0.3'
defaultConfig {
applicationId "com.pluralsight.candycoded"
minSdkVersion 15
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'
}
}
testOptions {
unitTests.returnDefaultValues = true
}
sourceSets.test.resources.srcDirs += ["src/main"]
}
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.3'
implementation 'com.loopj.android:android-async-http:1.4.9'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.squareup.picasso:picasso:2.71828'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-intents:3.0.2'
androidTestImplementation 'com.android.support:support-annotations:28.0.0'
testImplementation 'junit:junit:4.12'
testImplementation 'com.github.javaparser:javaparser-core:3.0.1'
//testImplementation "org.mockito:mockito-core:2.+"
testImplementation "org.powermock:powermock-module-junit4:1.7.1"
testImplementation "org.powermock:powermock-api-mockito2:1.7.1"
testImplementation "org.powermock:powermock-core:1.7.1"
testImplementation 'org.robolectric:robolectric:4.3.1'
}
If I try to sync my app in Android Studio I get the follwing error message:
Failed to resolve: com
Show in File
If I click on "Show in File" my build.gradle opens and my cursor is on the first line.
This is my build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "de.vertretungsplan"
minSdkVersion 14
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
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:gridlayout-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.android.support:support-vector-drawable:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.a ndroid.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
compileOnly 'org.projectlombok:lombok:1.16.20'
annotationProcessor 'org.projectlombok:lombok:1.16.20'
implementation 'com.itextpdf:itextpdf:5.5.13'
implementation 'com.turki-alkhateeb:materialcolorpicker:1.0.7'
}
I hope somebody can help me.
Thanks you very much!
Remove the added space in this line:
androidTestImplementation 'com.a ndroid.support.test:runner:1.0.2'
I got this error when try to add dependancy on module.
Error:Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve project/
Error:Unable to resolve dependency for ':app#debugAndroidTest/compileClasspath': Could not resolve project
Error:Unable to resolve dependency for ':app#debugUnitTest/compileClasspath': Could not resolve project
Error:Unable to resolve dependency for ':app#release/compileClasspath': Could not resolve project**
Error:Unable to resolve dependency for ':app#releaseUnitTest/compileClasspath': Could not resolve project**
please help to resolve this problem.
Methods i have tried:
1.I have tried gradle offline work and online work, both end up with same error message.
2.Clean project & rebuilding.
3.INVALIDATE CACHE & RESTART.
//Edit
Following is my app level gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.XXX.XXXXXXXX"
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "3.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
//testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
dexOptions {
jumboMode true
//matchingFallbacks = ['release', 'debug']
}
//configurations.all {
// resolutionStrategy.force 'com.google.code.findbugs:jsr305:26.0.2'
//} }
repositories {
/*maven {
url "https://jitpack.io"
}*/
mavenCentral()
maven() {
url "https://oss.sonatype.org/content/repositories/snapshots"
} }
dependencies {
implementation files('libs/httpclient-4.5.3.jar')
implementation project(':videocompress')
implementation 'com.google.firebase:firebase-analytics:11.2.0'
implementation 'org.apache.commons:commons-io:1.3.2'
implementation 'com.google.firebase:firebase-analytics:11.2.0'
implementation 'com.github.bumptech.glide:glide:4.1.1'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.google.android.gms:play-services-auth:11.2.0'
implementation 'com.google.firebase:firebase-database:11.2.0'
implementation 'com.google.firebase:firebase-storage:11.2.0'
implementation 'com.google.firebase:firebase-auth:11.2.0'
implementation 'com.google.firebase:firebase-config:11.2.0'
implementation 'com.google.android.gms:play-services-appinvite:11.2.0'
implementation 'com.google.firebase:firebase-messaging:11.2.0'
implementation 'com.google.android.gms:play-services-ads:11.2.0'
implementation 'com.google.firebase:firebase-appindexing:11.2.0'
implementation 'com.google.firebase:firebase-crash:11.2.0'
implementation 'com.firebaseui:firebase-ui-database:1.2.0'
implementation 'eu.the4thfloor.volley:com.android.volley:2015.05.28'
implementation 'com.google.code.gson:gson:2.2.4'
implementation 'com.squareup:otto:1.3.8'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'id.zelory:compressor:1.0.4'
implementation 'com.commit451:PhotoView:1.2.4'
implementation 'com.yovenny.VideoCompress:videocompress:1.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'me.aflak.libraries:pulltorefresh:1.0'
implementation 'com.android.support:cardview-v7:26.0.0-alpha1'
implementation 'com.android.support:appcompat-v7:26.0.0-alpha1'
implementation 'com.android.support:design:26.0.0-alpha1'
testCompile 'junit:junit:4.12'
annotationProcessor 'com.github.bumptech.glide:compiler:4.1.1'
implementation 'me.relex:circleindicator:1.2.2#aar'
implementation 'com.github.lawloretienne:imagegallery:0.1.0'
implementation 'com.jakewharton:butterknife:8.4.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
implementation 'com.android.support:palette-v7:26.0.0-alpha1'
implementation 'com.android.support:multidex:1.0.1'
implementation 'com.baoyz.swipemenulistview:library:1.3.0'
implementation ('com.github.worker8:tourguide:1.0.17-SNAPSHOT#aar') {
transitive=true
}
compile project(path: ':calapp') }
apply plugin: 'com.google.gms.google-services'
Try: in build.gradle(app)
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.application"
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.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'
}
in build.gradle(project)
change gradle dependency version to
classpath 'com.android.tools.build:gradle:3.0.1'
In gradle-wrapper.properties, change distributionUrl with below line
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
I built a normal android app which uses Firebase to store data(name,email and number) and it runs perfectly but i have a dependency conflict error which i am unable to solve. the message which i get "Message Gradle Build" is:
Error:Execution failed for task ':app:preDebugAndroidTestBuild'.
Conflict with dependency 'com.android.support:support-annotations' in project ':app'. Resolved versions for app (25.2.0) and test app (25.4.0) differ. See https://d.android.com/r/tools/test-apk-dependency-conflicts.html for details.
and my build.gradle file contains:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.arya.anish.myfirebaseexample"
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.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-database:11.0.4'
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'
}
apply plugin: 'com.google.gms.google-services'
how to overcome this error?
try adding this to your app level .gradle file
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-database:11.0.4'
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') {
exclude group: 'com.android.support', module: 'support-annotations'
}
}
finally figured out how to solve the dependency conflict
i added this line in the build.gradle file in the depndencies block:
compile 'com.android.support:support-annotations:27.0.2'
and bingo, no errors now.
I am building a Login-Register app on Android Studio. When i try to import the package android.support.design.widget it does not recognize it. I searched for a solution on other posts and they say to add some "compile" lines on build.gradle. I did it but nothing works.
Here is my build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.thomas.medicalappointmentorganization"
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'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7: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'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:support-v4:26.1.0'
}
What am i doing wrong?
Please remove this line
implementation 'com.android.support:appcompat-v7:26.1.0'
Use this one:
implementation 'com.google.android.material:material:1.4.0'
Instead of:
compile 'com.android.support:design:26.1.0'