More detailed information on the wiki. In particular, check out our contributor guidelines!
The Zooniverse Mobile app is a React Native app that allows folks like you and me to contribute to astronomy, ecology, and anthropology research from their couch, bathtub, or bus stop (but don't swipe and drive, please).
- Node >= 16 (Recommend >= 18)
- Follow the instructions for Android and iOS setup in this guide.
- Clone down this repo and navigate to its directory (called
mobile). - Run
npm install(later, if you need to reinstall dependencies for some reason, you can runrm -rf node_modules/ && npm install) - Run
npm start.
- Troubleshooting wiki for additional help
- XCode
- An iPhone X Simulator, which you can run from XCode.
- To run on an iOS device see [Running on device - iOS]https://reactnative.dev/docs/running-on-device?platform=ios
On the command line, from the mobile directory, run:
cd ios && rm -rf Podfile.lock && pod install && cd ... You may need tobrew install cocoapodsfirst.npm run ios
- Android Studio
- You'll need at least one emulator. To get one:
- Within Android Studio, open the "AVD Manager" - in the toolbar click the icon with the purple device and small android (fourth from the right)
- Click 'Create Virtual Device' - bottom left-hand corner
- Create at least one using the latest Android Release. I have a few different size and Android Release configurations
- You can also use an Android device that is plugged into your computer. Run
adb devicesand confirm you see your device listed. If not use [Running on device - android]https://reactnative.dev/docs/running-on-device?platform=android for troubleshooting - Also you'll need a Gradle properties file outside the project for keeping secrets that aren't checked into source control. This should be in ~/.gradle/gradle.properties and contain the following:
MYAPP_RELEASE_STORE_FILE=/path/to/your/keystore.jks
MYAPP_RELEASE_KEY_ALIAS=android
MYAPP_RELEASE_STORE_PASSWORD=android
MYAPP_RELEASE_KEY_PASSWORD=**you can find this in passbolt**
You will have to get the key itself from an existing maintainer. We are looking for a way to securely store this so you can get it without worrying about corruption. You don't need it to build for debugging—only for release to the Play Store.
- To run in the emulator from the command line (you'll need device connected or emulator already running):
npm run android. Shortly, your emulator should boot with the Zooniverse app on it.- You need to have either a device emulator open already or a physical device plugged into your computer. Otherwise, you'll need to run through Android Studio
- If Android studio prompts you to update Gradle files, you should do it.
- The command
react-native run-androidwill install the build, but fail in launching the app due to a bug with thereact-nativescript with having a separateapplicationIdfor development builds.
You may also want to set up error reporting from your local copy of the application to our reporting service, Sentry. Here are instructions on how to do that!
This project is setup with Reactotron. Learn more here. Reactotron is useful for:
- Inspecting network requestsl.
- As an alternative for console.log (Separates the logs for each device/simulator being used).
In order to use with an android device/emulator you must run
adb reverse tcp:9090 tcp:9090before running the project.
Notes:
- It used to be standard to build the Android project in Android Studio but the preferred way is now through the command line.
- Google requires API 35 but this requires a higher version of gradle than what our current version of React Native provides. Until we upgrade RN, add this line to the gradle.properties before you build for release
android.aapt2FromMavenOverride=/Users/XXX/Library/Android/sdk/build-tools/35.0.0/aapt2and update the XXX to correct directory. If you do not have 35.0.0 open Android Studio and download the SDK 35. This suggestion comes from https://stackoverflow.com/questions/78678063/android-15-update-compilesdk-android-35-cause-an-error-res-table-type-type-e.
Steps:
- Reach out to a developer to get the upload key and the key.properties file.
- Place both in the android/app folder.
- Run
npx react-native build-android --mode=release - The file will be built to android/app/build/outputs/bundle/release/app-release.aab.
- Drag n drop the file into the "App bundles" in Google Play store where you would normally create the internal testing release.
Note: Nothing has changed with the iOS release process, continue to build and archive via Xcode.