[英]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:我正在使用的库是
yarn add react-native-photo-upload
from https://www.npmjs.com/package/react-native-photo-upload并抛出以下错误:
**/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我在 react-native-image-picker 的 gradle.properties 中尝试了
android.enableAapt2=false
但没有增益......同样的错误
plz help to resolve it! lz帮忙解决!
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:请务必按照库的说明进行操作,运行
yarn add react-native-photo-upload
,您需要确保链接包并再次构建项目:
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.之后,您可以转到
yourProject/android/settings.gradle
并验证是否已添加所有模块。 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:您还可以转到
yourProject/android/app/build.gradle
以检查模块是否存在于依赖项中:
dependencies {
compile project(':module-name')
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.