After setting up your environment, you can follow the steps below to run the pass Culture mobile application on Android.
If you encounter errors during this setup, refer to the Troubleshooting section at the end of this document.
First download Android Studio and open the folder android
in Android Studio.
Then open the Android Virtual Devices Manager and select (or create) a Virtual Device with the android version you want to run.
-
Download
testing.keystore
andtesting.keystore.properties
files from 1password and place it inside the/android/keystores
directory.If you do not find
testing.keystore
, contact an admin. -
Modify
testing.keystore.properties
to match with this configuration (required inbuild.gradle
) :keyAlias=passculture storeFile=testing.keystore storePassword= keyPassword=
Download the google-services.json
file from 1password and place it inside the android/app
directory. You can also download this file from the Firebase console.
To run the app, simply run:
yarn android:testing
This will also start the metro server. If not, run in another tab :
yarn start
No value has been specified for property 'manifestOutputDirectory'
In Android Studio: File > Settings > Experimental > Gradle -> uncheck "Only sync the active variant" checkbox.
En cas de soucis avec le JDK installer via brew install --cask zulu11
et ajouter le chemin JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home
dans .zshrc
Version conflict
It happens when you try to install with a build number lower than the one already installed.
- Ensure that there is one
$ yarn run-android | grep 'INSTALL_FAILED_VERSION_DOWNGRADE'
- If no line containing
'INSTALL_FAILED_VERSION_DOWNGRADE'
is caught, this is not the problem - If a line with
'INSTALL_FAILED_VERSION_DOWNGRADE'
is caught → Uninstall the app on your emulator before building:
General error for building the app on Android Studio
These are the general solutions for errors :
run cd android && ./gradlew clean
to clear the build directory.
on the root of the repository : rm -rf node_modules
then yarn
or yarn install
, this will delete all the installed modules from the repo then reinstalled it.
Try to invalidate the cache: in Android Studio > open project's android folder > file tab > Invalidate caches/restart > Invalidate and restart
If you're on M1 or M2 Mac and the problem still remains, see the error below.
[M1 & M2 processor] Error while building the app on android with Android Studio : `Android Studio-- Cause: error=86, Bad CPU type in executable` or `Task :app:processApptestingDebugResources FAILED`
If you get this error on M1 or M2 Mac, installing Rosetta 2 should solve the issue. You can install it with this command : softwareupdate --install-rosetta
.
Rosetta will allow applications requiring Intel processor to run on M1 & M2 Mac.