Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

[WIP] Upgrade to RN61 #187

Open
wants to merge 18 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
18 changes: 9 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ jobs:
node-dependencies:
working_directory: ~/uport-mobile
docker:
- image: circleci/node:8
- image: circleci/node:10
steps:
- checkout
- restore_cache:
Expand All @@ -25,7 +25,7 @@ jobs:
node-test:
working_directory: ~/uport-mobile
docker:
- image: circleci/node:8
- image: circleci/node:10
steps:
- checkout
- attach_workspace:
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
package-android-bundle:
working_directory: ~/uport-mobile
docker:
- image: circleci/node:8
- image: circleci/node:10
steps:
- checkout
- attach_workspace:
Expand All @@ -64,7 +64,7 @@ jobs:
- yarn-{{ arch }}-v5
- run:
name: package react native android bundle independently
command: yarn package-android --max-workers=4
command: yarn package-android --max-workers=2
no_output_timeout: 30m
- persist_to_workspace:
root: ~/uport-mobile
Expand Down Expand Up @@ -94,16 +94,16 @@ jobs:

- restore_cache:
keys:
- android-{{ arch }}-v4-{{ checksum "build.gradle" }}
- android-{{ arch }}-v4
- android-{{ arch }}-v5-{{ checksum "build.gradle" }}
- android-{{ arch }}-v5
- run:
name: ensure daemon is fresh
command: ./gradlew --stop
- run:
name: get android dependencies
command: ./gradlew :app:dependencies androidDependencies
- save_cache:
key: android-{{ arch }}-v4-{{ checksum "build.gradle" }}
key: android-{{ arch }}-v5-{{ checksum "build.gradle" }}
paths:
- .gradle
- ~/.gradle
Expand Down Expand Up @@ -131,8 +131,8 @@ jobs:

- restore_cache:
keys:
- android-{{ arch }}-v4-{{ checksum "build.gradle" }}
- android-{{ arch }}-v4
- android-{{ arch }}-v5-{{ checksum "build.gradle" }}
- android-{{ arch }}-v5
- run:
name: ensure daemon is fresh
command: ./gradlew --stop
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ captures/
# Uncomment the following lines if you do not want to check your keystore files in.
#*.jks
#*.keystore
!debug.keystore

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
Expand Down Expand Up @@ -429,6 +430,9 @@ playground.xcworkspace
# Add this line if you want to avoid checking in source code from the Xcode workspace
# *.xcworkspace

# CocoaPods
ios/Pods

# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ After cloning this repository cd into the directory
```bash=
$ yarn global add react-native-cli (to install CLI)
$ yarn
$ npx jetify
```

### Linking native libraries
Expand Down
163 changes: 86 additions & 77 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@

buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
maven {
url "http://dl.bintray.com/kunickiaj/maven"
}
}
// repositories {
// maven { url 'https://maven.fabric.io/public' }
// maven {
// url "http://dl.bintray.com/kunickiaj/maven"
// }
// }

dependencies {
// These docs use an open ended version so that our plugin
// can be updated quickly in response to Android tooling updates

// We recommend changing it to the latest version from our changelog:
//
classpath "io.fabric.tools:gradle:$fabric_tools_version"
// classpath "io.fabric.tools:gradle:$fabric_tools_version"

}
}

Expand Down Expand Up @@ -40,12 +42,12 @@ apply plugin: "com.android.application"
*/

// Put Fabric plugin after Android plugin
apply plugin: 'io.fabric'
// apply plugin: 'io.fabric'


repositories {
maven { url 'https://maven.fabric.io/public' }
}
// repositories {
// maven { url 'https://maven.fabric.io/public' }
// }

import com.android.build.OutputFile

Expand Down Expand Up @@ -112,14 +114,16 @@ import com.android.build.OutputFile
* ]
*/

apply from: "../../node_modules/react-native/react.gradle"

project.ext.react = [
// the name of the generated asset file containing your JS bundle
bundleAssetName: "index.android.bundle",
inputExcludes: ["android/**", "ios/**", 'fastlane/**', 'build/**'],
extraPackagerArgs: ["--max-workers=1"],
]
entryFile: "index.js",
// the name of the generated asset file containing your JS bundle
bundleAssetName: "index.android.bundle",
inputExcludes: ["android/**", "ios/**", 'fastlane/**', 'build/**'],
extraPackagerArgs: ["--max-workers=1"],
enableHermes: false, // clean and rebuild if changing
]

apply from: "../../node_modules/react-native/react.gradle"

/**
* Set this to true to create two separate APKs instead of one:
Expand All @@ -136,6 +140,28 @@ def enableSeparateBuildPerCPUArchitecture = true
*/
def enableProguardInReleaseBuilds = false

/**
* The preferred build flavor of JavaScriptCore.
*
* For example, to use the international variant, you can use:
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
*
* The international variant includes ICU i18n library and necessary data
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
* give correct results when using with locales other than en-US. Note that
* this variant is about 6MiB larger per architecture than default.
*/
def jscFlavor = 'org.webkit:android-jsc:+'
/**
* Whether to enable the Hermes VM.
*
* This should be set on project.ext.react and mirrored here. If it is not set
* on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
* and the benefits of using Hermes will therefore be sharply reduced.
*/
def enableHermes = project.ext.react.get("enableHermes", false);


// is gradle started for release build?
// this is not bullet proof since there may exist some tasks that call for release but are not explicitly run
boolean releaseRequested = false
Expand All @@ -151,9 +177,17 @@ apply from: "../signing.gradle"

android {
compileSdkVersion compile_sdk_version
buildToolsVersion build_tools_version
dexOptions {
jumboMode true

packagingOptions {
pickFirst 'lib/x86/libc++_shared.so'
pickFirst "lib/x86_64/libc++_shared.so"
pickFirst "lib/armeabi-v7a/libc++_shared.so"
pickFirst "lib/arm64-v8a/libc++_shared.so"
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

sourceSets {
Expand All @@ -174,7 +208,7 @@ android {
multiDexKeepFile file('multidex-config.txt')

missingDimensionStrategy 'react-native-camera', 'general'
missingDimensionStrategy "RNN.reactNativeVersion", "reactNative57_5"
missingDimensionStrategy "RNN.reactNativeVersion", "reactNative60"

}

Expand Down Expand Up @@ -205,6 +239,7 @@ android {
debug {
manifestPlaceholders = [excludeSystemAlertWindowPermission: "false"]
versionNameSuffix "-debug"
signingConfig signingConfigs.debug
}
release {
manifestPlaceholders = [excludeSystemAlertWindowPermission: "true"]
Expand All @@ -216,6 +251,7 @@ android {
}
}
}

// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
if (variant.name.toLowerCase().contains("debug")) {
Expand All @@ -225,8 +261,8 @@ android {
} else {
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, "x86_64": 4]
// https://developer.android.com/studio/build/configure-apk-splits.html
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 @@ -243,83 +279,54 @@ android {
disable 'RestrictedApi'
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

}

configurations.all {

resolutionStrategy {
force(
//added these to force a single version of google play services
"org.webkit:android-jsc:r236355",
//react-native-fcm
"com.google.firebase:firebase-core:$play_services_version",
"com.google.firebase:firebase-messaging:$play_services_version",
"com.google.android.gms:play-services-gcm:$play_services_version",
"com.android.support:support-v4:$support_lib_version",
"com.android.support:appcompat-v7:$support_lib_version",
// "com.google.firebase:firebase-core:$play_services_version",
// "com.google.firebase:firebase-messaging:$play_services_version",
// "com.google.android.gms:play-services-gcm:$play_services_version",
// "com.android.support:support-v4:$support_lib_version",
// "com.android.support:appcompat-v7:$support_lib_version",
)
}
}

dependencies {



implementation fileTree(dir: "libs", include: ["*.jar"])
implementation project(':react-native-community-netinfo')
implementation project(':@react-native-community_async-storage')
implementation project(':react-native-share')
implementation(project(':react-native-firebase')) {
transitive = false
}
implementation "com.facebook.react:react-native:+"
implementation project(':react-native-navigation')
implementation project(':react-native-device-info')
implementation project(':rn-fetch-blob')
implementation project(':react-native-vector-icons')
implementation project(':react-native-passcode-android')
implementation project(':react-native-randombytes')
implementation project(':react-native-image-picker')
implementation(project(':react-native-camera')) {
exclude group: "com.google.android.gms"
exclude group: "com.facebook.infer.annotation"
}
implementation project(':react-native-intent-launcher')

implementation project(':react-native-uport-signer')
implementation "com.facebook.react:react-native:$react_native_version"

implementation(
//required by react-native-firebase
"com.google.firebase:firebase-config:$play_services_version",
)
implementation(
//required by react-native-firebase
"com.google.firebase:firebase-messaging:$play_services_version",
)

// From node_modules
implementation("com.crashlytics.sdk.android:crashlytics:$crashlytics_version@aar") {
transitive = true
}

implementation project(':react-native-firebase')
implementation "com.google.android.gms:play-services-base:16.1.0"
implementation "com.google.firebase:firebase-core:16.0.9"

// implementation("com.crashlytics.sdk.android:crashlytics:$crashlytics_version@aar") {
// transitive = true
// }

implementation "com.squareup.okhttp3:okhttp:$okhttp_version"
implementation "com.squareup.okhttp3:logging-interceptor:$okhttp_version"

//noinspection GradleCompatible
implementation "com.android.support:appcompat-v7:$support_lib_version"
implementation "com.android.support:recyclerview-v7:$support_lib_version"
implementation "com.android.support:design:$support_lib_version"

implementation "com.amazonaws:aws-android-sdk-core:$aws_lib_version"
implementation "com.amazonaws:aws-android-sdk-s3:$aws_lib_version"
implementation "com.amazonaws:aws-android-sdk-ddb:$aws_lib_version"
implementation "com.amazonaws:aws-android-sdk-cognito:$aws_lib_version"
implementation "com.amazonaws:aws-android-sdk-cognitoidentityprovider:$aws_lib_version"
implementation "com.amazonaws:aws-android-sdk-sns:$aws_lib_version"


if (enableHermes) {
def hermesPath = "../../node_modules/hermes-engine/android/";
debugImplementation files(hermesPath + "hermes-debug.aar")
releaseImplementation files(hermesPath + "hermes-release.aar")
} else {
implementation jscFlavor
}


}
Expand All @@ -331,4 +338,6 @@ task copyDownloadableDepsToLibs(type: Copy) {
into 'libs'
}


apply plugin: 'com.google.gms.google-services'
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
6 changes: 3 additions & 3 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleTask"
android:theme="@style/SplashTheme"

android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down Expand Up @@ -155,9 +155,9 @@
android:name="io.fabric.ApiKey"
android:value="d727ebc9dbf0bbfb341f6ad2c33f118b18400891" />


<provider
android:name="android.support.v4.content.FileProvider"
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider"
android:grantUriPermissions="true"
android:exported="false">
Expand Down
Binary file modified android/app/src/main/assets/fonts/FontAwesome5_Brands.ttf
Binary file not shown.
Binary file modified android/app/src/main/assets/fonts/FontAwesome5_Regular.ttf
Binary file not shown.
Binary file modified android/app/src/main/assets/fonts/FontAwesome5_Solid.ttf
Binary file not shown.
Binary file added android/app/src/main/assets/fonts/Fontisto.ttf
Binary file not shown.
Binary file modified android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified android/app/src/main/assets/fonts/Octicons.ttf
Binary file not shown.
Loading