Expo App crashes after using clipboard

SDK Version: ^1.7.0

So I am trying to use Clipboard, but it always crashes as soon as I use it more than once. So if I first load my App it works, but if I try to copy something again it crashes.

Her is my code:

<TouchableHighlight>
 <ListItem
              showIcon={false}
              title={listing.email || 'Error'}
              IconComponent={
                <Icon name="email" backgroundColor={colors.medium} />
              }
              onPress={async () => {
                const email = listing.email;

                const cb = Clipboard.setString(email);
                const text = await Clipboard.getStringAsync();

                alert(`Copied ${text}:)`);
              }}
            />
</TouchableHighlight>

Thanks for helping!

Ok, for some reason it works now with this code. But I still want to mention that the code I have above worked perfectly fine on https://snack.expo.io/

<TouchableHighlight>
 <ListItem
              showIcon={false}
              title={listing.email || 'Error'}
              IconComponent={
                <Icon name="email" backgroundColor={colors.medium} />
              }
              onPress={async () => {
                const email = listing.email;

               Clipboard.setString(email);
               

                alert(`Copied ${email}:)`);
              }}
            />
</TouchableHighlight>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.