Skip to content

Latest commit

 

History

History
92 lines (57 loc) · 3.23 KB

File metadata and controls

92 lines (57 loc) · 3.23 KB

Installation - Android

After setting up your environment, you can follow the steps below to run the pass Culture mobile application on Android.

Further installation process

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.

✍️ Code signing

  • Download testing.keystore and testing.keystore.properties files from Keeper 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 in build.gradle) :

    keyAlias=passculture
    storeFile=testing.keystore
    storePassword=
    keyPassword=
    

🔥 Firebase setup

Download the google-services.json file from Keeper and place it inside the android/app directory. You can also download this file from the Firebase console.

🚀 Run the app

To run the app, simply run:

yarn android:testing

This will also start the metro server. If not, run in another tab :

yarn start

Troubleshooting

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.