简体   繁体   English

我正在使用 react-native-photo-upload 库上传个人资料图片,但它抛出构建失败错误

[英]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.

相关问题 我正在使用带有react和Express的react-image-crop与Crop上传个人资料图片 - I am using react-image-crop with react and Express To upload profile pic with Crop 在cordova项目中,我正在使用文件传输插件上传个人资料照片,它始终返回Code 1错误? - In cordova project I am using file transfer plugin to upload a profile photo it always returns Code 1 error? React Native 上传图片失败 - React Native Failed Upload Image 响应本机上传图像的网络请求失败 - Network request failed on react native upload image 如何在 Google Drive 的特定文件夹上使用 React Native 上传文档? - How can I upload Document using React Native on Google Drive's Specific Folder? React Native 无法将图像上传到 Firebase - React native Failed to upload images to firebase 如何在 React Native 中使用 axios 将图像上传到服务器? - How can i upload image to server using axios in react native? 如何使用 React 和 Next 上传照片? - How to upload a photo with React and Next? 使用ONSEN UI + Angular上传个人资料照片 - Profile Photo Upload with ONSEN UI + Angular 反应本机图像上传文件扩展错误 - React Native Image Upload File Extension Error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM