Skip to content

Commit

Permalink
Hotfix: compilation issue, target Android API level 31 (#335)
Browse files Browse the repository at this point in the history
* [wallet/mobile] fix: RN compilation issue, bump Android SDK version to 31

* [wallet/mobile] task: update changelog and project version

* [wallet/mobile] task: update changelog and NDK version
  • Loading branch information
OlegMakarenko authored Sep 4, 2023
1 parent 0fc1838 commit feb491a
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 38 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.

The changelog format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [v1.4.3][v1.4.3] - 31-Aug-2023
### Changed
- Target Android SDK 31.

## [v1.4.2][v1.4.2] - 24-Oct-2022
### Changed
- Upgraded the dependency `symbol-sdk` version to `v2.0.3`.
Expand Down Expand Up @@ -53,3 +57,4 @@ The changelog format is based on [Keep a Changelog](https://keepachangelog.com/e
[v1.4.0]: https://github.com/symbol/mobile-wallet/releases/tag/1.4.0
[v1.4.1]: https://github.com/symbol/mobile-wallet/releases/tag/1.4.1
[v1.4.2]: https://github.com/symbol/mobile-wallet/releases/tag/1.4.2
[v1.4.3]: https://github.com/symbol/mobile-wallet/releases/tag/1.4.3
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This application is built on `React Native` and therefore assumes you have all t
### Prerequisites

- The **default network configuration** is fetched from the `env/default.json` file, and as part of the first-time setup, you should provide these. Check the `env/default.json.example` file to see what keys are required.
- Node version should be **12.1.0** or above.
- Node version should be from **16.x** to **17.9.1**.
- [Hermes](https://hermesengine.dev/) is disabled [because of Realm dependency]
- Android hosts 2 different product flavors - `dev` and `prod`, so you will need to specify this when building/releasing the application for android.
- [Yarn](https://yarnpkg.com/en/) is preferred over **NPM** as a package manager.
Expand Down
13 changes: 7 additions & 6 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,12 @@ android {
}
}
signingConfigs {
config {
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
}
config {
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
}
}
flavorDimensions "version"
productFlavors {
Expand Down Expand Up @@ -214,6 +214,7 @@ dependencies {
implementation 'com.facebook.fresco:animated-gif:2.0.0'
implementation("com.squareup.okhttp3:okhttp:3.12.13")
implementation("com.squareup.okhttp3:okhttp-urlconnection:3.12.13")
implementation 'androidx.work:work-runtime-ktx:2.7.0'

if (enableHermes) {
def hermesPath = "../../node_modules/hermes-engine/android/";
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

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

<application android:usesCleartextTraffic="true" android:requestLegacyExternalStorage="true" tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" />
<application android:usesCleartextTraffic="true" android:requestLegacyExternalStorage="true" tools:targetApi="31" tools:ignore="GoogleAppIndexingWarning" />
</manifest>
3 changes: 2 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize">
android:windowSoftInputMode="adjustResize"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down
14 changes: 11 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

def REACT_NATIVE_VERSION = new File(['node', '--print',"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())

buildscript {
ext {
minSdkVersion = 23
compileSdkVersion = 30
targetSdkVersion = 30
compileSdkVersion = 31
targetSdkVersion = 31
supportLibVersion = "30.0.0"
RNNKotlinVersion = "1.3.61" // Or any version above 1.3.x
RNNKotlinStdlib = "kotlin-stdlib-jdk8"
ndkVersion = "24.0.8215888"
}
repositories {
google()
Expand All @@ -25,6 +28,12 @@ buildscript {
}

allprojects {
configurations.all {
resolutionStrategy {
// Remove this override in 0.65+, as a proper fix is included in react-native itself.
force "com.facebook.react:react-native:" + REACT_NATIVE_VERSION
}
}
repositories {
mavenLocal()
maven {
Expand All @@ -39,7 +48,6 @@ allprojects {
google()
jcenter()
maven { url 'https://jitpack.io' }
maven { url "$rootDir/../node_modules/react-native-background-fetch/android/libs" }
}
}

Expand Down
3 changes: 0 additions & 3 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,6 @@ DEPENDENCIES:
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
- ReactNativeNavigation (from `../node_modules/react-native-navigation`)
- rn-fetch-blob (from `../node_modules/rn-fetch-blob`)
- RNBackgroundFetch (from `../node_modules/react-native-background-fetch`)
- "RNCAsyncStorage (from `../node_modules/@react-native-community/async-storage`)"
- "RNCClipboard (from `../node_modules/@react-native-community/clipboard`)"
- RNFS (from `../node_modules/react-native-fs`)
Expand Down Expand Up @@ -418,8 +417,6 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-navigation"
rn-fetch-blob:
:path: "../node_modules/rn-fetch-blob"
RNBackgroundFetch:
:path: "../node_modules/react-native-background-fetch"
RNCAsyncStorage:
:path: "../node_modules/@react-native-community/async-storage"
RNCClipboard:
Expand Down
2 changes: 0 additions & 2 deletions ios/SymbolWallet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@
9396401B9A429C2DB170AE0A /* libPods-SymbolWallet.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SymbolWallet.a"; sourceTree = BUILT_PRODUCTS_DIR; };
991053664030455EAEDDEDF9 /* libRNReanimated.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNReanimated.a; sourceTree = "<group>"; };
A84869EF85FE4E039C607E45 /* libRNSecureStorage.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNSecureStorage.a; sourceTree = "<group>"; };
AF2173C424112D60002D5B4A /* RNBackgroundFetch+AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "RNBackgroundFetch+AppDelegate.m"; path = "../node_modules/react-native-background-fetch/ios/RNBackgroundFetch/RNBackgroundFetch+AppDelegate.m"; sourceTree = "<group>"; };
AF2173C9241131E5002D5B4A /* TSBackgroundFetch.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = TSBackgroundFetch.framework; path = "../node_modules/react-native-background-fetch/ios/RNBackgroundFetch/TSBackgroundFetch.framework"; sourceTree = "<group>"; };
AFA0252342EC4426B2BE4855 /* libRNGestureHandler.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNGestureHandler.a; sourceTree = "<group>"; };
AFACF895240D277B005AF57E /* libRNPermissions.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libRNPermissions.a; sourceTree = BUILT_PRODUCTS_DIR; };
B7C9D77DBAD945F397301644 /* libRNCAsyncStorage.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNCAsyncStorage.a; sourceTree = "<group>"; };
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "symbol-mobile-wallet",
"version": "1.4.2",
"version": "1.4.3",
"private": true,
"scripts": {
"git-info": "echo export default \"{ version: '$(git describe --tags `git rev-list --tags --max-count=1`)' };\" > src/shared/_git_commit.js",
Expand Down Expand Up @@ -54,7 +54,6 @@
"querystring-es3": "^0.2.1",
"react": "16.9.0",
"react-native": "0.61.5",
"react-native-background-fetch": "^3.0.4",
"react-native-camera": "3.3.0",
"react-native-chart-kit": "^6.6.1",
"react-native-check-box": "^2.1.7",
Expand Down
12 changes: 7 additions & 5 deletions src/config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
* @format
* @flow
*/
import {
import config from '../../env/default.json';
import { NetworkType } from 'symbol-sdk';
import { languageNames } from '@src/locales/i18n';
import type { AppNetworkType } from '@src/storage/models/NetworkModel';

const {
sessionTimeoutInSeconds,
marketCurrencyName,
explorerURL,
Expand All @@ -21,10 +26,7 @@ import {
nativeMosaicId,
optInWhiteList,
nglFinanceBot,
} from 'react-native-env-json';
import { NetworkType } from 'symbol-sdk';
import { languageNames } from '@src/locales/i18n';
import type { AppNetworkType } from '@src/storage/models/NetworkModel';
} = config;

// Session timeout
const getSessionTimeoutInMillis = (): number => {
Expand Down
14 changes: 0 additions & 14 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4837,11 +4837,6 @@ fast-levenshtein@~2.0.6:
resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=

fast-plist@^0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/fast-plist/-/fast-plist-0.1.2.tgz#a45aff345196006d406ca6cdcd05f69051ef35b8"
integrity sha1-pFr/NFGWAG1AbKbNzQX2kFHvNbg=

faye-websocket@~0.11.0:
version "0.11.3"
resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.11.3.tgz#5c0e9a8968e8912c286639fde977a8b209f2508e"
Expand Down Expand Up @@ -9133,15 +9128,6 @@ react-move@^2.7.0:
prop-types "^15.6.2"
react-lifecycles-compat "^3.0.4"

react-native-background-fetch@^3.0.4:
version "3.1.0"
resolved "https://registry.yarnpkg.com/react-native-background-fetch/-/react-native-background-fetch-3.1.0.tgz#5ec182662e76bd8257f21c6f65cdcb73e87a0708"
integrity sha512-dnrfX3Od4r3aKuRSwDkpaPFXc3dYD5DbIW7CWC41M1CdEZEXNIWfZRvJPMVa72iflOzAh68ZTfZ3PgBK/NDtsQ==
dependencies:
fast-plist "^0.1.2"
plist "^3.0.1"
xcode "^2.0.0"

react-native-camera@3.3.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/react-native-camera/-/react-native-camera-3.3.0.tgz#3ac45efb0bad1a44540026c05459f42f7f0bbdba"
Expand Down

0 comments on commit feb491a

Please sign in to comment.