小编Muh*_*baz的帖子

类型错误:未定义不是一个对象(评估'_reactNativeImagePicker.default.showImagePicker')

使用 React Image Picker 我面临这个错误:TypeError: undefined is not an object (evaluating '_reactNativeImagePicker.default.showImagePicker')

当我单击图像选择器功能时会发生这种情况

手机截图:

错误图像

这是我的代码:

import React from 'react';
import { View, Text,Button } from 'react-native';
import ImagePicker from 'react-native-image-picker';

const options = {
    title: 'Select Avatar',
    customButtons: [{ name: 'fb', title: 'Choose Photo from Facebook' }],
    storageOptions: {
      skipBackup: true,
      path: 'images',
    },
  };

function Picker(){
    const openPicker =()=>{
      ImagePicker.showImagePicker(options, (response) => {
        console.log('Response = ', response);
      
        if (response.didCancel) {
          console.log('User cancelled image picker');
        } else if (response.error) { …
Run Code Online (Sandbox Code Playgroud)

react-native react-native-image-picker

11
推荐指数
3
解决办法
7850
查看次数

如何修复任务“:app:processDebugManifest”执行失败

使用 npx react-native run-android 命令安装 React Native 图像选择器后,我遇到了这个问题。

D:\WEB SAYLANI\React Native CLI\AwesomeProject>npx react-native run-android info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag. Jetifier found 1222 file(s) to forward-jetify. Using 4 workers... info JS server already running. info Installing the app...

Task :app:processDebugManifest FAILED

See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual …

gradle react-native

4
推荐指数
1
解决办法
1万
查看次数