xcode needed on windows?

I’m following the guide here: Using ClojureScript - Expo Documentation

And when I would start it with “expo start --ios”, it says I need xcode:


Starting Metro Bundler
√ Xcode needs to be installed (don’t worry, you won’t have to use it), would you like to continue to the App Store?

But that is just for macs if I understand corretly.

What now? :slight_smile:

Thanks!

Hi

Unfortunately those instructions generate an Expo SDK 34 project, which is no longer supported as of June 2020.

To answer your question, expo start --ios starts an iOS Simulator, which comes as part of Xcode, so you can’t use that on Windows/Linux. But (as long as you’re using a supported Expo SDK version) you should be able to just run expo start and then open the Expo Go app on an iOS/Android device and connect to your dev server from there, or scan the QR code with the iOS camera app, which should open Expo Go for you.

I’m not sure how much effort it would be to upgrade the lein template to generate an Expo SDK 44 (current latest) project. It might be better for you to look into using shadow-cljs or krell. Krell requires react-native-tcp-socket and needs a custom krell_index.js. I got it to work once, but the last time I tried I had trouble. So maybe give shadow-cljs a try.

Thank you!

Leiningen + figwheel

FWIW I got the instructions to work with a few tweaks:

After creating the project, but before running figwheel/expo start, run:

expo upgrade

to upgrade to Expo SDK 44.

Then apply the following patch:

diff --git .gitignore .gitignore
index ba841d4..0c9252f 100644
--- .gitignore
+++ .gitignore
@@ -15,5 +15,6 @@ pom.xml.asc
 figwheel_server.log
 main.js
 .js-modules.edn
-/env/dev/env/expo/dev.cljs
-/env/dev/env/expo/index.cljs
+/env/dev/env/dev.cljs
+/env/dev/env/index.cljs
+/.lan-ip
diff --git js/figwheel-bridge.js js/figwheel-bridge.js
index 1148f63..fadcb19 100644
--- js/figwheel-bridge.js
+++ js/figwheel-bridge.js
@@ -6,17 +6,17 @@

 var debugEnabled = false;

+var { packagerPort } = require("../.expo/packager-info.json");
 var config = {
     basePath: "target/",
     googBasePath: 'goog/',
-    serverPort: 19001
+    serverPort: packagerPort
 };

 var React = require('react');
 var createReactClass = require('create-react-class');
 var ReactNative = require('react-native');
 var Expo = require('expo');
-var WebSocket = require('WebSocket');
 var self;
 var evaluate = eval; // This is needed, direct calls to eval does not work (RN packager???)
 var externalModules = {};

It was detecting my LAN IP as 127.0.0.1, so I added my actual LAN IP address to a file called .lan-ip

At that point you can run:

lein figwheel

and then in another terminal:

expo start

Then you can start Expo Go on the device and connect to the dev server in the normal way.

Something uses componentWillMount which causes ugly warnings, but otherwise it works.

Shadow CLJS

There is a link in Shadow CLJS’ documentation to a reagent-expo example repository. This has recently been updated to work with Expo SDK 44 and EAS Build.

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