Проблемы со сборкой нативного приложения expo response для Android из-за экспо-уведомлений

Когда я пытаюсь создать свое экспо-приложение для Android, с ним возникает проблема из-за экспо-уведомлений (однако сборка iOS выполняется успешно). Задача компиляции этой библиотеки не выполняется с таким выводом:


> Task :expo-notifications:compileReleaseKotlin FAILED
[stderr] e: /home/expo/workingdir/build/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/service/NotificationsService.kt: (418, 74): Unresolved reference: S
[stderr] e: /home/expo/workingdir/build/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/service/NotificationsService.kt: (418, 91): Unresolved reference: FLAG_MUTABLE
[stderr] e: /home/expo/workingdir/build/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/service/NotificationsService.kt: (454, 74): Unresolved reference: S
[stderr] e: /home/expo/workingdir/build/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/service/NotificationsService.kt: (454, 91): Unresolved reference: FLAG_MUTABLE
[stderr] e: /home/expo/workingdir/build/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/service/delegates/ExpoSchedulingDelegate.kt: (101, 53): Unresolved reference: S
[stderr] e: /home/expo/workingdir/build/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/service/delegates/ExpoSchedulingDelegate.kt: (101, 71): Unresolved reference: canScheduleExactAlarms
> Task :react-native-gesture-handler:compileReleaseKotlin
w: /home/expo/workingdir/build/node_modules/react-native-gesture-handler/android/lib/src/main/java/com/swmansion/gesturehandler/FlingGestureHandler.kt: (30, 17): 'constructor Handler()' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gesture-handler/android/lib/src/main/java/com/swmansion/gesturehandler/GestureHandler.kt: (676, 11): Name shadowed: size
w: /home/expo/workingdir/build/node_modules/react-native-gesture-handler/android/lib/src/main/java/com/swmansion/gesturehandler/LongPressGestureHandler.kt: (44, 17): 'constructor Handler()' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gesture-handler/android/lib/src/main/java/com/swmansion/gesturehandler/TapGestureHandler.kt: (73, 17): 'constructor Handler()' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gesture-handler/android/lib/src/main/java/com/swmansion/gesturehandler/TapGestureHandler.kt: (82, 17): 'constructor Handler()' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt: (439, 30): 'RNGestureHandlerEnabledRootView' is deprecated. Use <GestureHandlerRootView /> component instead. Check gesture handler installation instructions in documentation for more information.
w: /home/expo/workingdir/build/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt: (454, 33): 'resolveRootTagFromReactTag(Int): Int' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt: (479, 19): 'RNGestureHandlerEnabledRootView' is deprecated. Use <GestureHandlerRootView /> component instead. Check gesture handler installation instructions in documentation for more information.
w: /home/expo/workingdir/build/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt: (505, 33): 'resolveRootTagFromReactTag(Int): Int' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt: (520, 67): Parameter 'motionEvent' is never used
w: /home/expo/workingdir/build/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootHelper.kt: (80, 42): Parameter 'disallowIntercept' is never used
w: /home/expo/workingdir/build/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootHelper.kt: (112, 28): Parameter 'viewTag' is never used
w: /home/expo/workingdir/build/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootView.kt: (54, 23): 'RNGestureHandlerEnabledRootView' is deprecated. Use <GestureHandlerRootView /> component instead. Check gesture handler installation instructions in documentation for more information.
> Task :app:bundleReleaseJsAndAssets
info Writing bundle output to:, /home/expo/workingdir/build/android/app/build/generated/assets/react/release/index.android.bundle
info Writing sourcemap output to:, /home/expo/workingdir/build/android/app/build/generated/sourcemaps/react/release/index.android.bundle.map
info Done writing bundle output
info Done writing sourcemap output
info Copying 59 asset files
info Done copying assets
w: Detected multiple Kotlin daemon sessions at build/kotlin/sessions
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings
434 actionable tasks: 434 executed
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':expo-notifications:compileReleaseKotlin'.
[stderr] > A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
[stderr]    > Compilation error. See log for more details
[stderr] * Try:
[stderr] 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.
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 5m 9s
Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.

Я попробовал предложенное здесь решение по обновлению RN с 0.64.3 до 0.64.4 патченной версии, но это не дало никакого эффекта. Но после удаления expo-уведомлений из package.json и комментирования всех мест, где я использую уведомления, сборка прошла успешно. Так что я предполагаю, что это могут быть какие-то проблемы с библиотекой экспо-уведомлений, конфликт версий или что-то в этом роде. Кто-нибудь сталкивался с такой проблемой? Спасибо!

Версии библиотек

"react": "17.0.1",
"react-native": "0.64.4",
"expo": "^44.0.0",
"expo-notifications": "^0.15.2",

Мой eas.json

{
  "cli": {
    "version": ">= 2.6.0"
  },
  "build": {
    "development": {
      "developmentClient": true,
      "distribution": "internal"
    },
    "preview": {
      "distribution": "internal"
    },
    "production": {
        "ios": {
            "image": "macos-monterey-12.4-xcode-13.4"
        },
        "android": {
            "image": "ubuntu-18.04-jdk-8-ndk-r19c"
        }
    }
  },
  "submit": {
    "production": {
        "ios": {
            "appleId": "*****",
            "ascAppId": "*****",
            "appleTeamId": "*****"
        }
    }
  }
}
0
0
487
1
Перейти к ответу Данный вопрос помечен как решенный

Ответы 1

Ответ принят как подходящий

Я нашел, как это исправить, вы должны запустить эти команды

expo doctor
expo doctor --fix-dependencies

После этих команд он успешно строится

Другие вопросы по теме