Skip to content

Commit d835964

Browse files
friederbluemlechristopherdro
authored andcommitted
Fix Android dependencies and build errors (react-native-maps#2720)
* Update yarn.lock * Remove obsolete files and folders - Delete compiled files - Remove obsolete Gradle wrapper leftover - Remove Eclipse project leftover * Update .gitignore * Fix Android dependencies and build errors - Update Gradle wrapper to 4.10.3 - Update Android Gradle plugin to 3.2.1 - Remove unused appcompat-v7 dependency from lib project
1 parent 4978696 commit d835964

24 files changed

+109
-438
lines changed

.gitignore

-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ AirMapsExplorer.xcworkspace/
3030
*.iml
3131
.gradle
3232
local.properties
33-
lib/android/src/main/gen
34-
example/android/app/src/main/gen
3533

3634
# node.js
3735
#

build.gradle

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
1-
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2-
31
buildscript {
2+
ext {
3+
minSdkVersion = 16
4+
compileSdkVersion = 28
5+
targetSdkVersion = 27
6+
supportLibVersion = "28.0.0"
7+
}
48
repositories {
9+
google()
510
jcenter()
611
}
712
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.3.2'
13+
classpath 'com.android.tools.build:gradle:3.2.1'
914
}
1015
}
1116

1217
allprojects {
1318
repositories {
1419
mavenLocal()
20+
google()
1521
jcenter()
1622
maven {
1723
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm

example/.gitignore

-34
This file was deleted.

example/android/app/.project

-23
This file was deleted.

example/android/app/build.gradle

+6-9
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ project.ext.react = [
7373
extraPackagerArgs: []
7474
]
7575

76-
7776
apply from: "../../../node_modules/react-native/react.gradle"
7877

7978
def enableSeparateBuildPerCPUArchitecture = false
@@ -84,13 +83,12 @@ def enableSeparateBuildPerCPUArchitecture = false
8483
def enableProguardInReleaseBuilds = false
8584

8685
android {
87-
compileSdkVersion 25
88-
buildToolsVersion "25.0.3"
86+
compileSdkVersion rootProject.ext.compileSdkVersion
8987

9088
defaultConfig {
9189
applicationId "com.airbnb.android.react.maps.example"
92-
minSdkVersion 16
93-
targetSdkVersion 23
90+
minSdkVersion rootProject.ext.minSdkVersion
91+
targetSdkVersion rootProject.ext.targetSdkVersion
9492
versionCode 1
9593
versionName "1.0"
9694
ndk {
@@ -127,8 +125,7 @@ android {
127125
}
128126

129127
dependencies {
130-
compile 'com.facebook.react:react-native:0.51.+'
131-
compile 'com.android.support:appcompat-v7:25.3.0'
132-
compile 'com.android.support:support-annotations:25.3.0'
133-
compile project(':react-native-maps-lib')
128+
implementation project(":react-native-maps-lib")
129+
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
130+
implementation "com.facebook.react:react-native:+" // From node_modules
134131
}
Binary file not shown.

example/android/gradle/wrapper/gradle-wrapper.properties

-6
This file was deleted.

gradle.properties

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Project-wide Gradle settings.
2+
3+
# IDE (e.g. Android Studio) users:
4+
# Gradle settings configured through the IDE *will override*
5+
# any settings specified in this file.
6+
7+
# For more details on how to configure your build environment visit
8+
# http://www.gradle.org/docs/current/userguide/build_environment.html
9+
10+
# Specifies the JVM arguments used for the daemon process.
11+
# The setting is particularly useful for tweaking memory settings.
12+
org.gradle.jvmargs=-Xmx1536m
13+
14+
# When configured, Gradle will run in incubating parallel mode.
15+
# This option should only be used with decoupled projects. More details, visit
16+
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17+
# org.gradle.parallel=true
18+
19+
VERSION_CODE=4
20+
VERSION_NAME=0.23.0
21+
GROUP=com.airbnb.android
22+
23+
POM_DESCRIPTION=React Native Map view component for Android
24+
POM_URL=https://github.com/airbnb/react-native-maps/tree/new-scv
25+
POM_SCM_URL=https://github.com/airbnb/react-native-maps/tree/new-scv
26+
POM_SCM_CONNECTION=scm:git@github.com:airbnb/react-native-maps.git
27+
POM_SCM_DEV_CONNECTION=scm:git@github.com:airbnb/react-native-maps.git
28+
POM_LICENSE_NAME=MIT
29+
POM_LICENSE_URL=https://github.com/airbnb/react-native-maps/blob/master/LICENSE
30+
POM_LICENSE_DIST=repo
31+
POM_DEVELOPER_ID=airbnb
32+
POM_DEVELOPER_NAME=Leland Richardson
33+
34+
POM_NAME=ReactNative Maps library
35+
POM_ARTIFACT_ID=react-native-maps
36+
POM_PACKAGING=aar

gradle/wrapper/gradle-wrapper.jar

982 Bytes
Binary file not shown.
+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Mon May 08 11:03:28 PDT 2017
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-all.zip

gradlew

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ APP_NAME="Gradle"
2828
APP_BASE_NAME=`basename "$0"`
2929

3030
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31-
DEFAULT_JVM_OPTS=""
31+
DEFAULT_JVM_OPTS='"-Xmx64m"'
3232

3333
# Use the maximum available, or set MAX_FD != -1 to use that value.
3434
MAX_FD="maximum"
3535

36-
warn ( ) {
36+
warn () {
3737
echo "$*"
3838
}
3939

40-
die ( ) {
40+
die () {
4141
echo
4242
echo "$*"
4343
echo
@@ -155,7 +155,7 @@ if $cygwin ; then
155155
fi
156156

157157
# Escape application args
158-
save ( ) {
158+
save () {
159159
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160160
echo " "
161161
}

gradlew.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ set APP_BASE_NAME=%~n0
1414
set APP_HOME=%DIRNAME%
1515

1616
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17-
set DEFAULT_JVM_OPTS=
17+
set DEFAULT_JVM_OPTS="-Xmx64m"
1818

1919
@rem Find java.exe
2020
if defined JAVA_HOME goto findJavaFromJavaHome

lib/android/.project

-23
This file was deleted.

lib/android/bin/src/main/java/com/airbnb/android/react/maps

Whitespace-only changes.

lib/android/build.gradle

+9-49
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,20 @@
11
apply plugin: 'com.android.library'
22
apply from: 'gradle-maven-push.gradle'
33

4-
def DEFAULT_COMPILE_SDK_VERSION = 27
5-
def DEFAULT_BUILD_TOOLS_VERSION = "27.0.3"
6-
def DEFAULT_TARGET_SDK_VERSION = 27
7-
def DEFAULT_ANDROID_SUPPORT_LIB_VERSION = "27.0.2"
8-
def DEFAULT_GOOGLE_PLAY_SERVICES_VERSION = "16.0.1"
9-
def DEFAULT_GOOGLE_PLAY_SERVICES_MAPS_VERSION = "16.0.0"
10-
def DEFAULT_ANDROID_MAPS_UTILS_VERSION = "0.5+"
11-
12-
def safeExtGet(prop, fallback) {
13-
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
14-
}
15-
164
android {
17-
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
18-
buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION)
5+
compileSdkVersion rootProject.ext.compileSdkVersion
196

207
defaultConfig {
21-
minSdkVersion 16
22-
targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
23-
}
24-
25-
packagingOptions {
26-
exclude 'META-INF/LICENSE'
27-
exclude 'META-INF/DEPENDENCIES.txt'
28-
exclude 'META-INF/LICENSE.txt'
29-
exclude 'META-INF/NOTICE.txt'
30-
exclude 'META-INF/NOTICE'
31-
exclude 'META-INF/DEPENDENCIES'
32-
exclude 'META-INF/notice.txt'
33-
exclude 'META-INF/license.txt'
34-
exclude 'META-INF/dependencies.txt'
35-
exclude 'META-INF/LGPL2.1'
36-
}
37-
38-
lintOptions {
39-
disable 'InvalidPackage'
40-
}
41-
42-
compileOptions {
43-
sourceCompatibility JavaVersion.VERSION_1_7
44-
targetCompatibility JavaVersion.VERSION_1_7
8+
minSdkVersion rootProject.ext.minSdkVersion
9+
targetSdkVersion rootProject.ext.targetSdkVersion
4510
}
4611
}
4712

4813
dependencies {
49-
def supportLibVersion = safeExtGet('supportLibVersion', DEFAULT_ANDROID_SUPPORT_LIB_VERSION)
50-
def googlePlayServicesVersion = safeExtGet('googlePlayServicesVersion', DEFAULT_GOOGLE_PLAY_SERVICES_VERSION)
51-
// Variable lookup order : googlePlayServicesMapsVersion > googlePlayServicesVersion > DEFAULT_GOOGLE_PLAY_SERVICES_MAPS_VERSION
52-
def googlePlayServicesMapsVersion = safeExtGet('googlePlayServicesMapsVersion', safeExtGet('googlePlayServicesVersion', DEFAULT_GOOGLE_PLAY_SERVICES_MAPS_VERSION))
53-
def androidMapsUtilsVersion = safeExtGet('androidMapsUtilsVersion', DEFAULT_ANDROID_MAPS_UTILS_VERSION)
54-
55-
compileOnly "com.facebook.react:react-native:+"
56-
implementation "com.android.support:appcompat-v7:$supportLibVersion"
57-
implementation "com.google.android.gms:play-services-base:$googlePlayServicesVersion"
58-
implementation "com.google.android.gms:play-services-maps:$googlePlayServicesMapsVersion"
59-
implementation "com.google.maps.android:android-maps-utils:$androidMapsUtilsVersion"
14+
compileOnly('com.facebook.react:react-native:+') {
15+
exclude group: 'com.android.support'
16+
}
17+
implementation 'com.google.android.gms:play-services-base:16.1.0'
18+
implementation 'com.google.android.gms:play-services-maps:16.1.0'
19+
implementation 'com.google.maps.android:android-maps-utils:0.5'
6020
}

lib/android/gradle.properties

-18
This file was deleted.
-52.4 KB
Binary file not shown.

lib/android/gradle/wrapper/gradle-wrapper.properties

-6
This file was deleted.

0 commit comments

Comments
 (0)