Skip to content

Commit 367e19a

Browse files
authored
chore: update dependencies (#81)
* chore: updated react-native to 63.3 * chore: updated android project * chore: updated dependencies
1 parent d2a75ca commit 367e19a

File tree

20 files changed

+634
-407
lines changed

20 files changed

+634
-407
lines changed

example/android/app/app.iml

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<facet type="android-gradle" name="Android-Gradle">
55
<configuration>
66
<option name="GRADLE_PROJECT_PATH" value=":app" />
7-
<option name="LAST_SUCCESSFUL_SYNC_AGP_VERSION" value="3.5.2" />
8-
<option name="LAST_KNOWN_AGP_VERSION" value="3.5.2" />
7+
<option name="LAST_SUCCESSFUL_SYNC_AGP_VERSION" value="3.5.3" />
8+
<option name="LAST_KNOWN_AGP_VERSION" value="3.5.3" />
99
</configuration>
1010
</facet>
1111
<facet type="android" name="Android">
@@ -89,22 +89,27 @@
8989
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
9090
<excludeFolder url="file://$MODULE_DIR$/build" />
9191
</content>
92-
<orderEntry type="jdk" jdkName="Android API 28 Platform" jdkType="Android SDK" />
92+
<orderEntry type="jdk" jdkName="Android API 29 Platform" jdkType="Android SDK" />
9393
<orderEntry type="sourceFolder" forTests="false" />
94+
<orderEntry type="library" name="Gradle: com.parse.bolts:bolts-applinks:1.4.0@jar" level="project" />
95+
<orderEntry type="library" name="Gradle: com.parse.bolts:bolts-tasks:1.4.0@jar" level="project" />
96+
<orderEntry type="library" name="Gradle: com.facebook.soloader:annotation:0.9.0@jar" level="project" />
97+
<orderEntry type="library" name="Gradle: com.facebook.soloader:nativeloader:0.9.0@jar" level="project" />
9498
<orderEntry type="library" name="Gradle: com.facebook.infer.annotation:infer-annotation:0.11.2@jar" level="project" />
9599
<orderEntry type="library" name="Gradle: com.google.code.findbugs:jsr305:3.0.2@jar" level="project" />
96-
<orderEntry type="library" name="Gradle: com.facebook.yoga:proguard-annotations:1.14.1@jar" level="project" />
97-
<orderEntry type="library" name="Gradle: javax.inject:javax.inject:1@jar" level="project" />
98100
<orderEntry type="library" name="Gradle: androidx.collection:collection:1.1.0@jar" level="project" />
99101
<orderEntry type="library" name="Gradle: androidx.lifecycle:lifecycle-common:2.2.0@jar" level="project" />
100102
<orderEntry type="library" name="Gradle: androidx.arch.core:core-common:2.1.0@jar" level="project" />
101103
<orderEntry type="library" name="Gradle: androidx.annotation:annotation:1.1.0@jar" level="project" />
102-
<orderEntry type="library" name="Gradle: com.facebook.soloader:nativeloader:0.8.0@jar" level="project" />
104+
<orderEntry type="library" name="Gradle: com.facebook.yoga:proguard-annotations:1.14.1@jar" level="project" />
105+
<orderEntry type="library" name="Gradle: javax.inject:javax.inject:1@jar" level="project" />
103106
<orderEntry type="library" name="Gradle: com.squareup.okhttp3:okhttp-urlconnection:3.12.1@jar" level="project" />
104107
<orderEntry type="library" name="Gradle: com.squareup.okhttp3:okhttp:3.12.1@jar" level="project" />
105108
<orderEntry type="library" name="Gradle: com.squareup.okio:okio:1.15.0@jar" level="project" />
106109
<orderEntry type="library" name="Gradle: com.facebook.fbjni:fbjni-java-only:0.0.3@jar" level="project" />
107-
<orderEntry type="library" name="Gradle: com.facebook.react:react-native:0.62.2@aar" level="project" />
110+
<orderEntry type="library" name="Gradle: com.facebook.flipper:flipper:0.54.0@aar" level="project" />
111+
<orderEntry type="library" name="Gradle: com.facebook.react:react-native:0.63.3@aar" level="project" />
112+
<orderEntry type="library" name="Gradle: com.facebook.soloader:soloader:0.9.0@aar" level="project" />
108113
<orderEntry type="library" name="Gradle: androidx.appcompat:appcompat:1.1.0@aar" level="project" />
109114
<orderEntry type="library" name="Gradle: androidx.swiperefreshlayout:swiperefreshlayout:1.0.0@aar" level="project" />
110115
<orderEntry type="library" name="Gradle: androidx.fragment:fragment:1.2.1@aar" level="project" />
@@ -127,22 +132,26 @@
127132
<orderEntry type="library" name="Gradle: androidx.lifecycle:lifecycle-runtime:2.2.0@aar" level="project" />
128133
<orderEntry type="library" name="Gradle: androidx.savedstate:savedstate:1.0.0@aar" level="project" />
129134
<orderEntry type="library" name="Gradle: androidx.arch.core:core-runtime:2.1.0@aar" level="project" />
130-
<orderEntry type="library" name="Gradle: com.facebook.fresco:fresco:2.0.0@aar" level="project" />
131-
<orderEntry type="library" name="Gradle: com.facebook.fresco:fbcore:2.0.0@aar" level="project" />
132-
<orderEntry type="library" name="Gradle: com.facebook.fresco:drawee:2.0.0@aar" level="project" />
133-
<orderEntry type="library" name="Gradle: com.facebook.fresco:imagepipeline:2.0.0@aar" level="project" />
134-
<orderEntry type="library" name="Gradle: com.facebook.fresco:imagepipeline-base:2.0.0@aar" level="project" />
135-
<orderEntry type="library" name="Gradle: com.facebook.soloader:soloader:0.8.0@aar" level="project" />
136-
<orderEntry type="library" name="Gradle: com.facebook.soloader:annotation:0.8.0@aar" level="project" />
137-
<orderEntry type="library" name="Gradle: com.facebook.fresco:nativeimagefilters:2.0.0@aar" level="project" />
138-
<orderEntry type="library" name="Gradle: com.facebook.fresco:nativeimagetranscoder:2.0.0@aar" level="project" />
135+
<orderEntry type="library" name="Gradle: com.facebook.flipper:flipper-network-plugin:0.54.0@aar" level="project" />
136+
<orderEntry type="library" name="Gradle: com.facebook.flipper:flipper-fresco-plugin:0.54.0@aar" level="project" />
137+
<orderEntry type="library" name="Gradle: com.facebook.fresco:fresco:2.2.0@aar" level="project" />
138+
<orderEntry type="library" name="Gradle: com.facebook.fresco:fbcore:2.2.0@aar" level="project" />
139+
<orderEntry type="library" name="Gradle: com.facebook.fresco:drawee:2.2.0@aar" level="project" />
140+
<orderEntry type="library" name="Gradle: com.facebook.fresco:imagepipeline:2.2.0@aar" level="project" />
141+
<orderEntry type="library" name="Gradle: com.facebook.fresco:imagepipeline-base:2.2.0@aar" level="project" />
142+
<orderEntry type="library" name="Gradle: com.facebook.fresco:imagepipeline-native:2.2.0@aar" level="project" />
143+
<orderEntry type="library" name="Gradle: com.facebook.fresco:memory-type-ashmem:2.2.0@aar" level="project" />
144+
<orderEntry type="library" name="Gradle: com.facebook.fresco:memory-type-native:2.2.0@aar" level="project" />
145+
<orderEntry type="library" name="Gradle: com.facebook.fresco:memory-type-java:2.2.0@aar" level="project" />
146+
<orderEntry type="library" name="Gradle: com.facebook.fresco:nativeimagefilters:2.2.0@aar" level="project" />
147+
<orderEntry type="library" name="Gradle: com.facebook.fresco:nativeimagetranscoder:2.2.0@aar" level="project" />
139148
<orderEntry type="library" name="Gradle: com.facebook.fresco:imagepipeline-okhttp3:2.0.0@aar" level="project" />
140149
<orderEntry type="library" name="Gradle: org.webkit:android-jsc:r245459@aar" level="project" />
141150
<orderEntry type="module" module-name="AnimatedTabbarExample-react-native-community_masked-view" />
142151
<orderEntry type="module" module-name="AnimatedTabbarExample-react-native-gesture-handler" />
143152
<orderEntry type="module" module-name="com.swmansion.reanimated-react-native-reanimated" />
144153
<orderEntry type="module" module-name="AnimatedTabbarExample-react-native-safe-area-context" />
145-
<orderEntry type="module" module-name="com.swmansion.rnscreens-react-native-screens" />
154+
<orderEntry type="module" module-name="AnimatedTabbarExample-react-native-screens" />
146155
<orderEntry type="module" module-name="react-native-svg" />
147156
</component>
148157
</module>

example/android/app/build.gradle

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ android {
127127
}
128128

129129
defaultConfig {
130-
applicationId "com.animatedtabbarexample"
130+
applicationId "dev.gorhom.animatedtabbar"
131131
minSdkVersion rootProject.ext.minSdkVersion
132132
targetSdkVersion rootProject.ext.targetSdkVersion
133133
versionCode 1
@@ -161,12 +161,6 @@ android {
161161
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
162162
}
163163
}
164-
packagingOptions {
165-
pickFirst "lib/armeabi-v7a/libc++_shared.so"
166-
pickFirst "lib/arm64-v8a/libc++_shared.so"
167-
pickFirst "lib/x86/libc++_shared.so"
168-
pickFirst "lib/x86_64/libc++_shared.so"
169-
}
170164
// applicationVariants are e.g. debug, release
171165
applicationVariants.all { variant ->
172166
variant.outputs.each { output ->
@@ -188,6 +182,19 @@ dependencies {
188182
implementation "com.facebook.react:react-native:+" // From node_modules
189183
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
190184

185+
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
186+
exclude group:'com.facebook.fbjni'
187+
}
188+
189+
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
190+
exclude group:'com.facebook.flipper'
191+
exclude group:'com.squareup.okhttp3', module:'okhttp'
192+
}
193+
194+
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
195+
exclude group:'com.facebook.flipper'
196+
}
197+
191198
if (enableHermes) {
192199
def hermesPath = "../../node_modules/hermes-engine/android/";
193200
debugImplementation files(hermesPath + "hermes-debug.aar")
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/**
2+
* Copyright (c) Facebook, Inc. and its affiliates.
3+
*
4+
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
5+
* directory of this source tree.
6+
*/
7+
package dev.gorhom.animatedtabbar;
8+
9+
import android.content.Context;
10+
import com.facebook.flipper.android.AndroidFlipperClient;
11+
import com.facebook.flipper.android.utils.FlipperUtils;
12+
import com.facebook.flipper.core.FlipperClient;
13+
import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
14+
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
15+
import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
16+
import com.facebook.flipper.plugins.inspector.DescriptorMapping;
17+
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
18+
import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
19+
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
20+
import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
21+
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
22+
import com.facebook.react.ReactInstanceManager;
23+
import com.facebook.react.bridge.ReactContext;
24+
import com.facebook.react.modules.network.NetworkingModule;
25+
import okhttp3.OkHttpClient;
26+
27+
public class ReactNativeFlipper {
28+
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
29+
if (FlipperUtils.shouldEnableFlipper(context)) {
30+
final FlipperClient client = AndroidFlipperClient.getInstance(context);
31+
32+
client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
33+
client.addPlugin(new ReactFlipperPlugin());
34+
client.addPlugin(new DatabasesFlipperPlugin(context));
35+
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
36+
client.addPlugin(CrashReporterPlugin.getInstance());
37+
38+
NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
39+
NetworkingModule.setCustomClientBuilder(
40+
new NetworkingModule.CustomClientBuilder() {
41+
@Override
42+
public void apply(OkHttpClient.Builder builder) {
43+
builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
44+
}
45+
});
46+
client.addPlugin(networkFlipperPlugin);
47+
client.start();
48+
49+
// Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
50+
// Hence we run if after all native modules have been initialized
51+
ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
52+
if (reactContext == null) {
53+
reactInstanceManager.addReactInstanceEventListener(
54+
new ReactInstanceManager.ReactInstanceEventListener() {
55+
@Override
56+
public void onReactContextInitialized(ReactContext reactContext) {
57+
reactInstanceManager.removeReactInstanceEventListener(this);
58+
reactContext.runOnNativeModulesQueueThread(
59+
new Runnable() {
60+
@Override
61+
public void run() {
62+
client.addPlugin(new FrescoFlipperPlugin());
63+
}
64+
});
65+
}
66+
});
67+
} else {
68+
client.addPlugin(new FrescoFlipperPlugin());
69+
}
70+
}
71+
}
72+
}

example/android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.animatedtabbarexample">
2+
package="dev.gorhom.animatedtabbar">
33

44
<uses-permission android:name="android.permission.INTERNET" />
55

example/android/app/src/main/java/com/animatedtabbarexample/MainActivity.java renamed to example/android/app/src/main/java/dev/gorhom/animatedtabbar/MainActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.animatedtabbarexample;
1+
package dev.gorhom.animatedtabbar;
22

33
import com.facebook.react.ReactActivity;
44
import com.facebook.react.ReactActivityDelegate;

example/android/app/src/main/java/com/animatedtabbarexample/MainApplication.java renamed to example/android/app/src/main/java/dev/gorhom/animatedtabbar/MainApplication.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
package com.animatedtabbarexample;
1+
package dev.gorhom.animatedtabbar;
22

33
import android.app.Application;
44
import android.content.Context;
55
import com.facebook.react.PackageList;
66
import com.facebook.react.ReactApplication;
7+
import com.facebook.react.ReactInstanceManager;
78
import com.facebook.react.ReactNativeHost;
89
import com.facebook.react.ReactPackage;
910
import com.facebook.soloader.SoLoader;
@@ -26,8 +27,6 @@ protected List<ReactPackage> getPackages() {
2627
List<ReactPackage> packages = new PackageList(this).getPackages();
2728
// Packages that cannot be autolinked yet can be added manually here, for AnimatedTabbarExample:
2829
// packages.add(new MyReactNativePackage());
29-
30-
3130
return packages;
3231
}
3332

@@ -46,23 +45,28 @@ public ReactNativeHost getReactNativeHost() {
4645
public void onCreate() {
4746
super.onCreate();
4847
SoLoader.init(this, /* native exopackage */ false);
49-
initializeFlipper(this); // Remove this line if you don't want Flipper enabled
48+
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
5049
}
5150

5251
/**
53-
* Loads Flipper in React Native templates.
52+
* Loads Flipper in React Native templates. Call this in the onCreate method with something like
53+
* initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
5454
*
5555
* @param context
56+
* @param reactInstanceManager
5657
*/
57-
private static void initializeFlipper(Context context) {
58+
private static void initializeFlipper(
59+
Context context, ReactInstanceManager reactInstanceManager) {
5860
if (BuildConfig.DEBUG) {
5961
try {
6062
/*
6163
We use reflection here to pick up the class that initializes Flipper,
6264
since Flipper library is not available in release mode
6365
*/
64-
Class<?> aClass = Class.forName("com.facebook.flipper.ReactNativeFlipper");
65-
aClass.getMethod("initializeFlipper", Context.class).invoke(null, context);
66+
Class<?> aClass = Class.forName("com.test.ReactNativeFlipper");
67+
aClass
68+
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
69+
.invoke(null, context, reactInstanceManager);
6670
} catch (ClassNotFoundException e) {
6771
e.printStackTrace();
6872
} catch (NoSuchMethodException e) {

example/android/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
buildscript {
44
ext {
5-
buildToolsVersion = "28.0.3"
5+
buildToolsVersion = "29.0.2"
66
minSdkVersion = 16
7-
compileSdkVersion = 28
8-
targetSdkVersion = 28
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")
15+
classpath("com.android.tools.build:gradle:3.5.3")
1616

1717
// NOTE: Do not place your application dependencies here; they belong
1818
// in the individual module build.gradle files

example/android/gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@
1919

2020
android.useAndroidX=true
2121
android.enableJetifier=true
22+
23+
# Version of flipper SDK to use with React Native
24+
FLIPPER_VERSION=0.54.0
Lines changed: 1 addition & 1 deletion
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

example/android/gradlew

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# you may not use this file except in compliance with the License.
88
# You may obtain a copy of the License at
99
#
10-
# http://www.apache.org/licenses/LICENSE-2.0
10+
# https://www.apache.org/licenses/LICENSE-2.0
1111
#
1212
# Unless required by applicable law or agreed to in writing, software
1313
# distributed under the License is distributed on an "AS IS" BASIS,
@@ -125,8 +125,8 @@ if $darwin; then
125125
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
126126
fi
127127

128-
# For Cygwin, switch paths to Windows format before running java
129-
if $cygwin ; then
128+
# For Cygwin or MSYS, switch paths to Windows format before running java
129+
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
130130
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
131131
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
132132
JAVACMD=`cygpath --unix "$JAVACMD"`
@@ -154,19 +154,19 @@ if $cygwin ; 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-
188-
exec "$JAVACMD" "$@"
183+
exec "$JAVACMD" "$@"

0 commit comments

Comments
 (0)