React native module for reading and decoding BPG-encoded images
npm install react-native-bpg$ npm install react-native-bpg --save
$ react-native link react-native-bpg
NDK should be installed. This can be done with SDK manager.
Project should contain ``./android/local.properties` with correct paths to SDK/NDK (it is possible to set up environment variables).
Windows example:
``
sdk.dir=D\:\\Development\\_SDK\\AndroidSDK\\AndroidSDK
ndk.dir=D\:\\Development\\_SDK\\AndroidSDK\\ndk-bundle
_There will be the warnings during the native libraries build phase._
#### Android
1. Open up android/app/src/main/java/[...]/MainActivity.javaimport com.kornell.bpg.RNReactNativeBpgPackage;
- Add to the imports at the top of the filenew RNReactNativeBpgPackage()
- Add to the list returned by the getPackages() methodandroid/settings.gradle
2. Append the following lines to :`
`
include ':react-native-bpg'
project(':react-native-bpg').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-bpg/android')
android/app/build.gradle
3. Insert the following lines inside the dependencies block in :`
`
compile project(':react-native-bpg')
#### iOS
Not implemented for iOS
#### Windows
Not implemented for Windows
Example project can be found in links section
Thank to the author of this article
> add png support
> add gif support
> add download from web (check with self-signed ssl and provide option to enable skip-checking)
> add methods for `*AsPromise`
> rename current methods to `*AsCallback`
If native libs are not building, try several techniques to clean cache:
npm start -- --reset-cache
remove node_modules and install dependencies again with npm i
On Windows
remove `%USER_HOME%.gradle\caches\`
On Mac or Linux: `> rm -rf $HOME/.gradle/caches/`
On Both
`> cd android`
`> gradlew cleanBuildCache``
then rebuild an application.