I am trying to open new android project, then i will get an error the error is,
Failed to resolve:junit:junit:4.12
Error(23,13)
please help me to fix it.
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "24.0.0"
defaultConfig {
applicationId "com.example.akhil.myapplication"
minSdkVersion 22
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
}
Remove compile 'junit:junit:4.12' from the build.gradle file.
so the finally code look like this
Code :
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
}
comment out junit dependency and then rebbuild the project.
Related
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '26.0.2'
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "org.passitonkentucky.fayetteresources"
minSdkVersion 18
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
compile 'com.android.support:multidex:1.0.2'
}
I downloaded Android 3.0.1, before this I had error minimum version 3.0.
When that's resolved, it's now showing me error.
(27,4).
How can I solve this problem?
First you should avoid using "+" in version number its bad practice. add version number will solve your problem.
compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:2.0.1'
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.example.joshua.exigent"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.google.firebase:firebase-database:10.0.0'
compile 'com.firebaseui:firebase-ui-database:0.6.2'
compile 'com.android.support:recyclerview-v7:24.2.1'
compile 'com.android.support:cardview-v7:24.2.1'
}
apply plugin: 'com.google.gms.google-services'
ITS
You have to use the same version so, change your gradle file to this:
defaultConfig {
applicationId "com.example.joshua.exigent"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies { compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.google.firebase:firebase-database:10.0.0'
compile 'com.firebaseui:firebase-ui-database:0.6.2'
compile 'com.android.support:recyclerview-v7::23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
}
You need to make all support library versions same i.e 23.4.0
compile 'com.google.firebase:firebase-database:10.0.0'
compile 'com.firebaseui:firebase-ui-database:0.6.2'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
I am facing this error:
Failed to resolve--compile 'com.android.firebase:firebase-storage:9.0.0'
Here is the app gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.kartik.barcode"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.journeyapps:zxing-android-embedded:3.0.2#aar'
compile 'com.google.zxing:core:3.2.0'
compile 'com.android.support:design:23.2.1'//for The edittext animation
compile 'com.google.firebase:firebase-database:9.0.0'//for firebase
compile 'com.google.firebase:firebase-auth:9.0.0'
compile 'com.android.firebase:firebase-storage:9.0.0'
}
apply plugin: 'com.google.gms.google-services'
Here is the SDK Tool Tab
Change:
compile 'com.android.firebase:firebase-storage:9.0.0'
to:
compile 'com.google.firebase:firebase-storage:9.0.0'
zubliquzaini commented just now
Hello, I am getting this issue when I sync the project:
Error:(30, 13) Failed to resolve: com.yqritic:recylerview-flexibledivider:1.2.4
Here's my app gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.ztl.ztlubricant.testing"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.android.support:palette-v7:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.yqritic:recylerview-flexibledivider:1.2.4'
}
I am not sure probably there is a file that I need to download for the yqritic dependencies to work..
Help! Thank you..
You need add:
repositories {
jcenter()
}
And try to use version 1.2.6
...
compile 'com.yqritc:recyclerview-flexibledivider:1.2.6'
...
I'm trying to use the method findFirstVisibleItemPosition() from a LinearLayoutManager. The apis show that this method exists, but it is not recognized nor shown in autocompletion.
Other methods from this layout work (some at least), and android.support.v7.widget.LinearLayoutManager is imported.
What could be wrong?
edit: hereĀ“s my build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.skate.socialskate"
minSdkVersion 21
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services:7.0.0'
compile 'com.android.support:cardview-v7:22.1.0'
compile 'com.android.support:recyclerview-v7:21.0.+'
compile 'com.android.support:support-v13:22.1.0'
compile 'de.hdodenhof:circleimageview:1.2.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.13'
compile 'org.jsoup:jsoup:1.8.2'
}
You need to add an appcompat to your build.gradle:
compile 'com.android.support:appcompat-v7:22.1.1'