forked from facebookarchive/react-native-fbsdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Gradle setup in android folder (facebookarchive#670)
Project now opens and builds correctly in Android Studio and from command line.
- Loading branch information
1 parent
bdc283d
commit cfee77a
Showing
7 changed files
with
48 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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' | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,3 +54,6 @@ debug.keystore | |
|
||
# Bundle artifact | ||
*.jsbundle | ||
|
||
# CocoaPods | ||
/ios/Pods/ |