-
Notifications
You must be signed in to change notification settings - Fork 244
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 find any matches for app.notifee:core:+ as no versions of app.notifee:core are available. #350
Comments
Hi there @oguzhan10 - this step has been missed: https://notifee.app/react-native/docs/installation#2-android-add-local-maven-repository I have a "install notifee from scratch" demonstration script that shows how to do the full integration and the step is performed (via scripting) right here https://github.com/mikehardy/rnfbdemo/blob/25022e4051a759cfa9ca69ebb353db25d7927cc9/notifee-demo.sh#L50-L54 If you run notifee-demo.sh it will generate an app that works, and following the installation instructions or example should get you through this |
https://notifee.app/react-native/docs/installation#2-android-add-local-maven-repository the link no longer exists |
@abewartech it is no longer necessary in current versions because of the fine work here #414 by @bang9 - update to current version and the install is just like a normal react-native module now, even though there is an aar inside of it |
Still failing for me, dunno why, just added to the project and got this error trying to run npx react-native run-android: Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
|
🤔 hmm - the commit was released as version 5.3.0 of the react-native module. It works for us in local testing (and for me in a commercial project) |
Weird, maybe I'm missing something in the repo locations? Full error is:
Edited for clarity. |
Ok, after further analyzing the error I found the problem. Reading your response about a script here I noticed that you had a mave url manually added in the build.gradle.
Then I went to check the PR made by @bang9 #414 and indeed there's a comment here talking about a error-prone install step that could be avoided. So with this info, I went back to my build.gradle and noticed that the installation process didn't added the line in my build.gradle.
|
Okay - but the problem is, that's not supposed to be necessary anymore 😆 - #414 was specifically about removing the need for that. Gradle should - during configuration - automatically apply it: notifee/packages/react-native/android/build.gradle Lines 90 to 96 in 4103b37
...and with 5.3.0 I was able to remove the entry I had added in my project's android/build.gradle, and the build still worked. Very confusing |
@Skullcan, Which version are you using? |
I'm using the latest version, 5.3.0.
I agree, very confusing, dunno why/what's happening. |
We ran into this issue upgrading to 5.3.0 due to running in a monorepo - the relative URL is incorrect for the location of our The RN project has a |
Very interesting! I am also in a monorepo but the react-native module is down at the package level so this didn't show up for me, I can see how it would though. A PR would be fantastic if you have time! |
I just ran into this because we have a pretty deeply nested monorepo structure, so my build.gradle has urls like:
meaning the one set by notifee is too shallow. |
Perhaps an ext variable (or maybe one already exists?) that sets the react-native root path, with the current one as the fallback/default, and we dereference based on this configured-or-default path? Could work as a PR... |
Still have this issue in notifee version 7.1.0 . I use react-native version 0.70.4 @mikehardy please help :( |
Same issue here SystemSystem: |
0.70.6 is out now, for what it's worth You can always try the workaround: #350 (comment) I'd need to see a reproduction to understand why it's happening as it doesn't seem to happen to my builds 🤔 https://stackoverflow.com/help/minimal-reproducible-example |
an upgrade to 0.70.6 doesn't solve the issue. the combination of #350 (comment) and #561 (comment) fixes the issue for me If I find some time, I will try to create a reproduction repo |
the best repro of this one might just be the steps to create, that is, something like: 1- Just need to know what the something something is... |
Same issues! |
I also get this issue with the following error:
|
STILL GET THIS ISSUE, why is it still not fixed?? React-native: 0.70.6
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. FAILURE: Build failed with an exception.
It makes me stuck all day and still don't have a solution, this doesn't help: #350 (comment) Please help to fix this @mikehardy |
Your comment is kind of abusive, yes? It feels like yelling Not a kind way to access help, it has certainly not motivated me to want to help |
Hi @mikehardy I am facing the same error as @sangle95 |
@mikehardy Oh. I'm really sorry I couldn't contain my emotions. I have tried many ways but still can't solve the problem. We are in dire need of pushing a new update to users, but we are stuck here for 2 days, could you please help me to solve this problem. |
Here is my build.gradle:
buildscript {
} allprojects {
} |
You don't appear to have the maven repository that points to the notifee nide modules directory in there. It's the workaround that will make things build for you. |
Thank you for your suggestion, let me try to add maven repository that points to the notifee in my gradle. |
I've removed these and it got worked |
Just comment out only org.gradle.configureondemand=true from {Your-Project}/android/gradle.properties. Follow for more details: Link |
i've just add this code on android/build.gradle and worked
|
This worked! Thank you! |
this worked for me |
This is happening on
Could anyone help with this? |
I'm using expo bare workflow and I needed to make this configuration for the notifee to work in my project |
This is the only configuration change we need. After commenting the
|
if none of the above solutions works, check if you have, at a higher level, the following code somewhere in the settings.gradle file
you will override the repository settings with |
the best solution! Thanks. |
Here's a plugin that adds the above solution automatically to build.gradle : https://github.com/omedkane/notifee-expo-plugin |
Thanks. This worked. I also had to do |
bro thanks a lot !!! |
this works by adding url "$rootDir/../node_modules/@notifee/react-native/android/libs", but how about expo? the strange thing is that on my colleague's machine building works out of the box with Expo without adding this line, for me, it doesn't work (same repo), any ideas thanks? |
This issue still exists. Here is the config plugin for expo. // withNotifeeAndroidFix.js
const { withProjectBuildGradle } = require("@expo/config-plugins");
const generateCode = require("@expo/config-plugins/build/utils/generateCode");
// https://github.com/invertase/notifee/issues/350
const notifeeAndroidWorkaroundCode = `
maven {
url "$rootDir/../node_modules/@notifee/react-native/android/libs"
}
`;
/** @type {import('expo/config-plugins').ConfigPlugin} */
module.exports = (expoConfig) => {
return withProjectBuildGradle(expoConfig, async (config) => {
const { contents } = generateCode.mergeContents({
newSrc: notifeeAndroidWorkaroundCode,
tag: "notifieeAndroidWorkaround",
src: config.modResults.contents,
anchor: /maven\s*\{\s*url\s*'https:\/\/www\.jitpack\.io'\s*\}/,
comment: "//",
offset: 1,
});
config.modResults.contents = contents;
return config;
});
}; // app.json
"plugins": [
"./withNotifeeAndroidFix",
], |
@SohelIslamImran thanks, the strange thing is: that building it from android studio works fine, but doing it from the command line eg |
@SohelIslamImran thanks a lot!
Try to add to app.json plugin like this:
|
Thank you, I also use expo bare, fixed this problem by adding the above maven url |
Sometimes you find gems on the internet, thanks a lot. |
Thanks , works . |
You saved my day, thanks man <3 ! But is there a reason why we need to do this? Maybe the notifee docs are not updated? |
@Goutham-dc no, there is no reason I understand - related + still open issue here with commend showing my last analysis: #799 (comment) Bottom line: it is not supposed to be necessary, we have logic in the android build script that should add the repo for you. Note from same issue you can also just use the standard |
I believe that this should be explicitly stated somewhere on the docs. |
@brianMxBm PRs happily merged - expo support is from the community, we need folks that use Expo - so they propose docs changes that they know actually work since they use them - to propose PRs https://github.com/invertase/notifee/blob/main/docs-react-native/react-native/docs/installation.md#expo-support |
This works great for me :) thank you, however has anyone tried to wrap this code up nicely? So this widely accessible to everyone |
This solved the problem for me. I'm using Expo SDK 52 (52.0.18) and RN 0.76.5 |
When I start to run my project I get this error in terminal.
"react-native": "^0.66.0",
"@notifee/react-native": "^5.0.2",
gradle version 7.0
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
Execution failed for task ':app:checkDebugAarMetadata'.
The text was updated successfully, but these errors were encountered: