From efd0f9326d23f01393558575231b42ead42e4674 Mon Sep 17 00:00:00 2001 From: J M Rossy Date: Mon, 30 Sep 2019 18:31:04 +0200 Subject: [PATCH] Add info about building apks to README Remove unused instabug package Fix project syncing in Android Studio --- packages/mobile/.env | 2 - packages/mobile/.env.alfajores | 2 - packages/mobile/.env.integration | 2 - packages/mobile/.env.pilot | 2 - packages/mobile/.env.pilotstaging | 2 - packages/mobile/.env.production | 2 - packages/mobile/.env.staging | 2 - packages/mobile/.env.test | 2 - packages/mobile/README.md | 38 +++++++++++++++++-- packages/mobile/android/app/build.gradle | 1 - .../android/app/src/main/AndroidManifest.xml | 2 - .../java/org/celo/mobile/MainApplication.java | 16 -------- packages/mobile/android/build.gradle | 3 -- packages/mobile/android/settings.gradle | 2 - packages/mobile/package.json | 1 - yarn.lock | 5 --- 16 files changed, 34 insertions(+), 50 deletions(-) diff --git a/packages/mobile/.env b/packages/mobile/.env index 7423ed54d02..fb8e23246b2 100644 --- a/packages/mobile/.env +++ b/packages/mobile/.env @@ -3,7 +3,5 @@ DEFAULT_TESTNET=alfajoresstaging DEV_SETTINGS_ACTIVE_INITIALLY=true FIREBASE_ENABLED=true SECRETS_KEY=debug -INSTABUG_TOKEN= -INSTABUG_EVENTS= LOCAL_CURRENCY_SYMBOL=MXN SHOW_TESTNET_BANNER=true \ No newline at end of file diff --git a/packages/mobile/.env.alfajores b/packages/mobile/.env.alfajores index e3974511f5f..5cd9997011e 100644 --- a/packages/mobile/.env.alfajores +++ b/packages/mobile/.env.alfajores @@ -4,7 +4,5 @@ BLOCKCHAIN_API_URL=https://alfajores-dot-celo-testnet-production.appspot.com/ DEV_SETTINGS_ACTIVE_INITIALLY=false FIREBASE_ENABLED=true SECRETS_KEY=production -INSTABUG_TOKEN= -INSTABUG_EVENTS=button,shake LOCAL_CURRENCY_SYMBOL= SHOW_TESTNET_BANNER=true diff --git a/packages/mobile/.env.integration b/packages/mobile/.env.integration index d90d6dbcd67..4aa12ef2a62 100644 --- a/packages/mobile/.env.integration +++ b/packages/mobile/.env.integration @@ -4,7 +4,5 @@ BLOCKCHAIN_API_URL=https://integration-dot-celo-testnet.appspot.com/ DEV_SETTINGS_ACTIVE_INITIALLY=true FIREBASE_ENABLED=true SECRETS_KEY=integration -INSTABUG_TOKEN= -INSTABUG_EVENTS=button,shake LOCAL_CURRENCY_SYMBOL= SHOW_TESTNET_BANNER=true \ No newline at end of file diff --git a/packages/mobile/.env.pilot b/packages/mobile/.env.pilot index 85fbbbbd358..c4023bd4057 100644 --- a/packages/mobile/.env.pilot +++ b/packages/mobile/.env.pilot @@ -4,7 +4,5 @@ BLOCKCHAIN_API_URL=https://pilot-dot-celo-testnet-production.appspot.com/ DEV_SETTINGS_ACTIVE_INITIALLY=false FIREBASE_ENABLED=true SECRETS_KEY=production -INSTABUG_TOKEN= -INSTABUG_EVENTS=button,shake LOCAL_CURRENCY_SYMBOL=MXN SHOW_TESTNET_BANNER=false diff --git a/packages/mobile/.env.pilotstaging b/packages/mobile/.env.pilotstaging index a87b2d0f138..db0784c6aa8 100644 --- a/packages/mobile/.env.pilotstaging +++ b/packages/mobile/.env.pilotstaging @@ -4,7 +4,5 @@ BLOCKCHAIN_API_URL=https://pilotstaging-dot-celo-testnet.appspot.com/ DEV_SETTINGS_ACTIVE_INITIALLY=true FIREBASE_ENABLED=true SECRETS_KEY=pilotstaging -INSTABUG_TOKEN= -INSTABUG_EVENTS=button,shake LOCAL_CURRENCY_SYMBOL=MXN SHOW_TESTNET_BANNER=false diff --git a/packages/mobile/.env.production b/packages/mobile/.env.production index c7741b0f72d..3c55e4200d3 100644 --- a/packages/mobile/.env.production +++ b/packages/mobile/.env.production @@ -4,7 +4,5 @@ BLOCKCHAIN_API_URL=https://argentinaproduction-dot-celo-testnet-production.appsp DEV_SETTINGS_ACTIVE_INITIALLY=false FIREBASE_ENABLED=true SECRETS_KEY=production -INSTABUG_TOKEN= -INSTABUG_EVENTS=shake LOCAL_CURRENCY_SYMBOL= SHOW_TESTNET_BANNER=false diff --git a/packages/mobile/.env.staging b/packages/mobile/.env.staging index af8794654f2..03a668537ab 100644 --- a/packages/mobile/.env.staging +++ b/packages/mobile/.env.staging @@ -4,7 +4,5 @@ BLOCKCHAIN_API_URL=https://alfajoresstaging-dot-celo-testnet.appspot.com/ DEV_SETTINGS_ACTIVE_INITIALLY=true FIREBASE_ENABLED=true SECRETS_KEY=staging -INSTABUG_TOKEN= -INSTABUG_EVENTS=shake LOCAL_CURRENCY_SYMBOL= SHOW_TESTNET_BANNER= \ No newline at end of file diff --git a/packages/mobile/.env.test b/packages/mobile/.env.test index 49c1018685b..03e0c9625f2 100644 --- a/packages/mobile/.env.test +++ b/packages/mobile/.env.test @@ -4,7 +4,5 @@ BLOCKCHAIN_API_URL=https://alfajores-dot-celo-testnet-production.appspot.com DEV_SETTINGS_ACTIVE_INITIALLY=true FIREBASE_ENABLED=false SECRETS_KEY=debug -INSTABUG_TOKEN= -INSTABUG_EVENTS= LOCAL_CURRENCY_SYMBOL=MXN SHOW_TESTNET_BANNER=false diff --git a/packages/mobile/README.md b/packages/mobile/README.md index 5c1c715ab83..c0660c6e384 100644 --- a/packages/mobile/README.md +++ b/packages/mobile/README.md @@ -101,7 +101,7 @@ before rebuilding the app. Note that this will assume the testnets have a corres To execute the suite of tests, run `yarn test` -## Snapshot testing +### Snapshot testing We use Jest [snapshot testing][jest] to assert that no intentional changes to the component tree have been made without explicit developer intention. See an @@ -116,7 +116,7 @@ react components. It allows for deep rendering and interaction with the rendered tree to assert proper reactions to user interaction and input. See an example at [`src/send/SendAmount.test.tsx`] or read more about the [docs][rntl-docs] -## Saga testing +### Saga testing We use [redux-saga-test-plan][redux-saga-test-plan] to test complex sagas. See [`src/identity/verification.test.ts`] for an example. @@ -140,11 +140,41 @@ Next, the VM snapshot settings should be modified: For information on how to run and extend the e2e tests, refer to the [e2e readme][e2e readme]. +## Building APKs / Bundles + +The app can be build via the command line or in Android Studio. +For an exact set of commands, refer to the lanes in `fastlane/FastFile`. +For convinience, the basic are described below: + +### Creating a fake keystore + +If you have not yet created a keystore, one will be required to generate a release APKs / bundles: + +```sh +cd android/app +keytool -genkey -v -keystore celo-release-key.keystore -alias celo-key-alias -storepass celoFakeReleaseStorePass -keypass celoFakeReleaseKeyPass -keyalg RSA -keysize 2048 -validity 10000 -dname "CN=Android Debug,O=Android,C=US" +export CELO_RELEASE_STORE_PASSWORD=celoFakeReleaseStorePass +export CELO_RELEASE_KEY_PASSWORD=celoFakeReleaseKeyPass +``` + +### Building an APK or Bundle + +```sh +cd android/ +./gradlew clean +./gradlew bundle{YOUR_BUILDING_VARIANT}JsAndAssets +# For an APK: +./gradlew assemble{YOUR_BUILDING_VARIANT} -x bundle{YOUR_BUILDING_VARIANT}JsAndAssets +# Or for a bundle: +./gradlew bundle{YOUR_BUILDING_VARIANT} -x bundle{YOUR_BUILDING_VARIANT}JsAndAssets +``` + +Where `YOUR_BUILD_VARIANT` can be any of the app's build variants, such as debug or release. + ## Generating GraphQL Types We're using [GraphQL Code Generator][graphql code generator] to properly type -GraphQL queries. If you make a change to a query, run `yarn run gen-types` to -update the typings in the `typings` directory. +GraphQL queries. If you make a change to a query, run `yarn build:gen-graphql-types` to update the typings in the `typings` directory. ## Troubleshooting diff --git a/packages/mobile/android/app/build.gradle b/packages/mobile/android/app/build.gradle index 63dc175e86d..d51b161a6df 100644 --- a/packages/mobile/android/app/build.gradle +++ b/packages/mobile/android/app/build.gradle @@ -223,7 +223,6 @@ android { dependencies { implementation project(':react-native-install-referrer') implementation project(':react-native-send-intent') - // implementation project(':instabug-reactnative') // implementation project(':react-native-screens') implementation project(':react-native-webview') implementation project(':@react-native-community_netinfo') diff --git a/packages/mobile/android/app/src/main/AndroidManifest.xml b/packages/mobile/android/app/src/main/AndroidManifest.xml index 54e3dcbf8bb..95abf4ae8f9 100644 --- a/packages/mobile/android/app/src/main/AndroidManifest.xml +++ b/packages/mobile/android/app/src/main/AndroidManifest.xml @@ -10,8 +10,6 @@ - - diff --git a/packages/mobile/android/app/src/main/java/org/celo/mobile/MainApplication.java b/packages/mobile/android/app/src/main/java/org/celo/mobile/MainApplication.java index 74c396e0e78..53f86ed51b8 100644 --- a/packages/mobile/android/app/src/main/java/org/celo/mobile/MainApplication.java +++ b/packages/mobile/android/app/src/main/java/org/celo/mobile/MainApplication.java @@ -63,8 +63,6 @@ // Disabled due to dex count // import com.swmansion.rnscreens.RNScreensPackage; -// import com.instabug.library.invocation.InstabugInvocationEvent; -// import com.instabug.reactlibrary.RNInstabugReactnativePackage; public class MainApplication extends Application implements ShareApplication, ReactApplication { @@ -126,20 +124,6 @@ protected List getPackages() { packageList.add(new RNConfirmDeviceCredentialsPackage()); } - // Instabug - disabled due to dex count - // - // String tempInvocationEvents = BuildConfig.INSTABUG_EVENTS; - // String[] instabugInvocationEvents = tempInvocationEvents.split(","); - - // if (instabugInvocationEvents.length > 0) { - // packageList.add(new RNInstabugReactnativePackage.Builder(BuildConfig.INSTABUG_TOKEN, MainApplication.this) - // .setInvocationEvent(instabugInvocationEvents) - // .setPrimaryColor("#42D689") - // .setFloatingEdge("right") - // .setFloatingButtonOffsetFromTop(250) - // .build()); - // } - return packageList; } diff --git a/packages/mobile/android/build.gradle b/packages/mobile/android/build.gradle index 11d61a81db8..49d4d748c41 100644 --- a/packages/mobile/android/build.gradle +++ b/packages/mobile/android/build.gradle @@ -43,9 +43,6 @@ allprojects { flatDir { dirs celoClientDirectory } - maven { - url "https://sdks.instabug.com/nexus/repository/instabug-cp" - } } } diff --git a/packages/mobile/android/settings.gradle b/packages/mobile/android/settings.gradle index f6811bba81e..183105ba10b 100644 --- a/packages/mobile/android/settings.gradle +++ b/packages/mobile/android/settings.gradle @@ -5,8 +5,6 @@ include ':react-native-send-intent' project(':react-native-send-intent').projectDir = new File(rootProject.projectDir, '../../../node_modules/react-native-send-intent/android') include ':react-native-webview' project(':react-native-webview').projectDir = new File(rootProject.projectDir, '../../../node_modules/react-native-webview/android') -include ':instabug-reactnative' -project(':instabug-reactnative').projectDir = new File(rootProject.projectDir, '../../../node_modules/instabug-reactnative/android') include ':@react-native-community_netinfo' project(':@react-native-community_netinfo').projectDir = new File(rootProject.projectDir, '../../../node_modules/@react-native-community/netinfo/android') include ':react-native-screens' diff --git a/packages/mobile/package.json b/packages/mobile/package.json index 2e36fac09ab..787d3fc9355 100644 --- a/packages/mobile/package.json +++ b/packages/mobile/package.json @@ -68,7 +68,6 @@ "google-libphonenumber": "^3.2.4", "graphql": "^14.1.1", "i18next": "^11.9.1", - "instabug-reactnative": "^8.4.3", "js-sha3": "^0.7.0", "lodash": "^4.17.14", "moment": "^2.22.1", diff --git a/yarn.lock b/yarn.lock index 6463b909740..82980b519c3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17465,11 +17465,6 @@ inquirer@^6.2.2, inquirer@~6.3.1: strip-ansi "^5.1.0" through "^2.3.6" -instabug-reactnative@^8.4.3: - version "8.4.3" - resolved "https://registry.yarnpkg.com/instabug-reactnative/-/instabug-reactnative-8.4.3.tgz#a169b2c2fe81984f8400d04b7bb6aba403ddf3e2" - integrity sha512-NOjl1aMDQPeqa9XpaF38nMWKZ/YTSZEQ5uOhdAcAP8mNjd0W4Pr/Cdx1SZcRztqiJgYPgcp8d5dcvDOGZeKkzw== - interpret@1.2.0, interpret@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296"