react-native-background-geolocation: Android EAS: ':react-native-background-geolocation-android' could not be found in root project

Your Environment

  • Plugin versions: “expo-gradle-ext-vars”: “~0.1.1”, “react-native-background-fetch”: “~4.1.9”, “react-native-background-geolocation”: “~4.10.1”,
  • Platform: Android EAS
  • OS version: macOS Monterey 12.6
  • Device manufacturer / model: Macbook Pro Apple M1 Max
  • React Native version (react-native -v): 0.71.3
  • Plugin config
import { ConfigContext, ExpoConfig } from "expo/config";
 
export default ({ config }: ConfigContext): ExpoConfig => ({
  ...config,
  owner: "new-driver-app",
  name: "bison-driver-app",
  slug: "bison-driver-app",
  plugins: [
    [
      "react-native-background-geolocation",
      {
        license:
          **PROVIDED_IN_EMAIL**,
      },
    ],
    [
      "expo-gradle-ext-vars",
      {
        googlePlayServicesLocationVersion: "20.0.0",
        appCompatVersion: "1.4.2",
      },
    ],
    "react-native-background-fetch",
  ],
  assetBundlePatterns: ["assets/fonts/*", "assets/images/*"],
  android: {
    package: **PROVIDED_IN_EMAIL**,
  },
  ios: {
    bundleIdentifier: **PROVIDED_IN_EMAIL**,
    infoPlist: {
      NSLocationAlwaysAndWhenInUseUsageDescription:
        "[CHANGEME] This app requires location in the background",
      NSLocationWhenInUseUsageDescription:
        "[CHANGEME] This app requires location while in use",
      NSMotionUsageDescription:
        "[CHANGEME] This app uses motion-detection to determine the motion-activity of the device (walking, vehicle, bicycle, etc)",
      UIBackgroundModes: ["location", "fetch", "processing", "audio"],
      BGTaskSchedulerPermittedIdentifiers: [
        "com.transistorsoft.fetch",
        "com.transistorsoft.customtask",
      ],
    },
  },
  extra: {
    eas: {
      projectId: **PROVIDED_IN_EMAIL**,
    }
});

Expected Behavior

Should properly configure android/build.gradle within the EAS Run gradlew step.

Actual Behavior

EAS Build fails at the Run gradlew step

Steps to Reproduce

  1. eas build --profile development --platform android

Context

Deploy Android build to EAS

Debug logs

Logs
Running 'gradlew :app:assembleDebug' in /home/expo/workingdir/build/apps/mobile/android
Downloading https://services.gradle.org/distributions/gradle-7.5.1-all.zip
10%
20%.
30%
40%.
50%.
60%.
70%.
80%
90%.
100%
Welcome to Gradle 7.5.1!
Here are the highlights of this release:
 - Support for Java 18
 - Support for building with Groovy 4
 - Much more responsive continuous builds
 - Improved diagnostics for dependency resolution
For more details see https://docs.gradle.org/7.5.1/release-notes.html
To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/7.5.1/userguide/gradle_daemon.html#sec:disabling_the_daemon.
Daemon will be stopped at the end of the build
> Task :react-native-gradle-plugin:pluginDescriptors
> Task :react-native-gradle-plugin:processResources
> Task :react-native-gradle-plugin:compileKotlin
> Task :react-native-gradle-plugin:compileJava NO-SOURCE
> Task :react-native-gradle-plugin:classes
> Task :react-native-gradle-plugin:inspectClassesForKotlinIC
> Task :react-native-gradle-plugin:jar
[stderr] 
FAILURE: Build failed with an exception.
[stderr] 
* Where:
[stderr] 
Build file '/home/expo/workingdir/build/apps/mobile/android/build.gradle' line: 36
[stderr] 
* What went wrong:
[stderr] 
A problem occurred evaluating root project 'bison-driver-app'.
[stderr] 
> Project with path ':react-native-background-geolocation-android' could not be found in root project 'bison-driver-app'.
[stderr] 
* Try:
[stderr] 
> Run with --stacktrace option to get the stack trace.
[stderr] 
> Run with --info or --debug option to get more log output.
[stderr] 
> Run with --scan to get full insights.
[stderr] 
* Get more help at https://help.gradle.org
[stderr] 
BUILD FAILED in 1m 24s
5 actionable tasks: 5 executed
Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 18 (9 by maintainers)

Most upvoted comments

@t34Virus I have created a PR that should solve the prebuild error having react-native-background-geolocation in a monorepo: https://github.com/transistorsoft/react-native-background-geolocation/pull/1682