invertase / notifee

⚛️ A feature rich notifications library for React Native.
https://notifee.app
Apache License 2.0
1.87k stars 226 forks source link

Can't build my app localy with Expo #1145

Closed PanZWarzywniaka closed 5 days ago

PanZWarzywniaka commented 5 days ago

Hi there,

React Native newbie here.

I can build my Notifee app using eas build: eas build --platform android --profile development But it doesn't work when I try to build localy i.e., npx expo run:android.

I double checkd the installation page to see if there are any compatiblity problems but cannot spot the fault. I have

My logs:

``` $ npx expo run:android › Skipping dev server › Building app... Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details Configuration on demand is an incubating feature. > Configure project :app ℹ️ Applying gradle plugin 'expo-dev-launcher-gradle-plugin' (expo-dev-launcher@4.0.28) Warning: SDK processing. This version only understands SDK XML versions up to 3 but an SDK XML file of version 4 was encountered. This can happen if you use versions of Android Studio and the command-line tools that were released at different times. > Configure project :notifee_react-native :notifee_react-native @notifee/react-native found at /home/olek/IT/bulbs/apps/sleep-bright-app/node_modules/@notifee/react-native :notifee_react-native package.json found at /home/olek/IT/bulbs/apps/sleep-bright-app/node_modules/@notifee/react-native/package.json :notifee_react-native:version set from package.json: 9.1.2 (9,1,2 - 9001002) :notifee_react-native:android.compileSdk using custom value: 34 :notifee_react-native:android.targetSdk using custom value: 34 :notifee_react-native:android.minSdk using custom value: 23 :notifee_react-native:reactNativeAndroidDir /home/olek/IT/bulbs/apps/sleep-bright-app/node_modules/react-native/android > Configure project :expo Using expo modules - expo-asset (10.0.10) - expo-av (14.0.7) - expo-constants (16.0.2) - expo-dev-client (4.0.28) - expo-dev-launcher (4.0.28) - expo-dev-menu (5.0.22) - expo-device (6.0.2) - expo-file-system (17.0.1) - expo-font (12.0.10) - expo-json-utils (0.13.1) - expo-keep-awake (13.0.2) - expo-manifests (0.14.3) - expo-modules-core (1.12.26) - expo-splash-screen (0.27.6) - expo-system-ui (3.0.7) - expo-web-browser (13.0.3) > Configure project :react-native-reanimated Android gradle plugin: 8.2.1 Gradle: 8.8 FAILURE: Build failed with an exception. * What went wrong: Could not determine the dependencies of task ':app:processDebugResources'. > Could not resolve all 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://oss.sonatype.org/content/repositories/snapshots/app/notifee/core/maven-metadata.xml - https://repo.maven.apache.org/maven2/app/notifee/core/maven-metadata.xml - file:/home/olek/IT/bulbs/apps/sleep-bright-app/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://www.jitpack.io/app/notifee/core/maven-metadata.xml - file:/home/olek/IT/bulbs/apps/sleep-bright-app/node_modules/react-native/android/app/notifee/core/maven-metadata.xml Required by: project :app > project :notifee_react-native * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. > Get more help at https://help.gradle.org. BUILD FAILED in 44s 15 actionable tasks: 5 executed, 10 up-to-date Error: /home/olek/IT/bulbs/apps/sleep-bright-app/android/gradlew app:assembleDebug -x lint -x test --configure-on-demand --build-cache -PreactNativeDevServerPort=8081 -PreactNativeArchitectures=x86_64,arm64-v8a exited with non-zero code: 1 Error: /home/olek/IT/bulbs/apps/sleep-bright-app/android/gradlew app:assembleDebug -x lint -x test --configure-on-demand --build-cache -PreactNativeDevServerPort=8081 -PreactNativeArchitectures=x86_64,arm64-v8a exited with non-zero code: 1 at ChildProcess.completionListener (/home/olek/IT/bulbs/apps/sleep-bright-app/node_modules/@expo/spawn-async/build/spawnAsync.js:42:23) at Object.onceWrapper (node:events:633:26) at ChildProcess.emit (node:events:518:28) at maybeClose (node:internal/child_process:1105:16) at ChildProcess._handle.onexit (node:internal/child_process:305:5) ... at spawnAsync (/home/olek/IT/bulbs/apps/sleep-bright-app/node_modules/@expo/spawn-async/build/spawnAsync.js:7:23) at spawnGradleAsync (/home/olek/IT/bulbs/apps/sleep-bright-app/node_modules/@expo/cli/build/src/start/platforms/android/gradle.js:96:48) at assembleAsync (/home/olek/IT/bulbs/apps/sleep-bright-app/node_modules/@expo/cli/build/src/start/platforms/android/gradle.js:74:18) at runAndroidAsync (/home/olek/IT/bulbs/apps/sleep-bright-app/node_modules/@expo/cli/build/src/run/android/runAndroidAsync.js:45:37) ```

Any help highly appreciated!

mikehardy commented 5 days ago

* What went wrong:
Could not determine the dependencies of task ':app:processDebugResources'.
> Could not resolve all 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://oss.sonatype.org/content/repositories/snapshots/app/notifee/core/maven-metadata.xml
       - https://repo.maven.apache.org/maven2/app/notifee/core/maven-metadata.xml
       - file:/home/olek/IT/bulbs/apps/sleep-bright-app/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://www.jitpack.io/app/notifee/core/maven-metadata.xml
       - file:/home/olek/IT/bulbs/apps/sleep-bright-app/node_modules/react-native/android/app/notifee/core/maven-metadata.xml
     Required by:
         project :app > project :notifee_react-native

no versions of app.notifee:core are available

https://github.com/invertase/notifee/issues?q=no+versions+of+app.notifee%3Acore+are+available

Something like this should work: https://github.com/invertase/notifee/issues/808#issuecomment-2175934609

It's a common problem unfortunately, but this is a duplicate - one of the comments in one of those issues will get the extra maven repository (pointing into our node_modules notifee directory...) added to your android gradle build then it will work

PanZWarzywniaka commented 5 days ago

Thank you, this solution worked!

mikehardy commented 4 days ago

Glad to hear it - I have a goal of restructuring the repo so that it doesn't have an internal maven repo everyone has to depend on, that is I want it to just be normal java / kotlin source files like other modules and then this issue will go away completely, but that's still for the future. Good luck with your project