-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🔥Could not resolve com.google.code.findbugs:jsr305:3.0.0 #1954
Comments
Any fix or workaround for this? |
Any update on this ? |
I was not able to solve this problem, so I had to find another library |
Thanks @biancaFarcas which library are using now? |
Adding the following in the build.gradle file compiles for me. android {
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.0'
}
} see fix |
it doesn’t work for me. I have the same error and can't compile. any suggestion? |
Pin your versions in main build.gradle https://github.com/invertase/react-native-firebase-starter/blob/master/android/build.gradle#L3 then reference them everywhere else like so https://github.com/react-native-community/react-native-device-info/blob/master/example/android/app/build.gradle#L143 basically any time I see "resolutionStrategy" in a gradle file, and it's not because there are two legitimately different implementations you can choose from (like camera with mlkit or basic) it tells me that gradle versions haven't been pinned so modules don't know what to use and you get clashes |
@Solly74 now I am using react-native-push-notification as I only needed react-native-firebase for notifications module. |
I faced the exact same error with my project. |
any progress on this? i'm close to dumping firebase :/ |
This isn't a problem, as near as I can tell. @timomeara did you follow my recommendations? it builds, it works...but you have to pin the dependencies in your gradle config |
thanks mike- i did fix it, but pinning the deps didn't help. i basically started from scratch :) |
Hello 👋, to help manage issues we automatically close stale issues.
|
Just to be specific build.gradle of react-native-firebase |
Put this line in node-module/react-native-firebase/android/build.gradle into dependencies block |
No, don't do that. It's dangerous advice. Why? That change will be overridden every time you install packages, and it will just fail immediately if your CI is building clean (as it should). Don't ever modify node_modules directly or advise others to do so. If you must fiddle with node_modules, use "patch_package". In this case, the gradle resolution strategy suggestions in your apps build.gradle are sufficient |
There is a valid workaround on this issue, and in general I don't believe this module is responsible. Here's a demo from react-native init through a running app, no problem: https://github.com/mikehardy/rnfbdemo |
@mikehardy can you please provide an example for pinning the dependency ? |
already in the thread - #1954 (comment) |
Thanks for the quick reply |
gradle handles dependencies recursively. can you imagine if you specified each dependency without gradle handling it? You probably depend on more than 100 projects. But if you have resolution conflicts between different versions of the same recursive dependency (like jsr305) then you have to instruct gradle to pin the dependency even though it wasn't specified by you Gradle education is beyond the scope of this project though - the comment above should work, and if not gradle has ample documentation, with company Q&A on stackoverflow |
Adding this to
|
@mikehardy I really appreciate your help here. I think most of us are Android n00bs. I tried pinning versions in a variety of ways and either got the same errors or more errors 🤦♂ Would you mind being really specific about what I should do to fix this issue? Here are my dependency errors
I've tried adding things to android/build.gradle and android/app/build.grade, but I'm not sure I was doing any of it right. For example, I was hunting around in React Native 60 and found these versions:
Among other things, I tried adding this to my android/app/build.grade and it did nothing.
Another thing I tried is inside android/build.gradle adding the following to dependencies, but this caused more errors.
I also tried in android/app/build.gradle but this didnt do anything either.
I'd really appreciate any help -- I've been spinning my wheels all day and exhausted all of the google searched I can think of 🙏 |
I tried deleting I did some search in this library and I couldn't find anywhere that the |
'. /gradlew :app:deoendencies" is how you can debug gradle resolution the problem is in between rnfb and some other library |
Sounds like a type-o somewhere but I can't find this anywhere in my project or node_modules... 🤔 |
Oh that was in the command! lol 🤦♂ |
I'm trying to track down this one single error that I get when I sync with gradle files.
These are the only instances of that package in the dependency tree...
|
@ccorcos no idea, I can't reproduce. You might make a new sample project from react-native init on github that reproduces the problem and share it. All I know is that some one is saying they want findbugs:jsr305 strictly as 3.0.0 and someone else wants 3.0.2 so it's failing. Which library is doing that? no idea from the information provided |
Well I think I figured it out facebook/react-native#12309
I was installing react-native from a fork that has a small fix for iOS share extensions and the https://github.com/facebook/react-native/pull/26077/files Anyways, it works now! Thanks for the help 😄 |
Issue
On android build I receive the errors:
ERROR: Unable to resolve dependency for ':react-native-firebase@debug/compileClasspath': Could not resolve com.google.code.findbugs:jsr305:3.0.0.
Show Details
Affected Modules: react-native-firebase
ERROR: Unable to resolve dependency for ':react-native-firebase@debug/compileClasspath': Could not resolve com.google.code.findbugs:jsr305:3.0.0.
Show Details
Affected Modules: react-native-firebase
ERROR: Unable to resolve dependency for ':react-native-firebase@debug/compileClasspath': Could not resolve com.google.code.findbugs:jsr305:3.0.2.
Show Details
Affected Modules: react-native-firebase
Project Files
iOS
ios/Podfile
:# N/A
AppDelegate.m
:// N/A
Android
android/build.gradle
:buildscript {
repositories {
google()
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.google.gms:google-services:4.2.0'
}
allprojects {
repositories {
google()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
// N/A
android/app/build.gradle
:apply plugin: "com.android.application"
import com.android.build.OutputFile
/**
react-native bundle
with the correct arguments during the Android buildapply from: "../../node_modules/react-native/react.gradle"
line.*/
project.ext.react = [
entryFile: "index.js"
]
apply from: "../../node_modules/react-native/react.gradle"
/**
*/
def enableSeparateBuildPerCPUArchitecture = false
/**
*/
def enableProguardInReleaseBuilds = false
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
}
dependencies {
implementation(project(':react-native-firebase'))
implementation (project(':lottie-react-native'))
implementation (project(':react-native-fetch-blob'))
implementation (project(':react-native-camera'))
implementation(project(':react-native-maps')) {
exclude group: 'com.google.android.gms', module: 'play-services-base'
}
implementation project(':react-native-image-picker')
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation('com.android.support:appcompat-v7:28.0.0')
implementation 'com.facebook.react:react-native'
implementation('com.android.support:multidex:1.0.1')
implementation "com.google.android.gms:play-services-base:16.0.1"
implementation('com.google.firebase:firebase-core:16.0.7') {
exclude group: 'com.google.android.gms', module: 'play-services-base'
}
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
apply plugin: 'com.google.gms.google-services'
// N/A
android/settings.gradle
:// N/A
MainApplication.java
:// N/A
AndroidManifest.xml
:<!-- N/A -->
Environment
ADD_SOMETHING_HERE
e.g. iOS 10 or Android API 28N/A
N/A
N/A
React Native
version:0.50.3ADD_SOMETHING_HERE
React Native Firebase
library version:5.2.3ADD_SOMETHING_HERE
Firebase
module(s) you're using that has the issue:TypeScript
?N/A
ExpoKit
?ExpoKit
N/A
Think
react-native-firebase
is great? Please consider supporting the project with any of the below:React Native Firebase
andInvertase
on TwitterThe text was updated successfully, but these errors were encountered: