create-react-native-dapp icon indicating copy to clipboard operation
create-react-native-dapp copied to clipboard

Wrong react native version

Open francesco-clementi-92 opened this issue 4 years ago • 6 comments

  • I'm submitting a ... [X ] bug report

  • Summary After creating the app and starting on expo goapp android: Warning: Invalid version [email protected] for expo sdkVersion 43.0.0. Use [email protected]

francesco-clementi-92 avatar Nov 12 '21 11:11 francesco-clementi-92

I had the same issue yesterday !

you need to update the package.json with right version and run "expo install" to apply the changes.

blixit avatar Nov 12 '21 13:11 blixit

@blixit Thanks for suggesting the fix; can you submit a PR or show your changes so I can deploy a fix here? 🙏

cawfree avatar Nov 17 '21 14:11 cawfree

I can do that this weekend

blixit avatar Nov 18 '21 08:11 blixit

After investigation, the bad version comes from the execution of npx create-react-native-app ${name} -t with-typescript in the createBaseProject() function from src/buidler/index.ts.

The template with-typescript is defined here https://github.com/expo/examples/tree/master/with-typescript. You can see that it contains the version 0.64.2.

16 days ago, a pull request has been merged to upgrade the package to make it compatible with Expo SDK 43: https://github.com/expo/examples/pull/339 but the react-native version changed from this moment. Expo has already made the change here 11 days ago.

We have 2 ways to fix our issue:

  • fixing the version of react-native in the builder by setting 'dependencies.react-native': '^0.64.3' but i'm not a fan of this solution which makes this package more dependant to expo.
  • submit a PR to Expo examples and wait: this is what I'm going to do.

blixit avatar Nov 21 '21 00:11 blixit

I submitted the PR: https://github.com/expo/examples/pull/342

blixit avatar Nov 21 '21 01:11 blixit

@francesco-clementi-92 @cawfree my PR has been merged. There is no need to update the current package.

blixit avatar Nov 23 '21 00:11 blixit