Skip to content
This repository has been archived by the owner on Oct 5, 2022. It is now read-only.

Commit

Permalink
Upgrade to RN 0.59.10
Browse files Browse the repository at this point in the history
  • Loading branch information
Pablo Enrici committed Oct 4, 2019
1 parent bf97f61 commit ea715c4
Show file tree
Hide file tree
Showing 27 changed files with 1,145 additions and 790 deletions.
3 changes: 2 additions & 1 deletion .buckconfig
@@ -1,6 +1,7 @@

[android]
target = Google Inc.:Google APIs:23
target = android-28


[maven_repositories]
central = https://repo1.maven.org/maven2
20 changes: 15 additions & 5 deletions .travis.yml
Expand Up @@ -27,6 +27,11 @@ matrix:
- npm --version
- gem install fastlane --version 2.118.1 --no-document --quiet

# Required after upgrading to RN v0.59.10, otherwise Sentry code inside
# "Bundle React Native code and images" build phase fails.
# See https://github.com/getsentry/sentry-react-native/issues/135#issuecomment-447366274
- brew install watchman

# Decrypt SSH deploy key for GitHub certificates repo and add to agent
- openssl aes-256-cbc -K $encrypted_89b232081b73_key -iv $encrypted_89b232081b73_iv
-in github_deploy_key.enc -out github_deploy_key -d
Expand All @@ -48,8 +53,8 @@ matrix:
- npm run env || travis_terminate 1
- cat .env

# supposedly this shouldn't be necesary, possible RN bug?
# see https://github.com/facebook/react-native/issues/18472
# Supposedly this shouldn't be necesary, possible RN bug?
# See https://github.com/facebook/react-native/issues/18472
- npm i -g react-native-cli@2.0.1
- react-native info
- npm run ios:bundle -- --dev false || travis_terminate 1
Expand All @@ -64,17 +69,22 @@ matrix:
components:
- tools
- platform-tools
- android-27
- android-28
- extra-google-m2repository
- extra-google-google_play_services

before_install:
- nvm install 8.15.0 # enforce using same version as local builds
- npm i -g npm@6.4.1 # enforce using same version as local builds
- nvm alias default 8.15.0 # otherwise sentry-cli will fail with a cryptic error
- node --version
- npm --version
- gem install fastlane --no-document --quiet
- yes | $ANDROID_HOME/tools/bin/sdkmanager "build-tools;27.0.3" # accept android licenses
- gem install fastlane --version 2.118.1 --no-document --quiet
- yes | $ANDROID_HOME/tools/bin/sdkmanager "build-tools;28.0.3" # accept android licenses

# After upgrading to RN v0.59.10, we need to increase the number of inotify watches
# See https://github.com/fbsamples/f8app/issues/55#issuecomment-228995680
- echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

# Decrypt Sentry properties file and add copy to /android directory
- openssl aes-256-cbc -K $encrypted_ace616ffe366_key -iv $encrypted_ace616ffe366_iv
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -6,7 +6,7 @@ This is a Metronome-specific mobile wallet build on React Native.

In order to run a development version of the app in the iOS simulator, run:

**XCode v10.1 and Android Studio v3.1 are required**
**XCode v10.1 and Android Studio v3.4.2 are required**

