The latest versions of ExponentJS do not require us to install react-native from Exponent Repo. Looks like exponent just works with pre-existing React Native repo.
Can we update the extension to do that ?
cc @dikaiosune and @brentvatne for comments on this
@axemclion, just looked at this and it seems that CRNA-made projects works just fine with exp which probably means that we could get rid of this step for apps that were created using CRNA. I think we can detect this by looking for app.json w/ expo section at the root of the project.
The only thing that confuses me in this case is that exp prints a warning about version of react native
Warning: Not using the Expo fork of react-native. See https://docs.expo.io/.
and I'm not sure yet how much this warning is severe.
However, it seems that latest Expo (in particular I was using exp) is still requires (maybe this is not a strong requirement though) its own version of react-native:
"dependencies": {
"@expo/ex-navigation": "~2.9.2",
"@expo/samples": "~1.0.3",
"expo": "^15.0.2",
"react": "~15.4.0",
"react-native": "https://github.com/exponent/react-native/archive/sdk-15.0.0.tar.gz"
},
@vladimir-kotikov I think the best way to understand this would be to get on the Expo slack adn talk to @dikaiosune
Hey! We can definitely chat on slack, but the basic rundown is:
Expo has a fork of RN where we sometimes land fixes to JS before they're available in a stable release. We maintain compatibility with the npm version of React Native for CRNA, but when you're running in exp or XDE, we warn you since you may not have all of the appropriate bugfixes. That said, as long as the sdkVersion flag is set to a compatible ABI for your RN install, things should just work.
AFAIK the only case where we require use of our fork is for apps using ExpoKit, because we bundle some native code in the npm package which our tools expect to configure as part of the Xcode/Android Studio builds.
@dikaiosune Cool! Thanks for clarification! Hope you wouldn't mind if I bother you in Slack if I have additional questions.
@panarasi, given what Adam says that should be pretty easy to get rid of that step - I'm going to prototype and test "debugging in Expo" scenario more thoroughly w/ both Expo and CRNA apps to see whether it's safe. Also I think there is currently some issues that actually break debugging scenario for CRNA apps but that's another issue - I'll investigate and file a separate ticket.
It appears expo support is broken if you are using a current version for your app. When I try to run the debugger, I get warnings about invalid exp.json keys that are currently supported (like privacy and icon). I also get Warning: Installed version 0.40.0 of 'react-native' does not satify required version git+https://github.com/exponentjs/react-native#sdk-13.0.0\n\n
The debugger output ends with "Error starting tunnel: Error: {\"status_code\":400,\"msg\":\"failed to deserialize request parameter\",\"details\":{\"err\":{\"Type\":{}}}}"
{"status_code":400,"msg":"failed to deserialize request parameter","details":{"err":{"Type":{}}}} and the debug console output is
[vscode-react-native] Starting Exponent Packager.
[Error] "Could not debug. An error ocurred while handling message: START_EXPONENT_PACKAGER"
I can submit a new issue if you think this is a separate bug, but I'm assuming this might be resolved with the updates planned.
cc @vladimir-kotikov
Yeah, we have alredy tagged version 0.3.2 to be released that should fix all known problems w/ Expo support.
@axemclion, could you please help w/ publishing it?
@vladimir-kotikov Just published the new version. Can you create a GitHub milestone and mark the issues as fixed ?
@panarasi, sure. Here it is: https://github.com/Microsoft/vscode-react-native/milestone/8?closed=1 and here is the release page: https://github.com/Microsoft/vscode-react-native/releases/tag/0.3.2
@panarasi, @axemclion I think we still need to keep it open, because the initial issue (redundant react-native reinstallation) hasn't been resolved yet
@vladimir-kotikov using version 0.3.2 with expo xde, there is no file called launchReactNative.js in .vscode.
expo package.json
"@expo/ex-navigation": "~2.9.2",
"@expo/samples": "~1.0.3",
"expo": "^15.0.2",
"react": "~15.4.0",
"react-native": "https://github.com/exponent/react-native/archive/sdk-15.0.0.tar.gz"
same outcome using create-react-native cmd line.
@kkganesan Debugging should work without it as I read in different thread. The only problem is re-downloading expo`s version of react native which takes much time.
Hi guys. I'm really struggling to get debugging working with an existing Expo app.
I'll start with the question I realize I need to ask more often...
Should I expect this to work if I'm running Windows 10?
@GollyJer This should work with Windows 10. @vladimir-kotikov Could you please help?
Thanks @panarasi and @vladimir-kotikov.
Any help is greatly appreciated.
:\Users\Gautam Faldessai\Desktop\Brushflicks1\mstore.3.1\mstore-pro>react-native run-android
Scanning 563 folders for symlinks in C:\Users\Gautam Faldessai\Desktop\Brushflicks1\mstore.3.1\mstore-pro\node_modules (36ms)
JS server already running.
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
Unzipping C:\Users\Gautam Faldessai.gradle\wrapper\dists\gradle-2.14.1-all\8bnwg5hd3w55iofp58khbp6yv\gradle-2.14.1-all.zip to C:\Users\Gautam Faldessai.gradle\wrapper\dists\gradle-2.14.1-all\8bnwg5hd3w55iofp58khbp6yv
Exception in thread "main" java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.
at java.util.zip.ZipFile.
at java.util.zip.ZipFile.
at org.gradle.wrapper.Install.unzip(Install.java:159)
at org.gradle.wrapper.Install.access$500(Install.java:26)
at org.gradle.wrapper.Install$1.call(Install.java:69)
at org.gradle.wrapper.Install$1.call(Install.java:46)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:46)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:126)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
already plugged in a physical device..still the error persist. adb device shows the list of devices attached
Redownloading Expo's react-native dependency has been fixed in 0.4.0, so closing this.
@gauti1996, please open a new issue if you're still experiencing problems w/ deploying on device - we'll try to help.
@GollyJer, sorry for late response - debugging should work on Windows 10, but there were some minor general issues that might break debugging scenarios. Please try out new version of extension and if there are still any issues with debugging - please file a new ticket
Most helpful comment
Hi guys. I'm really struggling to get debugging working with an existing Expo app.
I'll start with the question I realize I need to ask more often...
Should I expect this to work if I'm running Windows 10?