Skip to content

Commit edc8518

Browse files
committed
fix(Android): Bump API to 29
1 parent 466f866 commit edc8518

File tree

27 files changed

+7130
-809
lines changed

27 files changed

+7130
-809
lines changed

android/build.gradle

+5-6
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,12 @@ buildscript {
2222
apply plugin: 'com.android.library'
2323
apply plugin: 'maven'
2424

25-
// Matches values in recent template from React Native 0.59 / 0.60
26-
// https://github.com/facebook/react-native/blob/0.59-stable/template/android/build.gradle#L5-L9
27-
// https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle#L5-L9
28-
def DEFAULT_COMPILE_SDK_VERSION = 28
29-
def DEFAULT_BUILD_TOOLS_VERSION = "28.0.3"
25+
// Matches values in recent template from React Native 0.63
26+
// https://github.com/facebook/react-native/blob/0.63-stable/template/android/build.gradle#L5-L9
27+
def DEFAULT_COMPILE_SDK_VERSION = 29
28+
def DEFAULT_BUILD_TOOLS_VERSION = "29.0.2"
3029
def DEFAULT_MIN_SDK_VERSION = 21
31-
def DEFAULT_TARGET_SDK_VERSION = 28
30+
def DEFAULT_TARGET_SDK_VERSION = 29
3231

3332
android {
3433
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)

examples/tcpsockets/.flowconfig

+1-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ untyped-type-import=warn
5656
nonstrict-import=warn
5757
deprecated-type=warn
5858
unsafe-getters-setters=warn
59-
inexact-spread=warn
6059
unnecessary-invariant=warn
6160
signature-verification-failure=warn
6261
deprecated-utility=error
@@ -71,4 +70,4 @@ untyped-import
7170
untyped-type-import
7271

7372
[version]
74-
^0.113.0
73+
^0.122.0

examples/tcpsockets/.gitattributes

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
# specific for windows script files
2-
*.bat text eol=crlf
1+
*.pbxproj -text

examples/tcpsockets/.gitignore

-5
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ local.properties
3434
node_modules/
3535
npm-debug.log
3636
yarn-error.log
37-
yarn.lock
38-
package-lock.json
3937

4038
# BUCK
4139
buck-out/
@@ -59,6 +57,3 @@ buck-out/
5957

6058
# CocoaPods
6159
/ios/Pods/
62-
63-
# TLS Cert
64-
*.pem

examples/tcpsockets/android/app/build.gradle

+4-10
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import com.android.build.OutputFile
2020
* // default. Can be overridden with ENTRY_FILE environment variable.
2121
* entryFile: "index.android.js",
2222
*
23-
* // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format
23+
* // https://reactnative.dev/docs/performance#enable-the-ram-format
2424
* bundleCommand: "ram-bundle",
2525
*
2626
* // whether to bundle JS and assets in debug mode
@@ -157,20 +157,13 @@ android {
157157
}
158158
release {
159159
// Caution! In production, you need to generate your own keystore file.
160-
// see https://facebook.github.io/react-native/docs/signed-apk-android.
160+
// see https://reactnative.dev/docs/signed-apk-android.
161161
signingConfig signingConfigs.debug
162162
minifyEnabled enableProguardInReleaseBuilds
163163
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
164164
}
165165
}
166166

167-
packagingOptions {
168-
pickFirst "lib/armeabi-v7a/libc++_shared.so"
169-
pickFirst "lib/arm64-v8a/libc++_shared.so"
170-
pickFirst "lib/x86/libc++_shared.so"
171-
pickFirst "lib/x86_64/libc++_shared.so"
172-
}
173-
174167
// applicationVariants are e.g. debug, release
175168
applicationVariants.all { variant ->
176169
variant.outputs.each { output ->
@@ -200,6 +193,7 @@ dependencies {
200193

201194
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
202195
exclude group:'com.facebook.flipper'
196+
exclude group:'com.squareup.okhttp3', module:'okhttp'
203197
}
204198

205199
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
@@ -222,4 +216,4 @@ task copyDownloadableDepsToLibs(type: Copy) {
222216
into 'libs'
223217
}
224218

225-
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
219+
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

examples/tcpsockets/android/app/src/debug/java/com/tcpsockets/ReactNativeFlipper.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
55
* directory of this source tree.
66
*/
7-
package com.rndiffapp;
7+
package com.tcpsockets;
88

99
import android.content.Context;
1010
import com.facebook.flipper.android.AndroidFlipperClient;

examples/tcpsockets/android/app/src/main/AndroidManifest.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
android:name=".MainActivity"
1515
android:label="@string/app_name"
1616
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
17-
android:launchMode="singleTask"
17+
android:launchMode="singleTask"
1818
android:windowSoftInputMode="adjustResize">
1919
<intent-filter>
2020
<action android:name="android.intent.action.MAIN" />

examples/tcpsockets/android/app/src/main/java/com/tcpsockets/MainApplication.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ private static void initializeFlipper(
6262
We use reflection here to pick up the class that initializes Flipper,
6363
since Flipper library is not available in release mode
6464
*/
65-
Class<?> aClass = Class.forName("com.rndiffapp.ReactNativeFlipper");
65+
Class<?> aClass = Class.forName("com.tcpsockets.ReactNativeFlipper");
6666
aClass
6767
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
6868
.invoke(null, context, reactInstanceManager);

examples/tcpsockets/android/build.gradle

+5-6
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22

33
buildscript {
44
ext {
5-
buildToolsVersion = "28.0.3"
6-
minSdkVersion = 21
7-
compileSdkVersion = 28
8-
targetSdkVersion = 28
5+
buildToolsVersion = "29.0.2"
6+
minSdkVersion = 16
7+
compileSdkVersion = 29
8+
targetSdkVersion = 29
99
}
1010
repositories {
1111
google()
1212
jcenter()
1313
}
1414
dependencies {
15-
classpath("com.android.tools.build:gradle:3.5.2")
16-
15+
classpath("com.android.tools.build:gradle:3.5.3")
1716
// NOTE: Do not place your application dependencies here; they belong
1817
// in the individual module build.gradle files
1918
}

examples/tcpsockets/android/gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ android.useAndroidX=true
2525
android.enableJetifier=true
2626

2727
# Version of flipper SDK to use with React Native
28-
FLIPPER_VERSION=0.33.1
28+
FLIPPER_VERSION=0.37.0
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

examples/tcpsockets/android/gradlew

+12-17
Original file line numberDiff line numberDiff line change
@@ -154,19 +154,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
154154
else
155155
eval `echo args$i`="\"$arg\""
156156
fi
157-
i=$((i+1))
157+
i=`expr $i + 1`
158158
done
159159
case $i in
160-
(0) set -- ;;
161-
(1) set -- "$args0" ;;
162-
(2) set -- "$args0" "$args1" ;;
163-
(3) set -- "$args0" "$args1" "$args2" ;;
164-
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
165-
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
166-
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
167-
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
168-
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
169-
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
160+
0) set -- ;;
161+
1) set -- "$args0" ;;
162+
2) set -- "$args0" "$args1" ;;
163+
3) set -- "$args0" "$args1" "$args2" ;;
164+
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
165+
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
166+
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
167+
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
168+
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
169+
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
170170
esac
171171
fi
172172

