rnc-archive / react-native-webgl

DEPRECATED: use expo-gl – Implements WebGL for react-native
296 stars 73 forks source link

Error: bundling failed: ambiguous resolution #39

Closed Culzean closed 4 years ago

Culzean commented 6 years ago

I am getting an when attempting to run the examples. From react-native-webgl\example I run npm i --save react-native run-android

I get this error

Bundling index.android.js [development, non-minified] 0.0% (0/1), failed. error: bundling failed: ambiguous resolution: module ...\react-native-webgl\example\index.android.js tries to require react-native, but there are several files providing this module. You can delete or fix them:

I have tried this command as suggested on a few threads,

npm start -- --reset-cache

however I get the error:

Looks like you installed react-native globally, maybe you meant react-native-cli?

Any ideas how I might get the examples running?

Culzean commented 6 years ago

I started from a fresh clone of the repo. I must have done something wrong launching the examples.

encountered a few other issues running on Android. Had to ensure that MainApplication.java did not have any duplicate packages, ie. new RNWebGLPackage()

I also added react as a dependancy in package.json at the root,

"dependencies": { "prop-types": "^15.5.8", "react": "^16.0.0-alpha.12" },

and called npm install at this level. Hope that helps someone else.

dchersey commented 6 years ago

I also have this error ... I solved it by

  1. removing the
    pod 'react-native-webgl', path: '../node_modules/react-native-webgl'

    reference from Podfile

  2. manually adding ../node_modules/react-native-webgl/ios/RNWebGL.xcodeproj to my Libraries folder in Xcode
  3. ensuring that RNWebGL.a is present in my Link Binary with Libraries list under Build Phasesin my project settings (as instructed by the README).

The issue appears to be caused by a deprecated reference to React in the podspec, resulting in 2 instances of the library being present in the build.