Skip to content
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

Closed
oguzhannkayaa opened this issue Mar 23, 2022 · 45 comments

Comments

@oguzhannkayaa
Copy link

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.

  • What went wrong:
    Execution failed for task ':app:checkDebugAarMetadata'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Could not find any matches for app.notifee:core:+ as no versions of app.notifee:core are available.
Searched in the following locations:
- file:/C:/test/.m2/repository/app/notifee/core/
- file:/C:/test/node_modules/react-native/android/app/notifee/core/maven-metadata.xml
- file:/C:/test/node_modules/jsc-android/dist/app/notifee/core/maven-metadata.xml
- https://dl.google.com/dl/android/maven2/app/notifee/core/maven-metadata.xml
- https://repo.maven.apache.org/maven2/app/notifee/core/maven-metadata.xml
- https://jcenter.bintray.com/app/notifee/core/maven-metadata.xml
- https://www.jitpack.io/app/notifee/core/maven-metadata.xml
Required by:
project :app > project :notifee_react-native

@mikehardy
Copy link
Contributor

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

@abewartech
Copy link

@mikehardy
Copy link
Contributor

@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

@Skullcan
Copy link

Skullcan commented Jun 7, 2022

@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'.

Could not find any matches for app.notifee:core:+ as no versions of app.notifee:core are available.

@mikehardy
Copy link
Contributor

🤔 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)

@Skullcan
Copy link

Skullcan commented Jun 7, 2022

Weird, maybe I'm missing something in the repo locations?

Full error is:

Could not determine the dependencies of task ':app:processDebugResources'.
Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
Could not find any matches for app.notifee:core:+ as no versions of app.notifee:core are available.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/app/notifee/core/maven-metadata.xml
- file:/C:/Users/skull/.m2/repository/app/notifee/core/
- file:/E:/projetos/emifmobile/node_modules/react-native/android/app/notifee/core/maven-metadata.xml
- file:/E:/projetos/emifmobile/node_modules/jsc-android/dist/app/notifee/core/maven-metadata.xml
- https://dl.google.com/dl/android/maven2/app/notifee/core/maven-metadata.xml
- https://jcenter.bintray.com/app/notifee/core/maven-metadata.xml
- https://www.jitpack.io/app/notifee/core/maven-metadata.xml
Required by:
project :app > project :notifee_react-native

Edited for clarity.
I'm gonna try a clean project just to be sure.
Edit:
Works perfectly in a clean project as you said.

@Skullcan
Copy link

Skullcan commented Jun 7, 2022

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.

sed -i -e $'s/google()/google()\\n maven { url "$rootDir/../node_modules/@notifee/react-native/android/libs" }/' android/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.
After I added this line in my build.gradle it builded succesfully:

maven { url "$rootDir/../node_modules/@notifee/react-native/android/libs" }

@mikehardy
Copy link
Contributor

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:

rootProject.allprojects {
repositories {
maven {
url "$rootDir/../node_modules/@notifee/react-native/android/libs"
}
}
}

...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

@bang9
Copy link
Contributor

bang9 commented Jun 7, 2022

@Skullcan, Which version are you using?

@Skullcan
Copy link

Skullcan commented Jun 7, 2022

I'm using the latest version, 5.3.0.
React native 0.68.2.

...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

I agree, very confusing, dunno why/what's happening.
But the problem only happens in this project, I have tried in other project and a fresh example. They both build fine w/o the line in the build.gradle.

@liamjones
Copy link
Contributor

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 node_modules directory for us.