@@ -175,14 +175,9 @@ save () {
175175
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
176176
echo " "
177177
}
178-
APP_ARGS=$(save "$@")
178+
APP_ARGS=`save "$@"`
179179

180180
# Collect all arguments for the java command, following the shell quoting and substitution rules
181181
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
182182

183-
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
184-
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
185-
cd "$(dirname "$0")"
186-
fi
187-
188183
exec "$JAVACMD" "$@"

examples/tcpsockets/android/gradlew.bat

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
@rem you may not use this file except in compliance with the License.
66
@rem You may obtain a copy of the License at
77
@rem
8-
@rem http://www.apache.org/licenses/LICENSE-2.0
8+
@rem https://www.apache.org/licenses/LICENSE-2.0
99
@rem
1010
@rem Unless required by applicable law or agreed to in writing, software
1111
@rem distributed under the License is distributed on an "AS IS" BASIS,
@@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=.
2929
set APP_BASE_NAME=%~n0
3030
set APP_HOME=%DIRNAME%
3131

32+
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
33+
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34+
3235
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
3336
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
3437

examples/tcpsockets/ios/Podfile

+5-53
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,23 @@
1-
platform :ios, '9.0'
1+
require_relative '../node_modules/react-native/scripts/react_native_pods'
22
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
33

4-
def add_flipper_pods!
5-
version = '~> 0.33.1'
6-
pod 'FlipperKit', version, :configuration => 'Debug'
7-
pod 'FlipperKit/FlipperKitLayoutPlugin', version, :configuration => 'Debug'
8-
pod 'FlipperKit/SKIOSNetworkPlugin', version, :configuration => 'Debug'
9-
pod 'FlipperKit/FlipperKitUserDefaultsPlugin', version, :configuration => 'Debug'
10-
pod 'FlipperKit/FlipperKitReactPlugin', version, :configuration => 'Debug'
11-
end
12-
13-
# Post Install processing for Flipper
14-
def flipper_post_install(installer)
15-
installer.pods_project.targets.each do |target|
16-
if target.name == 'YogaKit'
17-
target.build_configurations.each do |config|
18-
config.build_settings['SWIFT_VERSION'] = '4.1'
19-
end
20-
end
21-
end
22-
end
4+
platform :ios, '10.0'
235

246
target 'tcpsockets' do
25-
# Pods for tcpsockets
26-
pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
27-
pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
28-
pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
29-
pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
30-
pod 'React', :path => '../node_modules/react-native/'
31-
pod 'React-Core', :path => '../node_modules/react-native/'
32-
pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
33-
pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
34-
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
35-
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
36-
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
37-
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
38-
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
39-
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
40-
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
41-
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
42-
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
43-
pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
44-
45-
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
46-
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
47-
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
48-
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
49-
pod 'ReactCommon/callinvoker', :path => "../node_modules/react-native/ReactCommon"
50-
pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
51-
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga', :modular_headers => true
7+
config = use_native_modules!
528

53-
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
54-
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
55-
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
9+
use_react_native!(:path => config["reactNativePath"])
5610

5711
target 'tcpsocketsTests' do
5812
inherit! :complete
5913
# Pods for testing
6014
end
6115

62-
use_native_modules!
63-
6416
# Enables Flipper.
6517
#
6618
# Note that if you have use_frameworks! enabled, Flipper will not work and
6719
# you should disable these next few lines.
68-
add_flipper_pods!
20+
use_flipper!
6921
post_install do |installer|
7022
flipper_post_install(installer)
7123
end

0 commit comments

Comments
 (0)