Android 3.0.1 does not resolve dependency - android

I want to add those dependencies:
implementation 'com.andrognito.pinlockview:pinlockview:2.1.0'
implementation 'com.multidots:fingerprint-auth:1.0.1'
in android studio 3.0.1 with gradle 3.0.1 but I get the following error:
Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve com.multidots:fingerprint-auth:1.0.1.
Unable to resolve dependency for ':app#debugAndroidTest/compileClasspath': Could not resolve com.andrognito.pinlockview:pinlockview:2.1.0.
My build.gradle files are:
buildscript {
repositories {
jcenter()
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
And the other one:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.b.jacob.gallery"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:24.2.1'
implementation 'com.android.support:design:24.2.1'
implementation 'com.andrognito.pinlockview:pinlockview:2.1.0'
implementation 'com.multidots:fingerprint-auth:1.0.1'
testImplementation 'junit:junit:4.12'
}
It's important to say that those dependencies resolve without any problem in older version of android studio.

implementation 'com.android.support:appcompat-v7:24.2.1'
implementation 'com.android.support:design:24.2.1'
and
buildToolsVersion '26.0.2'
cannot go together there will be a conflict
Your changes should be :-
implementation 'com.android.support:appcompat-v7:26.0.2'
implementation 'com.android.support:design:26.0.2'
and
compileSdkVersion 26
Note
Dont forget to make sure Offline Work is unchecked in android studio...and you are connected to internet
These are the probable reasons why the dependencies cant be resolved !!

Related

Update SDK: Failed to resolve: com.android.support:appcompat-v7

I'm using Android Studio 2.3.3 and updated my SDK version and now I'm using API 27 but I encountered the following error:
Also I install repository and sync project but This error occurred:
This code is gradle.build (project):
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Also this code is gradle.build (Module:app )
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '28.0.0'
defaultConfig {
applicationId "comp.packk.ir"
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 {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:27.0.2'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:27.1.1'
}
What is the solution?
implementation or compile 'com.android.support:appcompat-v7:27.1.1'
implementation or compile 'com.android.support:cardview-v7:27.1.1'
implementation or compile 'com.android.support:design:27.1.1'

gradle Unable to merge dex error at android studio 3

I am trying run my app at emulator but I got his error:
Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
This is my gradle file:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
multiDexEnabled true
applicationId "com.example.sayres.presencesystem"
minSdkVersion 16
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 {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.google.firebase:firebase-database:11.6.0'
implementation 'com.google.firebase:firebase-auth:11.6.0'
implementation 'com.firebaseui:firebase-ui-auth:3.1.0'
implementation 'com.firebaseui:firebase-ui-database:3.1.0'
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:multidex:1.0.1'
}
and this:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.google.gms:google-services:3.0.0' // google-services plugin
}
}
allprojects {
repositories {
jcenter()
maven { url 'http://maven.fabric.io/public' }
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
according some siggestion on some post I have added multiDexEnabled true to my gradle but I still got error. some developers at this site had suggested, rebuild project.I did this suggestion but I did work and I still got this error!!
what is your suggestion?
I still did this suggestion
but did not work again.
I do not have too many methods.I have just 2 activity and a few methods.my project is for learning.
I change my build.gradle to :
implementation 'com.google.firebase:firebase-database:10.2.0'
implementation 'com.google.firebase:firebase-auth:10.2.0'
implementation 'com.firebaseui:firebase-ui-auth:1.2.0'
implementation 'com.firebaseui:firebase-ui-database:1.2.0'
and
classpath 'com.google.gms:google-services:3.0.0' // google-services plugin
my problem fixed.now I can compile my project.

Issues with updating my app version in gradle file

So I was using API 25 which is Nougat version, and I wanted to update my app to Version ApI27 which is newly out these days. but whenever I update to 27.0.1, this Error:
"Error:Failed to resolve: com.android.support:appcompat-v7.27.0.1"
keeps occurring. I don't know what I've done wrong and I'm struggling all day to find the resolution. Thank you very much for your time and assistance in this matter.
Oh, and I'm sure that I've downloaded SDK Versions and all the files that are needed already in SDK manager.
My Gradle File(Module App):
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '27.0.1'
defaultConfig {
applicationId "org.poream.dejaview"
minSdkVersion 15
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 'com.google.firebase:firebase-storage:11.6.0'
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2',
{
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:design:27.0.1'
compile 'com.google.android.gms:play-services-maps:11.6.0'
compile 'com.android.support:appcompat-v7.27.0.1'
compile 'com.android.support:design:27.0.1'
compile 'com.google.android.gms:play-services-maps:11.6.0'
compile 'com.android.support:cardview-v7:27.0.1'
compile 'com.google.android.gms:play-services-location:11.6.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-core:11.6.0'
compile 'com.google.firebase:firebase-database:11.6.0'
compile 'com.google.firebase:firebase-crash:11.6.0'
compile 'com.google.firebase:firebase-auth:11.6.0'
compile 'com.android.support:support-v4:27.0.1'
compile 'com.android.support:recyclerview-v7:27.0.1'
compile 'com.google.android.gms:play-services-auth:11.6.0'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
My Gradle File(Project):
// Top-level build file where you can add configuration options common to
all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.1.0'
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
There is a typo (the . instead of :)
compile 'com.android.support:appcompat-v7.27.0.1'
Use:
compile 'com.android.support:appcompat-v7:27.0.1'
Add maven { url 'https://maven.google.com/' } line in your project level build.gradle
repositories {
maven { url 'https://maven.google.com/' }
}

Firebase Android Studio (2.2.3) issue

I am facing a problem to compile Firebase in my android project.Here is my app level gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "24.0.3"
defaultConfig {
applicationId "<my_app_id>"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:support-v4:25.1.0'
compile 'com.google.android.gms:play-services-auth:10.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'me.relex:circleindicator:1.2.2#aar'
compile 'com.android.support:recyclerview-v7:25.1.0'
compile 'com.google.firebase:firebase-core:10.2.1'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
And here is the build gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I am getting an error of Failed to resolve : com.google.firebase:firebase-core:10.2.1
If you are using android studio,
Goto tools -> Firebase
And follow on screen instructions. Android studio take care of the dependency issues.
Change
compile 'com.google.android.gms:play-services-auth:10.2.1'
to
compile 'com.google.android.gms:play-services-auth:10.0.1'
It works for me.
update your play service version and also update firebase dependency version.

how to import Materialrecent design in android app

I am trying to import Github library about Material design from https://github.com/ZieIony/MaterialRecents but I am facing this type of error:
("Error:Dependency com.github.ZieIony:MaterialRecents:d2aec46f48 on project app resolves to an APK archive which is not supported as a compilation dependency. File: C:\Users\Talha\.gradle\caches\modules-2\files-2.1\com.github.ZieIony\MaterialRecents\d2aec46f48\494f96d345471f38b6f3f4c1c42347a2b42f8303\MaterialRecents-d2aec46f48.apk")
My Gradle is
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "com.talha.myrecentdesign"
minSdkVersion 14
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.github.ZieIony:MaterialRecents:d2aec46f48'
compile 'com.android.support:appcompat-v7:24.2.1'
testCompile 'junit:junit:4.12'
compile 'com.nineoldandroids:library:2.4.0'
}
and
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I have searched from many sites but not find the exact solution. Please help me.
The library you are reffering to uses CardView which is part of the android support design library, so you have to add a dependency for that aswell.
compile 'com.android.support:design:22.2.0'

Categories

Resources