The RN project has a findNodeModulesPath (https://github.com/facebook/react-native/blob/9eb2826f9beac5b7476f33e68803ca5a024867db/ReactAndroid/build.gradle#L189) to make this work more flexibly for different repo layouts. I'll try and find time to raise a PR that does this (unless someone else gets there first! 😄)

@mikehardy
Copy link
Contributor

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!

@eliw00d
Copy link

eliw00d commented Jul 1, 2022

I just ran into this because we have a pretty deeply nested monorepo structure, so my build.gradle has urls like:

url("$rootDir/../../../../node_modules/react-native/android")

meaning the one set by notifee is too shallow.

@mikehardy
Copy link
Contributor

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...

@Tohid1999
Copy link

Tohid1999 commented Nov 10, 2022

Still have this issue in notifee version 7.1.0 .
Could not find any matches for app.notifee:core:+ as no versions of app.notifee:core are available.

I use react-native version 0.70.4

@mikehardy please help :(

@ManAnRuck
Copy link

Same issue here
react-native: 0.70.4
7.1.0

System

System:
OS: macOS 13.0.1
CPU: (10) arm64 Apple M1 Max
Binaries:
Node: 14.19.1
Yarn: 1.22.19

@mikehardy
Copy link
Contributor

react-native: 0.70.4

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

@ManAnRuck
Copy link

an upgrade to 0.70.6 doesn't solve the issue.
it could be that's an issue with a combination of another package :/

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

@mikehardy
Copy link
Contributor

the best repro of this one might just be the steps to create, that is, something like:

1- npx react-native init NotifeeBreaksThisWay
2- cd NotifeeBreaksThisWay && yarn add @notifee/react-native
3- something something
4- yarn android

Just need to know what the something something is...

@luyx2412
Copy link

Same issues!

@NeoPCl
Copy link
Contributor

NeoPCl commented Dec 2, 2022

I also get this issue with the following error:

  • What went wrong:
    Could not determine the dependencies of task ':app:mergeReleaseNativeLibs'.

Could not resolve all task dependencies for configuration ':app:releaseRuntimeClasspath'.
Could not find any matches for app.notifee:core:+ as no versions of app.notifee:core are available.
Searched in the following locations:
- file:/home/p/Development/mobile-app/node_modules/react-native/android/app/notifee/core/maven-metadata.xml
- file:/home/p/Development/mobile-app/node_modules/jsc-android/dist/app/notifee/core/maven-metadata.xml
- https://repo.maven.apache.org/maven2/app/notifee/core/maven-metadata.xml
- https://dl.google.com/dl/android/maven2/app/notifee/core/maven-metadata.xml
- https://www.jitpack.io/app/notifee/core/maven-metadata.xml
Required by:
project :app > project :notifee_react-native

@sangle95
Copy link

sangle95 commented Dec 7, 2022

STILL GET THIS ISSUE, why is it still not fixed??

React-native: 0.70.6
7.2.0

BUILD FAILED in 29s

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 app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not determine the dependencies of task ':app:processDebugResources'.

Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
Could not find any matches for app.notifee:core:+ as no versions of app.notifee:core are available.
Searched in the following locations:
- file:/Users/sangle/.m2/repository/app/notifee/core/
- https://repo.maven.apache.org/maven2/app/notifee/core/maven-metadata.xml
- file:/Users/sangle/DATA/SoBanHang/repository/dev/fe-finan-app/node_modules/react-native/android/app/notifee/core/maven-metadata.xml
- file:/Users/sangle/DATA/SoBanHang/repository/dev/fe-finan-app/node_modules/jsc-android/dist/app/notifee/core/maven-metadata.xml
- https://sdk.smartlook.com/android/release/app/notifee/core/maven-metadata.xml
- https://repo.survicate.com/app/notifee/core/maven-metadata.xml
- https://dl.google.com/dl/android/maven2/app/notifee/core/maven-metadata.xml
- https://jcenter.bintray.com/app/notifee/core/maven-metadata.xml
- https://www.jitpack.io/app/notifee/core/maven-metadata.xml
Required by:
project :app > project :notifee_react-native

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

@mikehardy
Copy link
Contributor

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

@yaseen256
Copy link

Hi @mikehardy I am facing the same error as @sangle95
I have tried lower version of notifee 4.0.0
my react native version in 0.68.0
these are my buildScript configurations:
ext {
buildToolsVersion = "30.0.3"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
ndkVersion = "21.4.7075529"
kotlinVersion = '1.7.20'
}

@sangle95
Copy link

sangle95 commented Dec 7, 2022

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

@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.

@sangle95
Copy link

sangle95 commented Dec 7, 2022

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

@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:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext {
buildToolsVersion = "31.0.0"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
playServicesVersion = "17.0.0"
androidMapsUtilsVersion = "2.2.4"
ndkVersion = "20.1.5948944"
supportLibVersion = "31.0.0"
kotlinVersion = '1.5.0'

    if (System.properties['os.arch'] == "aarch64") {
        // For M1 Users we need to use the NDK 24 which added support for aarch64
        ndkVersion = "24.0.8215888"
    } else {
        // Otherwise we default to the side-by-side NDK version from AGP.
        ndkVersion = "21.4.7075529"
    }
}
repositories {
    google()
    jcenter()
    mavenCentral()
}
dependencies {
    classpath("com.android.tools.build:gradle:7.2.1")
    classpath("com.facebook.react:react-native-gradle-plugin")
    classpath("de.undercouch:gradle-download-task:5.0.1")
    classpath 'com.google.gms:google-services:4.3.5'
    classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.0'
    classpath 'com.google.firebase:perf-plugin:1.4.1'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

allprojects {
// configurations.all {
// resolutionStrategy {
// force 'com.facebook.react:react-native:0.70.6'
// }
// }
repositories {
mavenLocal()
mavenCentral {
// We don't want to fetch react-native from Maven Central as there are
// older versions over there.
content {
excludeGroup "com.facebook.react"
}
}
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
maven {
url "https://sdk.smartlook.com/android/release"
}
maven {
url 'https://repo.survicate.com'
}

    google()
    jcenter()
    maven { url 'https://www.jitpack.io' }
}

}

@mikehardy
Copy link
Contributor

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.

@sangle95
Copy link

sangle95 commented Dec 7, 2022

Thank you for your suggestion, let me try to add maven repository that points to the notifee in my gradle.

@muhamad-rizki
Copy link

maybe this could help someone, in my case I use jitpack repository, and the error says it get 521 response on jitpack side,
image
so I exclude app.notifee group on jitpack repository:

maven {
  url 'https://www.jitpack.io'
  
  // exclude notifee
  content {
    excludeGroup "app.notifee"
  }
}

@code-by
Copy link

code-by commented Dec 23, 2022

@muhamad-rizki
I have try your solution and got this:

> Task :notifee_react-native:stripReleaseDebugSymbols NO-SOURCE
Relying on FileTrees for ignoring empty directories when using @SkipWhenEmpty has been deprecated. This is scheduled to be removed in Gradle 8.0. Annotate the property inputFiles with @IgnoreEmptyDirectories or remove @SkipWhenEmpty. Consult the upgrading guide for further information: https://docs.gradle.org/7.4.1/userguide/upgrading_version_7.html#empty_directories_file_tree

> Task :app:lintVitalRelease FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:lintVitalRelease'.
> Lint infrastructure error
  Caused by: java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        ...

bundle.gradle:

    repositories {

        exclusiveContent {
            filter {
                includeGroup "com.facebook.react"
            }
            forRepository {
                maven {
                    url "$rootDir/../node_modules/react-native/android"
                }
            }
        }
        google()
        jcenter()
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
        mavenCentral {
            // We don't want to fetch react-native from Maven Central as there are
            // older versions over there.
            content {
                excludeGroup "com.facebook.react"
            }
        }
        maven {
            url 'https://www.jitpack.io'
            content {
                excludeGroup "app.notifee"
            }
        }
        maven { url "$rootDir/../node_modules/@notifee/react-native/android/libs" }
    }

dependencies:
"@notifee/react-native": "^5.0.3"
"react-native": "0.67.4"

@pawelkiszka
Copy link

@mikehardy Please take a look at this repository, in reference to your comment: #350 (comment)

Repository link: https://gitlab.com/pkiszka/notifeebreaksthisway

I didn't have to add any extra "something something" step, it breaks with only adding notifee dependency.
I was able to reproduce this error:

Could not find any matches for app.notifee:core:+ as no versions of app.notifee:core are available.

@muhamad-rizki
Copy link

@muhamad-rizki I have try your solution and got this:

> Task :notifee_react-native:stripReleaseDebugSymbols NO-SOURCE
Relying on FileTrees for ignoring empty directories when using @SkipWhenEmpty has been deprecated. This is scheduled to be removed in Gradle 8.0. Annotate the property inputFiles with @IgnoreEmptyDirectories or remove @SkipWhenEmpty. Consult the upgrading guide for further information: https://docs.gradle.org/7.4.1/userguide/upgrading_version_7.html#empty_directories_file_tree

> Task :app:lintVitalRelease FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:lintVitalRelease'.
> Lint infrastructure error
  Caused by: java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        ...

bundle.gradle:

    repositories {

        exclusiveContent {
            filter {
                includeGroup "com.facebook.react"
            }
            forRepository {
                maven {
                    url "$rootDir/../node_modules/react-native/android"
                }
            }
        }
        google()
        jcenter()
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
        mavenCentral {
            // We don't want to fetch react-native from Maven Central as there are
            // older versions over there.
            content {
                excludeGroup "com.facebook.react"
            }
        }
        maven {
            url 'https://www.jitpack.io'
            content {
                excludeGroup "app.notifee"
            }
        }
        maven { url "$rootDir/../node_modules/@notifee/react-native/android/libs" }
    }

dependencies: "@notifee/react-native": "^5.0.3" "react-native": "0.67.4"

can you

@muhamad-rizki I have try your solution and got this:

> Task :notifee_react-native:stripReleaseDebugSymbols NO-SOURCE
Relying on FileTrees for ignoring empty directories when using @SkipWhenEmpty has been deprecated. This is scheduled to be removed in Gradle 8.0. Annotate the property inputFiles with @IgnoreEmptyDirectories or remove @SkipWhenEmpty. Consult the upgrading guide for further information: https://docs.gradle.org/7.4.1/userguide/upgrading_version_7.html#empty_directories_file_tree

> Task :app:lintVitalRelease FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:lintVitalRelease'.
> Lint infrastructure error
  Caused by: java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        ...

bundle.gradle:

    repositories {

        exclusiveContent {
            filter {
                includeGroup "com.facebook.react"
            }
            forRepository {
                maven {
                    url "$rootDir/../node_modules/react-native/android"
                }
            }
        }
        google()
        jcenter()
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
        mavenCentral {
            // We don't want to fetch react-native from Maven Central as there are
            // older versions over there.
            content {
                excludeGroup "com.facebook.react"
            }
        }
        maven {
            url 'https://www.jitpack.io'
            content {
                excludeGroup "app.notifee"
            }
        }
        maven { url "$rootDir/../node_modules/@notifee/react-native/android/libs" }
    }

dependencies: "@notifee/react-native": "^5.0.3" "react-native": "0.67.4"

can you show more the error log?

@rvenky125
Copy link

I've removed these and it got worked
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.configureondemand=true

@pradeepdev001
Copy link

pradeepdev001 commented Mar 9, 2023

Just comment out only org.gradle.configureondemand=true from {Your-Project}/android/gradle.properties.

Follow for more details: Link

@pierguinzani
Copy link

i've just add this code on android/build.gradle and worked

allprojects {
...
    repositories {
...
        maven {
            url "$rootDir/../node_modules/@notifee/react-native/android/libs"
        }
    }
}

@hungvu193
Copy link
Contributor

Just comment out only org.gradle.configureondemand=true from {Your-Project}/android/gradle.properties.

Follow for more details: Link

This worked! Thank you!

@Equilibriumty
Copy link

i've just add this code on android/build.gradle and worked

allprojects {
...
    repositories {
...
        maven {
            url "$rootDir/../node_modules/@notifee/react-native/android/libs"
        }
    }
}

this worked for me

@rafaelpadovani
Copy link

rafaelpadovani commented Aug 1, 2023

This is happening on "react-native": "0.71.4" and "@notifee/react-native": "^7.8.0"
According to this thread here it should work as expected in a clean project, because after version 7.0.0 there's no longer need to include maven url to notifee, but I'm still facing the following issue on android build:

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:processDebugResources'.
> Could not resolve all task dependencies for configuration ':app:DebugRuntimeClasspath'.
   > Could not find any matches for app.notifee:core:+ as no versions of app.notifee:core are available.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/app/notifee/core/maven-metadata.xml
       - https://dl.google.com/dl/android/maven2/app/notifee/core/maven-metadata.xml
       - https://www.jitpack.io/app/notifee/core/maven-metadata.xml
       - https://appboy.github.io/appboy-android-sdk/sdk/app/notifee/core/maven-metadata.xml
       - https://storage.googleapis.com/logrocket-maven/app/notifee/core/maven-metadata.xml
       - https://zendesk.jfrog.io/zendesk/repo/app/notifee/core/maven-metadata.xml
       - https://oss.sonatype.org/content/repositories/snapshots/app/notifee/core/maven-metadata.xml
       - file:/Users/rafaelpadovani/Documents/nimbus/node_modules/jsc-android/dist/app/notifee/core/maven-metadata.xml
     Required by:
         project :app
         project :app > project :notifee_react-native

build.gradle

buildscript {
    ext {
        buildToolsVersion = "33.0.0"
        minSdkVersion = 21
        compileSdkVersion = 33
        targetSdkVersion = 33
        // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
        ndkVersion = "23.1.7779620"
        kotlinVersion = "1.7.10"
        AsyncStorage_next_roomVersion = '2.4.3'
    }
    repositories {
        google()
        mavenCentral()
        jcenter()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:7.3.1")
        classpath("com.facebook.react:react-native-gradle-plugin")
        // Kotlin
        classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
        // Google Services
        classpath("com.google.gms:google-services:4.3.15")
        // Crashlytics Gradle plugin
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.4'
        // Performance Monitoring Plugin
        classpath 'com.google.firebase:perf-plugin:1.4.2'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    configurations.all {
        resolutionStrategy {
            // Remove this override in 0.65+, as a proper fix is included in react-native itself.
            force "com.facebook.react:react-native:" + REACT_NATIVE_VERSION
        }
    }

    repositories {
        mavenCentral()
        google()
        maven { url 'https://www.jitpack.io' }
        maven { url "https://appboy.github.io/appboy-android-sdk/sdk" }
        maven { url "https://storage.googleapis.com/logrocket-maven/" }
        maven { url 'https://zendesk.jfrog.io/zendesk/repo' }
    }
}

Could anyone help with this?

@pierguinzani
Copy link

pierguinzani commented Aug 21, 2023

i've just add this code on android/build.gradle and worked

allprojects {
...
    repositories {
...
        maven {
            url "$rootDir/../node_modules/@notifee/react-native/android/libs"
        }
    }
}

I'm using expo bare workflow and I needed to make this configuration for the notifee to work in my project

@dev-mohitbeniwal
Copy link

Just comment out only org.gradle.configureondemand=true from {Your-Project}/android/gradle.properties.

Follow for more details: Link

This is the only configuration change we need. After commenting the org.gradle.configureondemand=true I was able to build the project even without adding the maven repo reference for the notifee:

maven {
            url "$rootDir/../node_modules/@notifee/react-native/android/libs"
        }

@ludwig-pro
Copy link

if none of the above solutions works, check if you have, at a higher level, the following code somewhere in the settings.gradle file

dependencyResolutionManagement {
  repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS) // <--- THAT

you will override the repository settings with repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS... it was the case for me, due to an old custom expo config :/

@GuidoGagliardini
Copy link

i've just add this code on android/build.gradle and worked

allprojects {
...
    repositories {
...
        maven {
            url "$rootDir/../node_modules/@notifee/react-native/android/libs"
        }
    }
}

the best solution! Thanks.

@omedkane
Copy link

omedkane commented Mar 6, 2024

Here's a plugin that adds the above solution automatically to build.gradle : https://github.com/omedkane/notifee-expo-plugin
add this to your app.json in the plugins array : "./plugins/notifee-mod.js"
Then run :
npx expo prebuild --clean

@viiicky
Copy link

viiicky commented Mar 7, 2024

Here's a plugin that adds the above solution automatically to build.gradle : https://github.com/omedkane/notifee-expo-plugin add this to your app.json in the plugins array : "./plugins/notifee-mod.js"

Thanks. This worked. I also had to do npx expo prebuild --clean though.

@zouinekh
Copy link

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:

rootProject.allprojects {
repositories {
maven {
url "$rootDir/../node_modules/@notifee/react-native/android/libs"
}
}
}

...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

i've just add this code on android/build.gradle and worked

allprojects {
...
    repositories {
...
        maven {
            url "$rootDir/../node_modules/@notifee/react-native/android/libs"
        }
    }
}

bro thanks a lot !!!
it works for me
"react-native": "0.72.6",
@notifee/react-native": "^5.3.0",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests