react-native-background-geolocation: Cannot find a version of 'androidx.appcompat:appcompat' that satisfies the version constraints

Your Environment

“name”: “newBackgroundGps”, “version”: “0.0.1”, “private”: true, “scripts”: { “start”: “react-native start”, “test”: “jest”, “lint”: “eslint .” }, “dependencies”: { “cocoa-lumberjack”: “^3.0.5”, “react”: “16.8.6”, “react-native”: “0.60.0”, “react-native-background-fetch”: “^2.6.0”, “react-native-background-geolocation”: “^3.0.7” }, “devDependencies”: { “@babel/core”: “^7.4.5”, “@babel/runtime”: “^7.4.5”, “@react-native-community/eslint-config”: “^0.0.5”, “babel-jest”: “^24.8.0”, “eslint”: “^6.0.1”, “jest”: “^24.8.0”, “metro-react-native-babel-preset”: “^0.55.0”, “react-test-renderer”: “16.8.6” }, “jest”: { “preset”: “react-native” } }

  • Plugin config NA

Expected Behavior

Android can build successfully - using React-native 0.60.0

Actual Behavior

Failed with error message:

Cannot find a version of ‘androidx.appcompat:appcompat’ that satisfies the version constraints:

Steps to Reproduce

  1. Build a brand new app via react-native init <name>
  2. Install react-native-background-geolocation following instructions precisely
  3. Open in Android studio
  4. Error is shown, even after “clean build” is run

Context

Create a barebone project with react-native 0.60 and react-native-background-geolocation See gif recording off all steps:

react-native-0 60-background-geolocation-error

Debug logs

Logs
Cannot find a version of 'androidx.appcompat:appcompat' that satisfies the version constraints: 
   Dependency path 'newBackgroundGps:react-native-background-geolocation:unspecified' --> 'com.android.support:appcompat-v7:28.0.0' because of the following reason: ENABLE_JETIFIER is enabled
   Constraint path 'newBackgroundGps:react-native-background-geolocation:unspecified' --> 'androidx.appcompat:appcompat:{strictly 1.0.0}' because of the following reason: debugRuntimeClasspath uses version 1.0.0
   Dependency path 'newBackgroundGps:react-native-background-geolocation:unspecified' --> 'com.facebook.react:react-native:0.60.0' --> 'androidx.appcompat:appcompat:1.0.2'


About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 18 (10 by maintainers)

Most upvoted comments

react-native-firebase has some issues with androidx library specification, and an unrelated issue with CI that is stopping us from releasing v5.5.7 😦

https://github.com/invertase/react-native-firebase/pull/2476

I have attached a patch-package file in a comment on that pull request for people to use in the meantime, I needed it in my project - either for this module in combo with react-native-firebase or another, I’m not sure https://github.com/invertase/react-native-firebase/pull/2476#issuecomment-521670164

https://github.com/mikehardy/jetifier should ease the transition but gradle dependencies analysis is a skill that most have avoided so there’s always some learning involved