Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tried to register two views with the same name AndroidDropdownPicker #320

Closed
appukuttan-shailesh opened this issue May 3, 2020 · 14 comments
Labels
duplicate This issue or pull request already exists

Comments

@appukuttan-shailesh
Copy link

Describe the bug

Getting error with following message:

Tried to register two views with the same name AndroidDropdownPicker

The error seems to be similar to this:
react-native-picker/picker#15

To Reproduce

Steps to reproduce the behavior:
In my project, I have used also this component:
import { Picker } from '@react-native-community/picker';
I believe it is a clash between these components. Any way to avoid this error and be able to use both?

Expected behavior

Be able to use this component without clashing with other components.

Screenshots

"n/a".

Additional details

  • Device: Android
  • OS: Android 10
  • react-native-picker-select version: 7.0.0
  • react-native version: 0.62.2
  • react version: 16.11.0

Reproduction and/or code sample

import React, { useState } from 'react';
import { StyleSheet, TouchableNativeFeedback, View, Text, Image } from 'react-native';
import RNPickerSelect from 'react-native-picker-select';

export default function AdminHome({ navigation }) {
    return (
            <View>
                <RNPickerSelect
                accessibilityLabel={'gender'}
                    onValueChange={(value) => console.log(value)}
                    items={[
                        { label: 'Football', value: 'football' },
                        { label: 'Baseball', value: 'baseball' },
                        { label: 'Hockey', value: 'hockey' },
                    ]}
                />
        </View>
    );
}
@appukuttan-shailesh
Copy link
Author

Also, the solution mentioned here did not work for me. All my imports of that component already were:
import { Picker } from '@react-native-community/picker';

@badarshahzad
Copy link

+1

I have also faced the same issue
Screenshot from 2020-05-19 12-45-33

@badarshahzad
Copy link

+1

I have also faced the same issue
Screenshot from 2020-05-19 12-45-33

These are the libraries version im using
"@react-native-community/picker": "^1.5.0",
"react": "16.9.0",
"react-native": "0.61.2",

@lfkwtz
Copy link
Collaborator

lfkwtz commented May 21, 2020

sounds like the issue is using both this library and the newly abstracted Picker library.

either that library will need to be updated to handle this scenario - or this'll be solved once #303 is merged in.

@lfkwtz lfkwtz added the duplicate This issue or pull request already exists label May 21, 2020
@androxxe
Copy link

androxxe commented Jun 3, 2020

i have the same issue

@mattmcdonald-uk
Copy link
Contributor

Can confirm #303 solves this.

For now you can use patch-package to switch this package to the community library.

@n3rd253
Copy link

n3rd253 commented Jul 19, 2020

Any idea when this will be merged?

@lfkwtz lfkwtz closed this as completed Aug 4, 2020
@plgrazon
Copy link

plgrazon commented Oct 7, 2020

I know this has been closed. 8.0.1 Fixed my iOS issues but it started breaking my Android build.

@lfkwtz
Copy link
Collaborator

lfkwtz commented Oct 7, 2020

@plgrazon worth opening a new report

@RajatKumarChahar
Copy link

Build is failing for android

@plgrazon
Copy link

plgrazon commented Oct 8, 2020

@plgrazon worth opening a new report

Yup! Just did issue #374

@higor21
Copy link

higor21 commented Dec 7, 2020

I fixed this problema installing the following versions:
"@react-native-community/picker": "1.6.0"
"react-native-picker-select": "7",

@whatdtech
Copy link

whatdtech commented Dec 15, 2020

@react-native-community/picker deprecated. So remove it by yarn remove @react-native-community/picker and install yarn add @react-native-picker/picker . This solved the issue for me.

@nayookyaw
Copy link

I changed react-native-community/datetimepicker version from

2.4.0 to 3.0.9

"@react-native-community/datetimepicker": "^3.0.9"

We can assume the old version will get error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests