It seems to me that safeExtGet in android/build.gradle looks for parameters in the wrong place. It looks for example for rootProject.ext.minSdkVersion. When I print out variables of a library during an Android app build, rootProject.ext.minSdkVersion is undefined but rootProject.minSdkVersion contains the expected value.
I ran into this when debugging this build issue. The first library I fixed had hard-coded the minSdkVersion and I changed it to read rootProject.minSdkVersion and it works fine. The next library read it from rootProject.ext.minSdkVersion which caused it to use the default value. When I change it to use rootProject.minSdkVersion it works as fine.
To reproduce, add following lines to node_modules/<react-native-some-library>/android/build.gradle and run an app build:
It seems to me that
safeExtGet
inandroid/build.gradle
looks for parameters in the wrong place. It looks for example forrootProject.ext.minSdkVersion
. When I print out variables of a library during an Android app build,rootProject.ext.minSdkVersion
is undefined butrootProject.minSdkVersion
contains the expected value.I ran into this when debugging this build issue. The first library I fixed had hard-coded the minSdkVersion and I changed it to read
rootProject.minSdkVersion
and it works fine. The next library read it fromrootProject.ext.minSdkVersion
which caused it to use the default value. When I change it to userootProject.minSdkVersion
it works as fine.To reproduce, add following lines to
node_modules/<react-native-some-library>/android/build.gradle
and run an app build: