Skip to content

Commit 112b60c

Browse files
committed
update android
1 parent 6262f71 commit 112b60c

28 files changed

+1336
-1833
lines changed

android/app/build.gradle

+27-13
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,12 @@ import com.android.build.OutputFile
7373
*/
7474

7575
project.ext.react = [
76-
entryFile: "index.js"
76+
entryFile: "index.js",
77+
enableHermes: false,
7778
]
7879

7980
apply from: "../../node_modules/react-native/react.gradle"
81+
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
8082

8183
/**
8284
* Set this to true to create two separate APKs instead of one:
@@ -93,6 +95,9 @@ def enableSeparateBuildPerCPUArchitecture = false
9395
*/
9496
def enableProguardInReleaseBuilds = false
9597

98+
def jscFlavor = 'org.webkit:android-jsc:+'
99+
def enableHermes = project.ext.react.get("enableHermes", false);
100+
96101
android {
97102
compileSdkVersion rootProject.ext.compileSdkVersion
98103
buildToolsVersion "28.0.3"
@@ -138,23 +143,29 @@ android {
138143
}
139144
}
140145
}
146+
147+
packagingOptions {
148+
pickFirst '**/armeabi-v7a/libc++_shared.so'
149+
pickFirst '**/x86/libc++_shared.so'
150+
pickFirst '**/arm64-v8a/libc++_shared.so'
151+
pickFirst '**/x86_64/libc++_shared.so'
152+
pickFirst '**/x86/libjsc.so'
153+
pickFirst '**/armeabi-v7a/libjsc.so'
154+
}
141155
}
142156

143157
dependencies {
144-
implementation project(':react-native-snackbar')
145-
implementation project(':@react-native-community_blur')
146-
implementation project(':react-native-fast-image')
147-
implementation project(':react-native-svg')
148-
implementation project(':react-native-webview')
149-
implementation project(':react-native-spinkit')
150-
implementation project(':react-native-linear-gradient')
151-
implementation project(':@react-native-community_async-storage')
152-
implementation project(':react-native-vector-icons')
153-
implementation project(':react-native-screens')
154-
implementation project(':react-native-gesture-handler')
155158
implementation fileTree(dir: "libs", include: ["*.jar"])
156159
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
157-
implementation "com.facebook.react:react-native:+" // From node_modules
160+
implementation "com.facebook.react:react-native:0.60.3" // From node_modules
161+
162+
if (enableHermes) {
163+
def hermesPath = "../../node_modules/hermesvm/android/";
164+
debugImplementation files(hermesPath + "hermes-debug.aar")
165+
releaseImplementation files(hermesPath + "hermes-release.aar")
166+
} else {
167+
implementation jscFlavor
168+
}
158169
}
159170

160171
// Run this once to be able to run the application with BUCK
@@ -163,3 +174,6 @@ task copyDownloadableDepsToLibs(type: Copy) {
163174
from configurations.compile
164175
into 'libs'
165176
}
177+
178+
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
179+

android/app/src/main/AndroidManifest.xml

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.moviesrevamped">
2+
xmlns:tools="http://schemas.android.com/tools"
3+
package="com.moviesrevamped">
34

45
<uses-permission android:name="android.permission.INTERNET" />
56
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
@@ -10,7 +11,8 @@
1011
android:icon="@mipmap/ic_launcher"
1112
android:roundIcon="@mipmap/ic_launcher_round"
1213
android:allowBackup="false"
13-
android:theme="@style/AppTheme">
14+
android:theme="@style/AppTheme"
15+
tools:ignore="GoogleAppIndexingWarning">
1416
<activity
1517
android:name=".MainActivity"
1618
android:label="@string/app_name"
-68.7 KB
Binary file not shown.
-64 KB
Binary file not shown.
-13.1 KB
Binary file not shown.
-63.6 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-55.6 KB
Binary file not shown.
-110 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
-27.7 KB
Binary file not shown.
Binary file not shown.
-25 KB
Binary file not shown.

android/app/src/main/java/com/moviesrevamped/MainApplication.java

+8-30
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,15 @@
11
package com.moviesrevamped;
22

3-
import android.app.Application;
43

5-
import com.facebook.react.ReactApplication;
6-
import com.azendoo.reactnativesnackbar.SnackbarPackage;
7-
import com.cmcewen.blurview.BlurViewPackage;
8-
import com.dylanvann.fastimage.FastImageViewPackage;
9-
import com.horcrux.svg.SvgPackage;
10-
import com.reactnativecommunity.webview.RNCWebViewPackage;
11-
import com.react.rnspinkit.RNSpinkitPackage;
12-
import com.BV.LinearGradient.LinearGradientPackage;
13-
import com.reactnativecommunity.asyncstorage.AsyncStoragePackage;
14-
import com.oblador.vectoricons.VectorIconsPackage;
15-
import com.swmansion.rnscreens.RNScreensPackage;
16-
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
4+
import android.app.Application;
5+
import android.util.Log;
6+
import com.facebook.react.PackageList;
7+
import com.facebook.hermes.reactexecutor.HermesExecutorFactory;
178
import com.facebook.react.ReactNativeHost;
9+
import com.facebook.react.bridge.JavaScriptExecutorFactory;
10+
import com.facebook.react.ReactApplication;
1811
import com.facebook.react.ReactPackage;
19-
import com.facebook.react.shell.MainReactPackage;
2012
import com.facebook.soloader.SoLoader;
21-
22-
import java.util.Arrays;
2313
import java.util.List;
2414

2515
public class MainApplication extends Application implements ReactApplication {
@@ -32,20 +22,8 @@ public boolean getUseDeveloperSupport() {
3222

3323
@Override
3424
protected List<ReactPackage> getPackages() {
35-
return Arrays.<ReactPackage>asList(
36-
new MainReactPackage(),
37-
new SnackbarPackage(),
38-
new BlurViewPackage(),
39-
new FastImageViewPackage(),
40-
new SvgPackage(),
41-
new RNCWebViewPackage(),
42-
new RNSpinkitPackage(),
43-
new LinearGradientPackage(),
44-
new AsyncStoragePackage(),
45-
new VectorIconsPackage(),
46-
new RNScreensPackage(),
47-
new RNGestureHandlerPackage()
48-
);
25+
List<ReactPackage> packages = new PackageList(this).getPackages();
26+
return packages;
4927
}
5028

5129
@Override

android/build.gradle

+10-7
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,26 @@ buildscript {
1313
jcenter()
1414
}
1515
dependencies {
16-
classpath 'com.android.tools.build:gradle:3.3.1'
16+
classpath 'com.android.tools.build:gradle:3.4.1'
1717

1818
// NOTE: Do not place your application dependencies here; they belong
1919
// in the individual module build.gradle files
2020
}
2121
}
2222

2323
allprojects {
24-
repositories {
25-
// Add jitpack repository (added by react-native-spinkit)
26-
maven { url "https://jitpack.io" }
24+
repositories {
2725
mavenLocal()
28-
google()
29-
jcenter()
26+
// Add jitpack repository (added by react-native-spinkit)
27+
maven { url "https://jitpack.io" }
3028
maven {
3129
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
32-
url "$rootDir/../node_modules/react-native/android"
30+
url("$rootDir/../node_modules/react-native/android")
3331
}
32+
maven {
33+
url("$rootDir/../node_modules/jsc-android/dist")
34+
}
35+
google()
36+
jcenter()
3437
}
3538
}

android/gradle.properties

+2
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@
1616
# This option should only be used with decoupled projects. More details, visit
1717
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1818
# org.gradle.parallel=true
19+
android.useAndroidX=true
20+
android.enableJetifier=true

android/gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-all.zip

android/gradlew

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ 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" "-Xms64m"'
3232

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

android/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" "-Xms64m"
1818

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

android/settings.gradle

+1-23
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,3 @@
11
rootProject.name = 'MoviesRevamped'
2-
include ':react-native-snackbar'
3-
project(':react-native-snackbar').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-snackbar/android')
4-
include ':@react-native-community_blur'
5-
project(':@react-native-community_blur').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/blur/android')
6-
include ':react-native-fast-image'
7-
project(':react-native-fast-image').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fast-image/android')
8-
include ':react-native-svg'
9-
project(':react-native-svg').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-svg/android')
10-
include ':react-native-webview'
11-
project(':react-native-webview').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-webview/android')
12-
include ':react-native-spinkit'
13-
project(':react-native-spinkit').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-spinkit/android')
14-
include ':react-native-linear-gradient'
15-
project(':react-native-linear-gradient').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-linear-gradient/android')
16-
include ':@react-native-community_async-storage'
17-
project(':@react-native-community_async-storage').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/async-storage/android')
18-
include ':react-native-vector-icons'
19-
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
20-
include ':react-native-screens'
21-
project(':react-native-screens').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-screens/android')
22-
include ':react-native-gesture-handler'
23-
project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android')
24-
2+
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
253
include ':app'

0 commit comments

Comments
 (0)