mirror of
https://github.com/status-im/react-native-image-resizer.git
synced 2025-02-25 12:55:54 +00:00
Update README.md with manual linking for Android (#101)
This commit is contained in:
parent
9c891a7bbc
commit
e7c4ef5473
@ -32,6 +32,9 @@ rnpm install react-native-image-resizer@0.0.12
|
|||||||
|
|
||||||
Note: on latest versions of React Native, you may have an error during the Gradle build on Android (`com.android.dex.DexException: Multiple dex files define Landroid/support/v7/appcompat/R$anim`). Run `cd android && ./gradlew clean` to fix this.
|
Note: on latest versions of React Native, you may have an error during the Gradle build on Android (`com.android.dex.DexException: Multiple dex files define Landroid/support/v7/appcompat/R$anim`). Run `cd android && ./gradlew clean` to fix this.
|
||||||
|
|
||||||
|
#### Manual linking
|
||||||
|
Manual link information for Android: [Link](docs/android_manual_config.md)
|
||||||
|
|
||||||
## Usage example
|
## Usage example
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
|
20
docs/android_manual_config.md
Normal file
20
docs/android_manual_config.md
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#### Manual linking
|
||||||
|
If your any reason you don want to link this project using 'react-native link', go to settings.gradle and add
|
||||||
|
```
|
||||||
|
include ':react-native-image-resizer'
|
||||||
|
project(':react-native-image-resizer').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-resizer/android')
|
||||||
|
```
|
||||||
|
then go the file that you build the ReactInstance and add the packager to it.
|
||||||
|
|
||||||
|
```
|
||||||
|
ReactInstanceManager.Builder builder = ReactInstanceManager.builder()
|
||||||
|
.setApplication(application)
|
||||||
|
.setDefaultHardwareBackBtnHandler(application.getGAMActivity())
|
||||||
|
.setInitialLifecycleState(LifecycleState.RESUMED)
|
||||||
|
.setCurrentActivity((Activity) application.getGAMActivity())
|
||||||
|
.addPackage(new RealmReactPackage())
|
||||||
|
.addPackage(new MainReactPackageWrapper())
|
||||||
|
.addPackage(new StoreReactNativePackage())
|
||||||
|
.addPackage(new ImageResizerPackage()) <------- (Add this package on the Builder list)
|
||||||
|
.addPackage(gamCommunicationReactPackage);
|
||||||
|
```
|
Loading…
x
Reference in New Issue
Block a user