rnc-archive / react-native-webgl

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

iOS: Archiving fails #46

Closed skizzo closed 4 years ago

skizzo commented 6 years ago

So my app using this awesome package runs fine in debug mode, in simulator and on a device.

Soon as I wanna create an archive in XCode, I get this error:

screen shot 2018-03-16 at 10 30 45

Showing All Issues While trying to resolve module react-native-webgl from file /Volumes/HDD2/GitHub/iazzu/app/src/view/components/gl/CGLTest/CGLTest_app.js, the package /Volumes/HDD2/GitHub/iazzu/app/node_modules/react-native-webgl/package.json was successfully found. However, this package itself specifies a main module field that could not be resolved (/Volumes/HDD2/GitHub/iazzu/app/node_modules/react-native-webgl/lib/index.js. Indeed, none of these files exist: /Volumes/HDD2/GitHub/iazzu/app/node_modules/react-native-webgl/lib/index.js(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json) (....)

Which kinda makes sense, since the file lib/index.js doesn't exist, it's in the src/ folder. Soon as I changed the react-native-webgl's package.json file, archiving worked:

- "main": "lib/index.js",
+ "main": "src/index.js"

Just in case anybody wants to use this in an actual production project and runs into this issue too :) Kudos for this awesome package btw.

gre commented 6 years ago

mmh , react-native-webgl/lib/index.js is supposed to exist, it's published on NPM 🤔

https://unpkg.com/react-native-webgl@0.8.0/lib/

skizzo commented 6 years ago

Yeah, some weird things going on in my installation. I also had to remove/comment out the line

  # pod "react-native-webgl", :path => "../node_modules/react-native-webgl"

in my Podfile after running the react-native link react-native-webgl command, and add this script to the Podfile, otherwise archiving fails as well:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == "React"
      target.remove_from_project
    end
  end
end

Super hacky, but it does the job for now.