Failed to resolve: floatingactionbutton-1.10.1 got error in androidx - android-studio

i got following error at Build Time
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find floatingactionbutton-1.10.1.aar (net.i2p.android.ext:floatingactionbutton:1.10.1).
Searched in the following locations:
https://jcenter.bintray.com/net/i2p/android/ext/floatingactionbutton/1.10.1/floatingactionbutton-1.10.1.aar
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
Below is my dependancies
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.firebase:firebase-auth:19.4.0'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'junit:junit:4.13'
androidTestImplementation ("com.android.support.test:runner:1.0.2") {exclude group: "com.android.support"}
implementation 'com.github.axet:android-library:1.32.20'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
implementation "androidx.appcompat:appcompat:1.2.0"
implementation "androidx.recyclerview:recyclerview:1.1.0"
implementation 'com.google.android.gms:play-services-auth:18.1.0'
implementation "androidx.gridlayout:gridlayout:1.0.0"
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
implementation 'com.github.axet.fbreader:library:0.1.14'
implementation 'com.github.axet:djvulibre:0.1.4'
implementation 'com.github.axet:pdfium:2.0.14'
implementation 'com.github.axet:k2pdfopt:0.1.6'
implementation('com.github.axet:wget:1.6.1') { exclude group: 'org.json', module: 'json' }
assets('com.madgag.spongycastle:bctls-jdk15on:1.58.0.0') { exclude module: 'junit' }
implementation 'com.google.firebase:firebase-analytics:17.6.0'
implementation 'com.google.firebase:firebase-messaging:20.3.0'
implementation 'com.google.android.gms:play-services-ads:19.4.0'
implementation 'com.android.volley:volley:1.1.1'
implementation 'com.facebook.android:audience-network-sdk:6.0.0'
implementation files('libs/GenAsync.1.2.jar')
In dependencies, I already added androidx material.
Below is my FloatingButton XML Code
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="#+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="#dimen/fab_margin"
android:visibility="gone"
android:src="#android:drawable/ic_dialog_email" />
I didn't write any code on the fab button click event.
I got this problem when I transfer this project to another PC.
Also, This project completely works on the old PC but not on the new PC.
In the new PC, I made a new project & it works perfectly with the fab button.
I tried Invalidate Caches & Restart.
Downgrade Android Studio 4.1.1 to 4.1
Clean & rebuild project.
Also, Removed the fab button from XML but the same error exists.
I also tried the following dependency but the same error occurs.
implementation 'com.getbase:floatingactionbutton:1.10.1'
Guys, Please help me

Related

Failed to resolve: uz.shift:colorpicker:0.5

After I updated the Android studio to 4.0 version, the color picker dependency is not working: "implementation 'uz.shift:colorpicker:0.5#aar'". I also try another dependencies but same issue.
build.gradle
repositories {
maven { url "https://dl.bintray.com/dasar/maven" }
maven { url "https://s3.amazonaws.com/repo.commonsware.com" }
maven { url "https://jitpack.io" }
maven { url "http://dl.bintray.com/dasar/maven" }
mavenCentral()
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//rate alert
implementation 'com.github.hotchemi:android-rate:1.0.1'
implementation "androidx.exifinterface:exifinterface:1.0.0"
implementation "androidx.appcompat:appcompat:1.0.0"
implementation "androidx.cardview:cardview:1.0.0"
implementation "androidx.recyclerview:recyclerview:1.0.0"
implementation "com.google.android.material:material:1.0.0"
implementation "androidx.palette:palette:1.0.0"
implementation "androidx.browser:browser:1.0.0"
implementation "androidx.legacy:legacy-support-v4:1.0.0"
implementation 'uz.shift:colorpicker:0.5#aar'
implementation 'com.github.jetradarmobile:desertplaceholder:1.1.1'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.github.yalantis:ucrop:2.2.2'
implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.10.0'
implementation 'jp.wasabeef:recyclerview-animators:2.2.7'
implementation 'com.github.HoraApps:Liz:-SNAPSHOT'
implementation 'com.github.lzyzsd:circleprogress:1.2.1'
// TODO check them out
implementation 'com.turingtechnologies.materialscrollbar:lib:10.0.3'
implementation 'de.psdev.licensesdialog:licensesdialog:1.8.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
}
Error
Failed to resolve: uz.shift:colorpicker:0.5
Show in Project Structure dialog
Affected Modules: app
Downgrade the version of gradle as of now, No proper solution is available.
It will work fine in ( Gradle Version - 5.6.4)
I've tried everything still it won't go away. As the problem struck when I downloaded the latest version. I simply switched back to the previous version of gradle and It's working fine now.

