The application to discover history through rides from Découverto.
This project was bootstrapped with Create React Native App.
Below you'll find information about performing common tasks. The most recent version of this guide is available here.
cd ${ANDROID_HOME}/emulator && emulator -avd nexus
Add thoses lines to gradle.properties:
android.useAndroidX=true
android.enableJetifier=true
Execute ./androidx.sh
to convert all components
Before compaling you will have to get a Google Maps API key, and write it in the android/app/src/main/res/values/string.xml
file like this:
<resources>
...
<string name="google_maps">BkP0rUVlhNDeszphpRwqysxwaa7IdntWB0nbJRK1</string>
</resources>
To make sure that you don't commit the key please execute: git update-index --assume-unchanged android/app/src/main/res/values/string.xml
adb shell am start -W -a android.intent.action.VIEW -d "https://decouverto.fr/preview/jYW1cN8" com.lesbaladesdedecouverto
or
adb shell am start -W -a android.intent.action.VIEW -d "decouverto://decouverto/preview/jYW1cN8" com.lesbaladesdedecouverto
Create android/local.properties
file with
sdk.dir = /Users/cedricjung/Library/Android/sdk
Copy the following path:
/usr/libexec/java_home -V | grep jdk
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home
export PATH=$JAVA_HOME/bin:$PATH
export ANDROID_HOME=/Users/cedricjung/Library/Android/sdk
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
DNS:
cd ~/Library/Android/sdk/emulator
./emulator -list-avds
./emulator @Pixel_3a_API_30_x86 -dns-server 8.8.8.8
==> I created two bash files you need to excute this way:
. mac-env.sh
## Untrack file
git update-index --assume-unchanged android/gradle.properties
git update-index --assume-unchanged android/app/src/main/res/values/strings.xml
In android/gradle.properties
file
android.useAndroidX=true
android.enableJetifier=true
MYAPP_RELEASE_STORE_FILE=les-balades-de-decouverto.keystore
MYAPP_RELEASE_STORE_PASSWORD=******************************
MYAPP_RELEASE_KEY_ALIAS=les-balades-de-decouverto
MYAPP_RELEASE_KEY_PASSWORD=******************************
If Yarn was installed when the project was initialized, then dependencies will have been installed via Yarn, and you should probably use it to run these commands as well. Unlike dependency installation, command running syntax is identical for Yarn and NPM at the time of this writing.
Runs your app in development mode.
Open it in the Expo app on your phone to view it. It will reload if you save edits to your files, and you will see build errors and logs in the terminal.
Sometimes you may need to reset or clear the React Native packager's cache. To do so, you can pass the --reset-cache
flag to the start script:
npm start -- --reset-cache
# or
yarn start -- --reset-cache
#### /usr/libexec/java_home -V | grep jdk
Runs the jest test runner on your tests.
Like npm start
, but also attempts to open your app in the iOS Simulator if you're on a Mac and have it installed.
Like npm start
, but also attempts to open your app on a connected Android device or emulator. Requires an installation of Android build tools (see React Native docs for detailed setup). We also recommend installing Genymotion as your Android emulator. Once you've finished setting up the native build environment, there are two options for making the right copy of adb
available to Create React Native App:
- Make sure that you can run adb from your terminal.
- Open Genymotion and navigate to
Settings -> ADB
. Select “Use custom Android SDK tools” and update with your Android SDK directory.
- Find Genymotion’s copy of adb. On macOS for example, this is normally
/Applications/Genymotion.app/Contents/MacOS/tools/
. - Add the Genymotion tools directory to your path (instructions for Mac, Linux, and Windows).
- Make sure that you can run adb from your terminal.
This project is set up to use jest for tests. You can configure whatever testing strategy you like, but jest works out of the box. Create test files in directories called __tests__
or with the .test
extension to have the files loaded by jest. See the the template project for an example test. The jest documentation is also a wonderful resource, as is the React Native testing tutorial.
If you're on a Mac, there are a few errors that users sometimes see when attempting to npm run ios
:
- "non-zero exit code: 107"
- "You may need to install Xcode" but it is already installed
- and others
There are a few steps you may want to take to troubleshoot these kinds of errors:
- Make sure Xcode is installed and open it to accept the license agreement if it prompts you. You can install it from the Mac App Store.
- Open Xcode's Preferences, the Locations tab, and make sure that the
Command Line Tools
menu option is set to something. Sometimes when the CLI tools are first installed by Homebrew this option is left blank, which can prevent Apple utilities from finding the simulator. Make sure to re-runnpm/yarn run ios
after doing so. - If that doesn't work, open the Simulator, and under the app menu select
Reset Contents and Settings...
. After that has finished, quit the Simulator, and re-runnpm/yarn run ios
.
Don't write /bin
export JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.212.b04-0.fc29.x86_64/jre"
Use Java 17 with Gradle 7.5.
Change compile
to implementation
.
Bug on module for Audio. ==> Need to upgrade doublesymmetry/react-native-track-player#1865
For problem regarding debugging:
export NODE_OPTIONS=--openssl-legacy-provider
adb reverse tcp:8081 tcp:8081
Need to fix getExtremums