I am developing a basic custom camera app
These are my dependency
// CameraX core library dependency
implementation "androidx.camera:camera-camera2:$camera_version"
// CameraX Lifecycle dependency
implementation "androidx.camera:camera-lifecycle:$camera_version"
// CameraX View dependency
implementation "androidx.camera:camera-view:$camera_version"
camera_version = '1.0.0'
Getting below error, it work fine if I remove camera-view dependency, but I cannot as I need that for my custom camera app.
Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Could not find androidx.camera:camera-view.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/androidx/camera/camera-view/1.0.0/camera-view-1.0.0.pom
- https://repo.maven.apache.org/maven2/androidx/camera/camera-view/1.0.0/camera-view-1.0.0.pom
Required by:
project :app
As Morrison Chang already helped you with current issue.
I just wanted to add a few pointers to that whenever you get any such error in future for any of the android's library.
Search google's maven repo https://maven.google.com/ to see if the version you are looking for is even the correct one or what is the latest version of the library exists. like in your case https://maven.google.com/web/index.html?q=camera#androidx.camera:camera-view
Few of the library is still available at https://mvnrepository.com/ where you can check the version of your library
Related
I added this library from GitHub into my android app:
implementation 'com.github.quiin:unifiedContactPicker:1.0'
Now, this library uses other libraries from GitHub.
When I run my app, it tells me that these internal libraries are not found, so I dig them up and find their dependencies and add them to my app's Gradle file. But the problem is that they are not being detected and this is the error I am getting both times.
Execution failed for task ':app:dataBindingMergeDependencyArtifactsDebug'.
Could not resolve all files for configuration ':app:debugCompileClasspath'.
Could not find com.hootsuite.android:nachos:1.0.0.
Required by:
project :app > com.github.quiin:unifiedContactPicker:1.0
Possible solution:
Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
Please help, I have been stuck at this for a long time and I need to use this dependency. I have also tried using similar dependencies that fulfil my purpose but they all seem to have the same problem. So I don't know if there's a problem with my project or the libraries.
I had the same problem but with geok library. I checked syntax of dependencies declaration lines on JitPack website and there were different than I had on my build.gradle file. Finally I changed
from:
implementation "com.github.piruin:geok:$geokVersion"
implementation "com.github.piruin.geok-gson:$geokVersion"
to:
implementation "com.github.piruin.geok:geok:$geokVersion"
implementation "com.github.piruin.geok:geok:$geokVersion"
and it works.
I'm trying to keep my current SDK version as 27 and don't want to upgrade to AndroidX. What can be the solution for this error?
Error highlihted
This issue, is because of partial AndroidX implementation.
Seeing the dependency you already are doing androidx partially, see the code
implementation 'androidx.recyclerview:recyclerview:1.1.0'
Either change the dependency from AndroidX to old one like
implementation 'com.android.support:recyclerview-v7:27.0.0'
by following the guide over here https://developer.android.com/jetpack/androidx/migrate/artifact-mappings
Which is basically, find the implementation you have in your build.gradle and finding it over there in table, and copy pasting the one on left side.
Or go to Refactor -> Migrate to AndroidX and convert whole code to AndroidX.
I am upgrading my play-services-ads library from version 12 to version 18.1:
dependencies {
api 'com.google.android.gms:play-services-ads:18.1.0'
}
The problem is that the compilation fails with this error:
.gradle/caches/transforms-1/files-1.1/play-services-ads-identifier-17.0.0.aar/75b3c9fbdc51199269673bd2fa8b6cfe/jars/classes.jar(com/google/android/gms/ads/identifier/AdvertisingIdClient.class): warning: Cannot find annotation method 'value()' in type 'GuardedBy': class file for javax.annotation.concurrent.GuardedBy not found
I took away all the usages for AdvertisingIdClient and left only the import, but the problem persists:
import com.google.android.gms.ads.identifier.AdvertisingIdClient;
Is there anything I am doing wrong?
com.google.android.gms:play-services-ads:18.1.0 depends upon com.google.android.gms:play-services-ads-identifier:17.0.0, among other libraries.
Your error indicates that com.google.android.gms:play-services-ads-identifier:17.0.0 references javax.annotation.concurrent.GuardedBy. However, that class is not in the Android SDK. The POM file for com.google.android.gms:play-services-ads-identifier:17.0.0 should be referencing a library that has an implementation of that class, but it does not seem to.
One library that has an implementation of that class is com.google.code.findbugs:jsr305. Adding a dependency on com.google.code.findbugs:jsr305 for a recent version (e.g., 3.0.2) gave you that class, satisfying the compiler.
So, there appears to be a bug in the Play Services SDK packaging, which my workaround resolves. You might want to add a comment in your module's build.gradle file to consider removing the com.google.code.findbugs:jsr305 if a future update to com.google.android.gms:play-services-ads fixes this bug.
I just want to know how to fix this issue with incompatibility with dependencies on android studio. I am trying to follow the steps on setting up firebase but could not find any solution with this incompatibility. Please help
That is because Firebase libraries is using support libraries implicitly. You need to override the incompatible libraries by adding the clashed support libraries but with the same current version. For your case, you need to override support-media-compat. You can add the following dependencies to your dependencies block:
dependencies {
implementation "com.android-support:support-media-compat:28.0.0"
implementation "com.android-support:animated-vector-drawable:28.0.0"
implementation "com.android-support:support-v4:28.0.0"
...
}
I am currently facing the error when i try to connect to the Cloud Messaging using firebase assistants.
Failed to resolve: firebase-messaging-15.0.0
I search online, and the solution was to remove the last few digits in the dependency. However, when i tried that, it solved the error, but on the firebase assistants, it did not show "dependency being set up correctly" anymore. Hence, does this mean that i am not connected to the firebase cloud messaging?
Method tried:
change from implementation 'com.google.firebase:firebase-messaging:17.0.0:15.0.0' to implementation 'com.google.firebase:firebase-messaging:17.0.0'
The dependency being set up correctly is in green before i use the online method of removing the last few digits of the dependency
remove all firebase-messaging dependency and add This Dependency
implementation 'com.google.firebase:firebase-messaging:17.0.0'
You are getting the following error:
Failed to resolve: firebase-messaging-15.0.0
Because you are using a wrong dependency in your code. To solve this, please change the following line of code:
implementation 'com.google.firebase:firebase-messaging:17.0.0:15.0.0'
to
implementation 'com.google.firebase:firebase-messaging:17.3.4'
Because such a version 17.0.0:15.0.0 does not exist. Here you can find more informations.
In your top level build.gradle file please be sure to have the latest version of Google Service plugin and Gradle:
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'