Skip to content

Instantly share code, notes, and snippets.

@dayaki
Created May 6, 2019 08:51
Show Gist options
  • Save dayaki/0d7f6b2f0df291cff3dd8b307ccab241 to your computer and use it in GitHub Desktop.
Save dayaki/0d7f6b2f0df291cff3dd8b307ccab241 to your computer and use it in GitHub Desktop.
Building a debug apk with React Native Navigation
react-native bundle --dev false --platform android --entry-file index.js --bundle-output ./android/app/src/main/assets/index.android.bundle --assets-dest ./android/app/src/main/res
cd android
./gradlew app:assembleDebug
@dayaki
Copy link
Author

dayaki commented May 17, 2019

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/com/your-company-name/app-package-name/src/main/assets/index.android.bundle --assets-dest android/com/your-company-name/app-package-name/src/main/res/

@dayaki
Copy link
Author

dayaki commented May 23, 2019

// Building APK
Build for Android
cd android

for debug:
./gradlew app:assembleDebug

for release:
./gradlew assembleRelease

// Android App Bundles
Generating the release APK:
cd android ./gradlew bundleRelease

Test the release build of your app:
react-native run-android --variant=release

@dayaki
Copy link
Author

dayaki commented May 24, 2019

Make SVG icon fill color changeable.

You can use react-native-svg-transformer to import svgs in to your code. Once you've set that up, you'll be able to do:

import ProfileIcon from './images/profile.svg'

You can then use ProfileIcon as a component.

To control the colour, edit the svg file and change the fill or stroke attributes to "currentColor" (so <polygon fill="currentColor" ...>). You can then set the color style on your svg element and it'll use that colour: <ProfileIcon style={{ color: '#f80' }}/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment