Gradle Task fails on building the app.
A problem occurred configuring project ':@react-native-firebase_ml-vision'.
compileSdkVersion is not specified.
This is happening post release of new version 7.4.1 for @react-native-firebase/ml-vision
Build succeeds when using previous version 7.3.2
Click To Expand
**`react-native info` output:**
System:
OS: macOS 10.15.5
CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
Memory: 125.05 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.9.0 - /usr/local/bin/node
npm: 6.10.3 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.6, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK:
API Levels: 23, 24, 25, 26, 27, 28, 29, 30
Build Tools: 23.0.1, 27.0.3, 28.0.0, 28.0.3, 29.0.2, 30.0.1
System Images: android-28 | Intel x86 Atom_64, android-28 | Google Play Intel x86 Atom, android-29 | Google APIs Intel x86 Atom
IDEs:
Android Studio: 4.0 AI-193.6911.18.40.6514223
Xcode: 11.6/11E708 - /usr/bin/xcodebuild
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.2 => 0.61.2
npmGlobalPackages:
react-native-cli: 2.0.1
- **Platform that you're experiencing the issue on**:
- [ ] iOS
- [x] Android
- [ ] **iOS** but have not tested behavior on Android
- [ ] **Android** but have not tested behavior on iOS
- [ ] Both
- **`react-native-firebase` version you're using that has this issue:**
- `e.g. 5.4.3`
- **`Firebase` module(s) you're using that has the issue:**
- `e.g. Instance ID`
- **Are you using `TypeScript`?**
- `Y/N` & `VERSION`
React Native Firebase
and Invertase
on Twitter for updates on the library.I had this issue with react-native-firebase-storage, and now I am stuck with the same problem on react-native-firebase-firestore.
For now, downgrading the library version did the trick!
Sure, but that's not a great solution :-). Hello @biancaFarcasSP and sorry for the hassle.
I centralized SDK version management with the latest release you can see it here:
https://github.com/invertase/react-native-firebase/commit/728f41863832d21230c6eb1f55385284fef03c09
@react-native-firebase/app
is a strict dependency of @react-native-firebase/<any other package>
so it should be valid to expect ../app/package.json
to exist.
How is your installation of @react-native-firebase/
structured such that app and ml-vision are not next to each other?
If we solve that problem, the build will be fine.
Hi @mikehardy, I'm having similar issues at the moment. How do I see my installation of @react-native-firebase
structure?
All good! I upgraded all @react-native-firebase
dependencies to their latest versions using yarn.
{
"@react-native-firebase/app": "^8.4.0",
"@react-native-firebase/auth": "^9.1.1",
"@react-native-firebase/crashlytics": "^8.4.1",
"@react-native-firebase/dynamic-links": "^7.1.2",
"@react-native-firebase/firestore": "^7.0.1",
"@react-native-firebase/functions": "^7.1.2",
"@react-native-firebase/messaging": "^7.1.5",
"@react-native-firebase/storage": "^7.2.2"
}
I wonder if this is an npm vs yarn thing? That would not be expected, but software is always capable of surprising me...
The structure I'm talking about is:
./node_modules/
./node_modules/@react-native-firebase/
./node_modules/@react-native-firebase/app <-- app should be here, it has package.json with versions
./node_modules/@react-native-firebase/<all other packages> <-- these reference ../app/package.json
I'm not too sure about npm vs yarn.. What I do know is upgrading @react-native-firebase/app
and other packages to the latest version helped. @biancaFarcasSP would need to give the structure you are referring to and the package.json.
Yes - a related bug was resolved by someone else by making sure all versions were updated to the same, and were the same across a monorepo (so that different versions didn't get installed in unexpected places - root level or package level)
@mikehardy I upgraded all firebase dependencies from package.json and it works now. However, it may be a good idea to add a note on Readme about it. It would save others some time if they want to add new firebase module to existing project.
I agree totally @biancaFarcasSP - first we needed to figure out exactly what was failing though, to provide specific instruction that would work - your success report for that fix is enough to go on in combination with the other reports to do that now I think, thanks for reporting back
I'm going to alter the title on this one and pin it to top so it's easy for people to see, but I'm also going to resolve this as I think we found the root cause and with peerDependencies set correctly I don't believe it is a code problem specifically, but I did make a docs PR to hopefully publicize it more
I appreciate everyone working with me (and each other) on this to try to pin it down
If there is some other failure mode besides not upgrading all the packages to follow peerDependencies then I will certainly re-open and we can figure it out
In my case, it is because my own app's package.json is requiring a lower version of react-native-firebase/app
, thus the peer-dependency of all-other-packages are resolved to the lower version (not sure why it isn't resolved to higher version from the other-package)
Upgrading the app's package.json's react-native-firebase/app
solve the issue for me
For now, downgrading the library version did the trick!
This works everytime with firebase ..
Can someone for the love of god give me the yarn command to find out the dependencies for a particular version of package?
I know about yarn info
@sbrighiu I find yarn upgrade --latest
actually works just about every time (or a quick revert of one version of one bleeding edge package then fixes it up) vs downgrading firebase, but that's me.
I think this might help https://www.npmjs.com/package/install-peerdeps but in general the way to find out if your peer dependencies are off is that when you do a yarn
it complains at you?
yeah... but when you're working with react native and expo and .. some old 3rd party packages, it is better to avoid automation :)
No disagreement from me there @sbrighiu
I have these two commands spread out in my monorepo one at top, the rest at package level, one is to scan for what would happen (then I can go see the release notes) and one makes it happen - with a couple specific packages hard-downgraded)
(base) mike@kunashir:~/work/Kullki/ksocialscore (rebranding) % cat ./package.json */*/package.json|egrep "package-outdated|package-update"
"package-outdated": "(yarn outdated || true) && npx lerna run package-outdated",
"package-update": "yarn upgrade --latest && npx lerna run package-update",
"package-outdated": "yarn outdated || true",
"package-update": "yarn upgrade --latest",
"package-outdated": "yarn outdated || true",
"package-update": "yarn upgrade --latest && yarn add [email protected]",
"package-outdated": "yarn outdated || true",
"package-update": "yarn upgrade --latest",
"package-outdated": "yarn outdated || true && (cd ios && pod repo update && pod outdated) || true",
"package-update": "yarn upgrade --latest && yarn add metro@^0.62.0 metro-react-native-babel-preset@^0.62.0 && (cd ios && pod install --repo-update && pod update) || true",
uh :( .. add some patch_package patches and this could be fun-er
Plenty of those. And the work project moves right along. It's all a house of cards though, don't forget npx react-native-clean-project
in your CI pipeline ;-)
Here is a nice one :) made it myself
"screenshot:android": "adb exec-out screencap -p > ~/Desktop/android-$(date \"+%Y-%m-%d_%H-%M-%S\")_$(jot -r 1 2000 65000).png",
also,
"postinstall": "patch-package --include 'package.json' && npx pod-install && npx jetify",
"clean-everything": "watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && rm -f package-lock.json && rm -f yarn.lock && npm cache verify && npm install && expo r -c"
as it was already mentioned upgrading the packages versions is the solution , dunno what's with the team behind but they pomp new versions almost every week
It's a massive project, and it's the community mostly proposing PRs, then it's me working to integrate them as quickly as possible and voila, we've got bugfixes and new features coming out all the time :-). I do wish sometimes that the upstream firebase team would slow down a bit, we're still behind them with regards to covering all their APIs...
I used fixed version in package.json with @react-native-firebase/*
@6.3.4
After add @react-native-firebase/remote-config
without specify version, it's installed as @9.x.x
That lead to the error.
I must force its version to @react-native-firebase/[email protected]
....
In my experience, I would prevent the major & minor version, only patch version was allowed to update.
@luatnd that is terrible advice. Update all packages to current stable. Don't downgrade.
@luatnd that is terrible advice. Update all packages to current stable. Don't downgrade.
In the past, I have some issue with version conflicting between @react-native-firebase/* packages,
Every time we upgrade a new version, I need to re-test all the test cases, I intend to do this only a few times per year.
Version conflict problems happen if you don't upgrade them all.
Your release cycle is not my concern, I'm a library maintainer. I merge bugfixes and release them. New versions contain more bugfixes. You can do what you like but you should not recommend to library users to downgrade and thus not obtain bug fixes. That's terrible advice and I will call it such
Similar issue here.
* What went wrong:
A problem occurred evaluating project ':react-native-firebase_firestore'.
> :react-native-firebase_firestore has not defined a default in project.ext.'react-native'.versions.android.compileSdk in its build.gradle file.
Module packge versions:
"@react-native-firebase/app": "^7.3.1",
"@react-native-firebase/firestore": "^7.8.7",
"@react-native-firebase/auth": "^7.1.0",
"@react-native-firebase/messaging": "^7.9.1",
"@react-native-firebase/remote-config": "^7.2.2",
@joaom182 old versions, upgrade - the problem will resolve
Most helpful comment
All good! I upgraded all
@react-native-firebase
dependencies to their latest versions using yarn.