Version 28 is the latest version of the legacy support

Hello iam trying to add this library :compile 'com.android.support:cardview-v7:28.0.0\n'
but getting error: Version 28 (intended for Android Pie and below) is the last version of the legacy support library, so we recommend that you migrate to AndroidX libraries when using Android Q and moving forward. The IDE can help with this: Refactor > Migrate to AndroidX...
any fix?
Bro its very simple just change
com.android.support:cardview-v7:(your targetsdkversion digits).0.0
instead of com.android.support:cardview-v7:28.0.0...it will work
Use the following dependencies instead of old ones in gradle scripts on Module level
dependencies {
implementation 'androidx.preference:preference:1.2.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.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}

Manifest merger failed android studio

I have this in my build.gradle(module:app) :
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-
layout:1.1.3'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.+'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-database:16.0.4'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-
core:3.0.2'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:gridlayout-v7:28.0.0'
}
and when I try to sync it displays this:
ERROR: Manifest merger failed : Attribute application#appComponentFactory
value=(android.support.v4.app.CoreComponentFactory) from
[com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.0]
AndroidManifest.xml:22:18-86 value=
(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to
<application> element at AndroidManifest.xml:9:5-32:19 to override.
what can cause this and how do I fix it?
(adding tools:replace="android:appComponentFactory" to the manifest doesn't work)
Your android-image-cropper library is using androidx, while you haven't migrated yet. It is highly recommended to migrate to using Androidx, since most of the libraries are doing the same and may not provide backward compatibility to the com.android.support variants.
If you cannot migrate in the short term, then you can revert to a lower version of the library. As per the changelog, they migrated to AndroidX in 2.8.0, so you should go back to 2.7.0.

Android Studio can not resolve AutoValue class

I started to use AutoValue today in one of my projects and what bothers me is that Android Studio can not resolve the generated class name (AutoValue_DrawableContent) and marks it with the red color:
How I can suppress this warning?
Add the "idea" plugin to your build.gradle, for example:
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'net.ltgt.apt'
With this plugin, Android Studio can find the generated source files.
you can just comment out each dependencies and sync one by one... it might get things fixed...
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
Now that you have annotated your class, you need to build your project. This will generate the missing class, and Android Studio will be able to find it afterwards.
The build will not fail even though the editor is currently not recognizing the class name, because code generation will happen before the class is compiled.
Generate implementation class(es). AutoValue lib will do that.
Add these dynamically class(es) directory into source path. android-apt plugin will do this. After doing this, ide will know AutoValue_* and not to show errors.

Android Studio (Gradle) cannot find Mockito

I try to use Mockito from within Android Studio 1.2.2 but I get the following error:
Error:(50, 17) Failed to resolve: org.mockito:mockito-core:1.10.19
The error occurs when I sync Gradle after adding the dependency manually. This is the dependency in my module Gradle file:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.2.0'
testCompile 'org.mockito:mockito-core:1.10.19'
}
Could anyone help my resolve this issue?
Related questions:
Do I first need to download Mockito manually?
If so, where should I put it?
Note: the comments were helpfull to solve the above problem. However, it got me into another problem which I could not solve. But updating to Android Studio 1.3 solved it. I am now running Mockito from within Android Studio.
Try replacing testCompile with androidTestCompile, it works for me when importing Mockito libs.
However, you may run to a runtime error if you include only mockito-core. You'll need to add into your gradle:
androidTestCompile "org.mockito:mockito-core:1.10.19"
androidTestCompile "com.google.dexmaker:dexmaker:1.2"
androidTestCompile "com.google.dexmaker:dexmaker-mockito:1.2"
If you have error with dexcache, put this line into your setUp() (Assuming you are using InstrumentalTestCase)
System.setProperty("dexmaker.dexcache", getInstrumentation().getTargetContext().getCacheDir().getPath());
I was stuck into a similar problem, and adding the mockito jar file manually did the thing for me.
To do that, first create a directory called "libs" in your app directory. Take note that this directory should be in the same level as that of the src/main and build directories.
Next, download the mockito jar file and paste it into the libs directory.
Include that into your dependencies in the app level build.gradle file:
dependencies {
compile files('libs/add-your-jar-file-name-here')
}
Sync the gradle and that should do the job.
Refer to this answer for more detailed answer with snapshots.
androidTestCompile has now been replaced with androidTestImplementation
dependencies {
androidTestImplementation 'junit:junit:4.12'
androidTestImplementation 'org.mockito:mockito-core:1.10.19'
}
Make sure the test file is located under $your_module/src/test/java or $your_module/src/androidTest/java directory.

Resources