I want to include a library in Android Studio , but it displays error like below :
Failed to resolve: com.andrognito.pinlockview:pinlockview:2.1.0
Failed to resolve: com.andrognito.patternlockview:patternlockview:1.0.0
How to fix this problem?
-build.gradle (App)
plugins {
id 'com.android.application'
}
android {
compileSdk 32
defaultConfig {
applicationId "com.multiverse.appprotector"
minSdk 23
targetSdk 32
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'com.andrognito.pinlockview:pinlockview:2.1.0'
implementation 'com.andrognito.patternlockview:patternlockview:1.0.0'
}
Other dependencies, which I consider are not relevant to the error:
implementation 'androidx.appcompat:appcompat:1.4.2'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'junit:junit:4.13.2'
implementation 'androidx.test.ext:junit:1.1.3'
implementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.biometric:biometric:1.1.0'
Please go through link
If possible try latest library for the same because both libraries are not maintained from last few years.
Add jCenter repository in project’s build.gradle file as shown below and sync your project:
allprojects {
repositories {
jcenter()
. . .
}
}
Note- In the latest android code it will available in settings.gradle file
pluginManagement {
repositories {
jcenter()
...
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
jcenter()
..
}
}
Related
Why is the implementation of the FastNetworking Library not working in Android Studio?
I tried to resolve this dependency:
implementation 'com.amitshekhar.android:android-networking:1.0.2'
But it is not working in Android Studio. I also added:
maven { url "https://jitpack.io" }
But this is not working either.
Please help me how to resolve this implementation because I want to use get and post APIs in my project. But this implementation not working in my Android Studio.
Build.gradle(Module app)
plugins {
id 'com.android.application'
}
android {
compileSdk 32
defaultConfig {
applicationId "com.example.jsonparsing"
minSdk 21
targetSdk 32
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.4.2'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.amitshekhar.android:android-networking:1.0.2'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
Settings.gradle
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
}
}
rootProject.name = "Json Parsing"
include ':app'
Please can anyone tell me how to resolve this problem?
GOTO https://mvnrepository.com/artifact/com.amitshekhar.android/android-networking/1.0.2
Download the AAR FILE
android studio GOTO file=>project structure=>dependencies=>app=> press + => select JAR/AAR, GIVE THE PATH to the file and let it install, this file worked for me and exactly how i did it ,GOOD LUCK
The error is:
Could not resolve net.java.dev.jna:jna-platform
In the integration of Firebase to mu Grandle I get an error. I don't know if it's because the structure of the document was modified, since in mine it didn't contain "buildscript","allprojects".
I'm programming with java, not with kotlin in case it can help.
My gradle.app is
plugins {
id 'com.android.application'
}
android {
compileSdk 32
defaultConfig {
applicationId "com.example.whatdowant"
minSdk 24
targetSdk 32
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
///Implement para FIREBASE
implementation 'com.google.firebase:firebase-auth:21.0.3'
implementation 'com.google.android.gms:play-services:play-services-auth:17.0.0'
implementation 'com.google.firebase:firebase-analytics'
implementation platform('com.google.firebase:firebase-bom:29.3.1')
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
apply plugin: 'com.google.gms.google-services'
> `My gradle. project is:`
buildscript {
ext.kotlin_version = "1.5.0"
repositories {
// Check that you have the following line (if not, add it):
google() // Google's Maven repository
}
dependencies {
// Add the following line:
classpath 'com.google.gms:google-services:4.3.10' // Google Services plugin
classpath "com.android.tools.build:gradle:4.2.2"
}
}
allprojects {
repositories {
mavenCentral()
google() // Google's Maven repository
}
}
```
I'd like to add the barteksc pdf dependencie but when I build my project it throw me this issue :
Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
The dependencie:
implementation 'com.github.barteksc:android-pdf-viewer:2.8.2'
I haven't been able to find any solution exept the offline toggle but in my case it doesn't change anything..
How can I make this work?
Edit:
Here's is my build.gradle settings:
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
rootProject.name = "samere"
include ':app'
And here my gradle:
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}
android {
compileSdk 32
defaultConfig {
applicationId "fr.frd.samere"
minSdk 21
targetSdk 32
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'com.github.barteksc:android-pdf-viewer:3.2.0-beta.1'
}
Try adding jcenter()
https://github.com/barteksc/AndroidPdfViewer#installation
Library is available in jcenter repository, probably it'll be in Maven Central soon.
Hi here I am try a payment project using Amazon Payment Services Android SDK. Here I am successfully done the payment functionality and it's works well. After implementing into main projects I got following issue.
some kotlin library attached to the project where compile with newer kotlin compiler and it can't be read... No update found
In My Gradle
buildscript {
ext.kotlin_version = "1.6.0"
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url "https://android-sdk.payfort.com" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
In Module
plugins {
id 'com.android.application'
id 'kotlin-android'
}
android {
compileSdkVersion 31
defaultConfig {
applicationId "com.android.paymentdemoapp"
minSdkVersion 23
targetSdkVersion 31
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation("com.amazon:fortpayment:+:release#aar"){
transitive = true
}
}
I'm modifying the kotlin version(1.6.10 to 1.4.32) and 'build:gradle:4.1.0' to 4.1.2 clean and rebuild the project I got the following issue...
e: /Users/raja/.gradle/caches/transforms-2/files-2.1/2a57ced0732a783c670dc97c999acc46/jetified-core-ktx-1.8.0-alpha03-api.jar!/META-INF/core-ktx_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.2.
I'm tried to configure the kotlin version and Gradle build version different way but there is no use. Anyone please help me to fix this issue. Thanks in advance.
project module
And I really can't solve it.
I've seen quite a lot of people getting this error, everyone saying remove jcenter but in my case there is no jcenter i found
have tried everything available in internet but can't resolve this problem
plz someone fix this problem
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.4"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
**app module**
plugins {
id 'com.android.application'
}
android {
compileSdk 32
defaultConfig {
applicationId "com.example.firstapp"
minSdk 21
targetSdk 32
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.4.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
testImplementation 'junit:junit:'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
It seems that your JUnit dependency is missing a version.
Please try replacing:
testImplementation 'junit:junit:'
with:
testImplementation 'junit:junit:4.13.2'