diff --git a/.gitignore b/.gitignore index 1f2986fc..c2b2fe4c 100644 --- a/.gitignore +++ b/.gitignore @@ -20,7 +20,6 @@ DerivedData *.hmap *.ipa *.xcuserstate -project.xcworkspace # Android/IntelliJ # @@ -29,12 +28,12 @@ build/ .gradle local.properties *.iml - -# Cocoapods -# -Pods/ +android/gradle/ +android/gradlew +android/gradlew.bat # node.js # node_modules/ npm-debug.log +yarn-error.log diff --git a/android/android.iml b/android/android.iml deleted file mode 100644 index a162bd16..00000000 --- a/android/android.iml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/android/build.gradle b/android/build.gradle index 8e6b4a63..5f9065c5 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,45 +1,56 @@ -apply plugin: 'com.android.library' - def safeExtGet(prop, fallback) { rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback } -def DEFAULT_COMPILE_SDK_VERSION = 28 -def DEFAULT_BUILD_TOOLS_VERSION = "28.0.3" -def DEFAULT_MIN_SDK_VERSION = 16 -def DEFAULT_TARGET_SDK_VERSION = 28 -def DEFAULT_FACEBOOK_SDK_VERSION = "[5.0,6.0[" +buildscript { + if (project == rootProject) { + // The Android Gradle plugin is only required when opening the android folder stand-alone. + // This avoids unnecessary downloads and potential conflicts when the library is included as a + // module dependency in an application project. + repositories { + google() + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:3.5.2' + } + } +} -def FACEBOOK_SDK_VERSION = safeExtGet('facebookSdkVersion', DEFAULT_FACEBOOK_SDK_VERSION) -android { - compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) - buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) +apply plugin: 'com.android.library' +android { + compileSdkVersion safeExtGet('compileSdkVersion', 28) + buildToolsVersion safeExtGet('buildToolsVersion', '28.0.3') defaultConfig { - minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) - targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) + minSdkVersion safeExtGet('minSdkVersion', 16) + targetSdkVersion safeExtGet('targetSdkVersion', 28) } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } + lintOptions { + abortOnError false } } +repositories { + mavenLocal() + maven { + // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm + url "$rootDir/../node_modules/react-native/android" + } + maven { + // Android JSC is installed from npm + url "$rootDir/../node_modules/jsc-android/dist" + } + google() + jcenter() +} + +def FACEBOOK_SDK_VERSION = safeExtGet('facebookSdkVersion', '[5.0,6.0[') + dependencies { - implementation "androidx.appcompat:appcompat:1.0.+" - api 'com.facebook.react:react-native:+' + //noinspection GradleDynamicVersion + implementation "com.facebook.react:react-native:+" // From node_modules implementation "com.facebook.android:facebook-core:${FACEBOOK_SDK_VERSION}" implementation "com.facebook.android:facebook-login:${FACEBOOK_SDK_VERSION}" implementation "com.facebook.android:facebook-share:${FACEBOOK_SDK_VERSION}" } - -repositories { - mavenCentral() - jcenter() - maven { - url 'https://maven.google.com/' - name 'Google' - } -} diff --git a/android/proguard-rules.pro b/android/proguard-rules.pro deleted file mode 100644 index f27c56ae..00000000 --- a/android/proguard-rules.pro +++ /dev/null @@ -1,13 +0,0 @@ -# Add project specific ProGuard rules here. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index d737262f..1390726b 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -18,7 +18,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --> - - diff --git a/android/src/main/res/values/strings.xml b/android/src/main/res/values/strings.xml deleted file mode 100644 index d81936f5..00000000 --- a/android/src/main/res/values/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - AndroidSDK - diff --git a/example/.gitignore b/example/.gitignore index aa6d9922..f36821b0 100644 --- a/example/.gitignore +++ b/example/.gitignore @@ -54,3 +54,6 @@ debug.keystore # Bundle artifact *.jsbundle + +# CocoaPods +/ios/Pods/