简体   繁体   中英

I'm using react-native-photo-upload library to upload profile pic but it's throwing build failed error

The libary I'm using is yarn add react-native-photo-upload from https://www.npmjs.com/package/react-native-photo-upload and it's throwing the following error:

**/home/haseeb/Desktop/RN/myProject/node_modules/react-native-image-picker/android/build/intermediates/res/merged/release/values-v26/values-v26.xml:15:21-54: AAPT: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.

/home/haseeb/Desktop/RN/myProject/node_modules/react-native-image-picker/android/build/intermediates/res/merged/release/values-v26/values-v26.xml:15: error: Error: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.
:react-native-image-picker:processReleaseResources FAILED

**FAILURE**: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-image-picker:processReleaseResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 5.653 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html**

i tried android.enableAapt2=false in gradle.properties of react-native-image-picker but no gain...same error

plz help to resolve it!

Be sure to follow the instructions of the library, after running yarn add react-native-photo-upload , you need to make sure to link the package and build the project again:

react-native link react-native-image-picker
react-native link react-native-image-resizer
react-native link react-native-fs

After that, you can go to yourProject/android/settings.gradle and verify if all modules have been added. It may look like:

include ':module-name'
project(':module-name').projectDir = new File(rootProject.projectDir, 
'../node_modules/module-name/android')

You may also go to yourProject/android/app/build.gradle to check if the modules are present on the dependencies:

dependencies {
    compile project(':module-name')
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM