react-native-background-geolocation: Unable get the app running after expo upgrade to 51 - both Ios & android

Recently we tried to upgraded to expo 51, have been getting build error on both platforms. For both platform during build gets the error leading from location-manager

Your Environment

  • Plugin version: 4.16.0
  • Platform: iOS or Android: Both
  • OS version: Unable to get the build running
  • Device manufacturer / model:
  • React Native version (react-native -v): 0.74.5
  • Expo : 51.0.0
  • Plugin config
PASTE_YOUR_CODE_HERE

Expected Behavior

Should be succesfull build on npx expo run:android npx expo run:ios

Actual Behavior

  • For npx expo run:android FAILURE: Build failed with an exception.

What went wrong: Could not determine the dependencies of task ‘:app:compileDebugJavaWithJavac’.

Could not resolve all dependencies for configuration ‘:app:debugCompileClasspath’. Could not find any matches for com.transistorsoft:tslocationmanager:+ as no versions of com.transistorsoft:tslocationmanager are available. Searched in the following locations: - https://developer.huawei.com/repo/com/transistorsoft/tslocationmanager/maven-metadata.xml Required by: project :app > project :react-native-background-geolocation

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

  • For Ios npx expo run:ios › Linking catchapp » catchapp.debug.dylib ⚠️ ld: ignoring duplicate libraries: ‘-lc++’ ⚠️ ld: Could not find or use auto-linked framework ‘CoreAudioTypes’: framework ‘CoreAudioTypes’ not found ⚠️ ld: Could not parse or use implicit file ‘/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/SwiftUICore.framework/SwiftUICore.tbd’: cannot link directly with ‘SwiftUICore’ because product being built is not an allowed client of it ❌ Undefined symbols for architecture arm64 ┌─ Symbol: OBJC_CLASS$_TSBackgroundFetch └─ Referenced from: in TSLocationManager[arm64]21

❌ ld: symbol(s) not found for architecture arm64

Run script build phase '[CP-User] [Hermes] Replace Hermes for the right configuration, if needed' will be run during every build because it does not specify any outputs. To address this issue, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'hermes-engine' from project 'Pods')
Run script build phase '[CP-User] [RN]Check rncore' will be run during every build because it does not specify any outputs. To address this issue, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'React-Fabric' from project 'Pods')
Run script build phase '[CP-User] Generate app.config for prebuilt Constants.manifest' will be run during every build because it does not specify any outputs. To address this issue, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'EXConstants' from project 'Pods')

› 2 error(s), and 6 warning(s)

CommandError: Failed to build iOS project. “xcodebuild” exited with error code 65.

Steps to Reproduce

  1. Update expo from 50 - 51
  2. Rebuild the project

Context

Debug logs

Logs
PASTE_YOUR_LOGS_HERE

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 32 (16 by maintainers)

Most upvoted comments

@abhinandhand it’s deprecated but this plugin will support new architecture pretty soon, and until then this property is what you want I believe https://docs.expo.dev/versions/latest/sdk/build-properties/#pluginconfigtypeandroid / newArchEnabled set to false

Here’s the auto-generated android/build.gradle (@see @generated for lines automatically added by my plugins):

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

buildscript {
    ext {
// @generated begin expo-gradle-ext-vars - expo prebuild (DO NOT MODIFY) sync-a14167d3df9d6380c3d77a8f8070215ea8a94013
	googlePlayServicesLocationVersion = "21.1.0"
	appCompatVersion = "1.4.2"
// @generated end expo-gradle-ext-vars
        buildToolsVersion = findProperty('android.buildToolsVersion') ?: '35.0.0'
        minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '24')
        compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '35')
        targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '34')
        kotlinVersion = findProperty('android.kotlinVersion') ?: '1.9.24'

        ndkVersion = "26.1.10909125"
    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath('com.android.tools.build:gradle')
        classpath('com.facebook.react:react-native-gradle-plugin')
        classpath('org.jetbrains.kotlin:kotlin-gradle-plugin')
    }
}

apply plugin: "com.facebook.react.rootproject"

allprojects {
    repositories {
// @generated begin react-native-background-fetch-maven - expo prebuild (DO NOT MODIFY) sync-b86324ce2eb77b03cc8b69ba206ef8275cd006ff
	maven { url "${project(":react-native-background-fetch").projectDir}/libs" }
// @generated begin react-native-background-geolocation-maven - expo prebuild (DO NOT MODIFY) sync-4b2bae87fd8579c445d8885f6bdc8542d9d0bbca
	maven { url "${project(":react-native-background-geolocation").projectDir}/libs" }
	maven { url 'https://developer.huawei.com/repo/' }
// @generated end react-native-background-geolocation-maven
// @generated end react-native-background-fetch-maven
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url(new File(['node', '--print', "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim(), '../android'))
        }
        maven {
            // Android JSC is installed from npm
            url(new File(['node', '--print', "require.resolve('jsc-android/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim(), '../dist'))
        }

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

If you want to know exactly which maven urls are missing, see the React Native auto-linking Setup Instructions (not the Expo instructions)