Fast Networking Library is not importing in Android Studio - android

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

Related

Failed to resolve one of the libraries in Android Studio gradle dependencies

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()
..
}
}

How to use libraries other than google libraries in android studio 2021.1

I created a blank android project that works very well but when I try to use this library found on github I get this error.
failed org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.miguelcatalan:materialsearchview:1.4.0.
org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.miguelcatalan:materialsearchview:1.4.0.
The error occurs when I use any github library but google libraries compile without problem. What should I do please?
Here is my build.gradle
plugins {
id 'com.android.application'
}
android {
compileSdk 32
defaultConfig {
applicationId "com.example.myapplication"
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 'com.google.android.material:material:1.4.0'
//implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
implementation 'androidx.exifinterface:exifinterface:1.3.3'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'com.google.firebase:firebase-analytics:20.1.2'
implementation 'org.apache.commons:commons-text:1.6'
implementation 'com.github.ksoichiro:simplealertdialog:1.2.1#aar'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.7.0-alpha01'
implementation 'androidx.recyclerview:recyclerview:1.3.0-alpha02'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.miguelcatalan:materialsearchview:1.4.0' //Here is github Library
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
And here is my settings.gradle
pluginManagement {
repositories {
maven {url 'https://jitpack.io'}
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
maven {url 'https://jitpack.io'}
google()
mavenCentral()
}
}
rootProject.name = "My Application"
include ':app'
I don't know what I did wrong. I'm really stuck I can't use the github libraries
com.miguelcatalan:materialsearchview has not been updated in five years. I strongly recommend that you use libraries that are being actively maintained. A side-effect of using an actively-maintained library is that it will be in one of the artifact repositories that you use.
If you insist on using this library, change:
repositories {
maven {url 'https://jitpack.io'}
google()
mavenCentral()
}
to:
repositories {
maven {url 'https://jitpack.io'}
google()
mavenCentral()
jcenter()
}

Strange gradle issue

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.

Could not find method dependencyResolutionManagement() for arguments [build_ckqar66poaozqtyzw4dyn6sx4$_run_closure3#a921a13] on project app

I have a trouble in my build.gradle file because there is a method called dependencyResolutionManagement() but I don't know how to solve it.
The error says that there are not method.
This is the message:
Also I have an error that says 'Cannot Resolve symbol 'RepositoriesMode' on my build gradle.
I think I was modifying my build.gradle to add some dependence but I did something wrong. These are the message and my build.gradle file
build.gradle
1 error
Could not find method dependencyResolutionManagement() for arguments [build_ckqar66poaozqtyzw4dyn6sx4$_run_closure3#a921a13] on project ':app' of type org.gradle.api.Project
This is my build.gradle file
Cannot resolve symbol 'RepositoriesMode'
import org.gradle.api.initialization.resolve.RepositoriesMode
plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
}
android {
compileSdk 31
buildToolsVersion "30.0.3"
defaultConfig {
applicationId 'com.example.myapp'
minSdk 21
targetSdk 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
allprojects {
repositories {
google()
mavenCentral()
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard- a.ndroid-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildFeatures {
viewBinding true
}
}
dependencies {
implementation 'com.google.android.gms:play-services-ads:20.5.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation platform('com.google.firebase:firebase-bom:29.0.3')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-inappmessaging'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.google.android.gms:play-services-ads:20.5.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
repositories {
google()
mavenCentral()
jcenter()
maven { url 'https://jitpack.io' }
}
}
rootProject.name = "appname"
include ':app'
I tried Invalidate- Restart Caché but it didn't work. I think I was modifying the build.gradle code and I made something wrong.
Try this:
Remove from your build.gradle file
repositories {
mavenCentral()
}
Add to your settings.gradle the next code section:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
jcenter() // Warning: this repository is going to shut down soon
}
}
Try to sync again your project
This worked for me!!

some kotlin library attached to the project where compile with newer kotlin compiler and it can't be read... No update found

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.

Categories

Resources