React Native countries listing app.
Version Betta
- Pagination
- More filters
node -v
v12.14.1
npm -v
6.13.4
- Clone the project:
git colne https://github.com/Metourni/CountriesApp.git
- Install dependencies:
If you're using
npm
run the cmd:
npm install
If you're using
yarn
run the cmd:
yarn install
- Config the environment :
// In the file : app/config/index.js
export const {
api:{
// ....
}
}
- Run the project:
If you're using
android
run the cmd:
npx react-native run-android
or
npx yarn android
If you're using
ios
run the cmd:
npx react-native run-ios
or
npx yarn ios
- Create and then copy a keystore file to android/app: Change the value between {} to whatever you want
keytool -genkey -v -keystore {mykeystore}.keystore -alias {mykeyalias} -keyalg RSA -keysize 2048 -validity 10000
- Setup your gradle variables in android/gradle.properties:
MYAPP_RELEASE_STORE_FILE=mykeystore.keystore
MYAPP_RELEASE_KEY_ALIAS=mykeyalias
MYAPP_RELEASE_STORE_PASSWORD=*****
MYAPP_RELEASE_KEY_PASSWORD=*****
- Add signing config to android/app/build.gradle if not exist:
android {
signingConfigs {
release {
storeFile file(MYAPP_RELEASE_STORE_FILE)
storePassword MYAPP_RELEASE_STORE_PASSWORD
keyAlias MYAPP_RELEASE_KEY_ALIAS
keyPassword MYAPP_RELEASE_KEY_PASSWORD
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
}
- Generate your release APK:
cd android && ./gradlew assembleRelease
or
npm run apk
or
yarn apk
-
If error check this: If you you got: Error: Duplicate resources check this solution
facebook/react-native#22234 (comment) -
If you want to build bundle
cd android && ./gradlew bundleRelease
- Testing the release build of your app
react-native run-android --variant=release
[Duplicate resources issues solution] [facebook/react-native#22234 (comment)]