diff --git a/README.md b/README.md index d91b52e1..6ae0a9bf 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,9 @@ android:windowSoftInputMode="adjustResize"> > For more info please read [react native docs](https://facebook.github.io/react-native/docs/linking.html) + +In order to reduce the potential for conflict which may be caused by the presence of differing versions of the Android support libraries, you may wish to [configure project-wide properties](https://developer.android.com/studio/build/gradle-tips.html#configure-project-wide-properties). Setting the Compile and Target SDK versions, Build Tools version, and Support Library version in your **root project's** `build.gradle` file will make `react-native-auth0` and many other React Native modules use them. + #### iOS Inside the `ios` folder find the file `AppDelegate.[swift|m]` add the following to it diff --git a/android/build.gradle b/android/build.gradle index 846e5474..6a1f6e47 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,7 +1,3 @@ -project.ext { - buildToolsVersion = "23.0.1" -} - buildscript { repositories { jcenter() @@ -14,13 +10,18 @@ buildscript { apply plugin: 'com.android.library' +def DEFAULT_COMPILE_SDK_VERSION = 23 +def DEFAULT_BUILD_TOOLS_VERSION = "23.0.1" +def DEFAULT_TARGET_SDK_VERSION = 22 +def DEFAULT_SUPPORT_LIB_VERSION = "23.0.1" + android { - compileSdkVersion 23 - buildToolsVersion "${project.ext.buildToolsVersion}" + compileSdkVersion rootProject.hasProperty('compileSdkVersion') ? rootProject.compileSdkVersion : DEFAULT_COMPILE_SDK_VERSION + buildToolsVersion rootProject.hasProperty('buildToolsVersion') ? rootProject.buildToolsVersion : DEFAULT_BUILD_TOOLS_VERSION defaultConfig { minSdkVersion 16 - targetSdkVersion 22 + targetSdkVersion rootProject.hasProperty('targetSdkVersion') ? rootProject.targetSdkVersion : DEFAULT_TARGET_SDK_VERSION versionCode 1 versionName "1.0" } @@ -33,8 +34,10 @@ repositories { mavenCentral() } +def supportVersion = rootProject.hasProperty('supportLibVersion') ? rootProject.supportLibVersion : DEFAULT_SUPPORT_LIB_VERSION + dependencies { compile 'com.facebook.react:react-native:+' - compile "com.android.support:customtabs:${project.ext.buildToolsVersion}" + compile "com.android.support:customtabs:${supportVersion}" }