```shell
npm install
Expand Down
19 changes: 4 additions & 15 deletions android/app/BUCK
Expand Up @@ -8,23 +8,12 @@
# - `buck install -r android/app` - compile, install and run application
#

lib_deps = []
load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")

for jarfile in glob(['libs/*.jar']):
name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')]
lib_deps.append(':' + name)
prebuilt_jar(
name = name,
binary_jar = jarfile,
)
lib_deps = []

for aarfile in glob(['libs/*.aar']):
name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')]
lib_deps.append(':' + name)
android_prebuilt_aar(
name = name,
aar = aarfile,
)
create_aar_targets(glob(["libs/*.aar"]))
create_jar_targets(glob(["libs/*.jar"]))

android_library(
name = "all-libs",
Expand Down
17 changes: 11 additions & 6 deletions android/app/build.gradle
Expand Up @@ -96,13 +96,17 @@ def enableSeparateBuildPerCPUArchitecture = false
def enableProguardInReleaseBuilds = false

android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
compileSdkVersion rootProject.ext.compileSdkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

defaultConfig {
applicationId "sh.autonomous.wallet.mobile"
minSdkVersion 18
targetSdkVersion 27
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode project.hasProperty('VERSION_CODE') ? Integer.parseInt(VERSION_CODE) : 1
versionName project.hasProperty('VERSION_NAME') ? VERSION_NAME : "1.0"
}
Expand All @@ -111,7 +115,7 @@ android {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86", "arm64-v8a"
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}
}
signingConfigs {
Expand All @@ -136,7 +140,7 @@ android {
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3]
def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86_64": 4]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
Expand All @@ -147,6 +151,7 @@ android {
}

dependencies {
implementation project(':@react-native-community_async-storage')
implementation project(':react-native-config')
implementation(project(":react-native-google-analytics-bridge"), {
exclude group: "com.google.android.gms"
Expand Down
17 changes: 17 additions & 0 deletions android/app/build_defs.bzl
@@ -0,0 +1,17 @@
"""Helper definitions to glob .aar and .jar targets"""
def create_aar_targets(aarfiles):
for aarfile in aarfiles:
name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
lib_deps.append(":" + name)
android_prebuilt_aar(
name = name,
aar = aarfile,
)
def create_jar_targets(jarfiles):
for jarfile in jarfiles:
name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")]
lib_deps.append(":" + name)
prebuilt_jar(
name = name,
binary_jar = jarfile,
)
6 changes: 6 additions & 0 deletions android/app/src/debug/AndroidManifest.xml
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<application tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" android:networkSecurityConfig="@xml/react_native_config" />
</manifest>
8 changes: 8 additions & 0 deletions android/app/src/debug/res/xml/react_native_config.xml
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="false">localhost</domain>
<domain includeSubdomains="false">10.0.2.2</domain>
<domain includeSubdomains="false">10.0.3.2</domain>
</domain-config>
</network-security-config>
3 changes: 1 addition & 2 deletions android/app/src/main/AndroidManifest.xml
Expand Up @@ -5,7 +5,6 @@
xmlns:tools="http://schemas.android.com/tools">

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

<!-- Needed by https://github.com/moaazsidat/react-native-qrcode-scanner-->
<uses-permission android:name="android.permission.VIBRATE"/>
Expand All @@ -23,7 +22,7 @@
<meta-data
tools:replace="android:value"
android:name="android.support.VERSION"
android:value="27.0.2" />
android:value="28.0.0" />

<activity
android:name=".SplashActivity"
Expand Down
Expand Up @@ -3,6 +3,7 @@
import android.app.Application;

import com.facebook.react.ReactApplication;
import com.reactnativecommunity.asyncstorage.AsyncStoragePackage;
import com.lugg.ReactNativeConfig.ReactNativeConfigPackage;
import com.idehub.GoogleAnalyticsBridge.GoogleAnalyticsBridgePackage;
import io.sentry.RNSentryPackage;
Expand Down Expand Up @@ -32,7 +33,8 @@ public boolean getUseDeveloperSupport() {
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new MainReactPackage(),
new AsyncStoragePackage(),
new ReactNativeConfigPackage(),
new GoogleAnalyticsBridgePackage(),
new RNSentryPackage(),
Expand Down
9 changes: 2 additions & 7 deletions android/build.gradle
Expand Up @@ -6,15 +6,15 @@ buildscript {
buildToolsVersion = "28.0.3"
minSdkVersion = 18
compileSdkVersion = 28
targetSdkVersion = 27
targetSdkVersion = 28
supportLibVersion = "28.0.0"
}
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath("com.android.tools.build:gradle:3.4.0")

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down Expand Up @@ -44,8 +44,3 @@ subprojects {
}
}
}

task wrapper(type: Wrapper) {
gradleVersion = '4.7'
distributionUrl = distributionUrl.replace("bin", "all")
}
Binary file modified android/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Expand Up @@ -2,5 +2,5 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip

2 changes: 1 addition & 1 deletion android/gradlew
Expand Up @@ -7,7 +7,7 @@
##############################################################################

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

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
Expand Down
2 changes: 1 addition & 1 deletion android/gradlew.bat
Expand Up @@ -14,7 +14,7 @@ set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

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

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
Expand Down
2 changes: 2 additions & 0 deletions android/settings.gradle
Expand Up @@ -19,5 +19,7 @@ include ':react-native-svg'
project(':react-native-svg').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-svg/android')
include ':react-native-randombytes'
project(':react-native-randombytes').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-randombytes/android')
include ':@react-native-community_async-storage'
project(':@react-native-community_async-storage').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/async-storage/android')

include ':app'

0 comments on commit ea715c4

Please sign in to comment.