mikehardy / react-native-update-apk

Update apk from non-play store servers, and update ios from app store in React Native.
MIT License
193 stars 57 forks source link

Mixed appcompact version requirements? #50

Closed mirceaciu closed 2 years ago

mirceaciu commented 2 years ago

Not sure if this is just on my side but:

I've installed the npm package in my own react-native app. I've manually linked it so that RNUpdateAPK native module is made available to the javascript side.

But when trying to build the app I get this error from the Android builder:

Could not find androidx.appcompat:appcompat:25.0.0.
Required by:
    project :rn-update-apk
Search in build.gradle files

It asks for a version of androidx.appcompat that does not exist. Newest available is 1.3.1, 25.0.0 should be a version of the old com.android package.

I can see that the package would fallback to a proper 1.3.0 version of androidx but I don't understand much else. https://github.com/mikehardy/react-native-update-apk/blob/master/android/build.gradle#L48

mikehardy commented 2 years ago

It appears that you have an ext block somewhere in a build.gradle file setting appCompatVersion to 25.0.0

I have this instead, and it works for me:

android/build.gradle


/* groovylint-disable-next-line CompileStatic */
buildscript {
    ext {
    // ... lots of stuff here
    appCompatVersion = '1.3.1' // this maps to androidx.appcompat https://developer.android.com/jetpack/androidx/releases/appcompat
mirceaciu commented 2 years ago

Actual issue was that I did not have that value set anywhere. Added it to the block you specified above and now to it builds. Thank you!