Closed martin-braun closed 2 years ago
Hi @martin-braun,
Could you please clarify what's the issue? Put in other words, what credentials EAS CLI is exactly expecting you to pass?
eas build:configure
in CI, generally, this should be executed only once for the lifetime of an application.Hi @dsokal. My goal is to be able to not use the CI of Expo altogether and just benefit from the build tools. I learned about prebuilding my projects, but trying to run my project directly from Android Studio as debug APK on my physical device gives me "Unable to load script. Make sure you're either running Metro or your bundle is packaged correctly for release".
Trying to run my project with expo run:android
will result in "CommandError: Couldn't open Android app with activity "my-app://expo-development-client/?url=http%3A%2F%2F192.168.67.245%3A8081" on device "Pixel_3a".
The app might not be installed, try installing it with: npx expo run:android -d Pixel_3a"
I tried the command above to solve it, same result.
Using eas build --platform android --local
will still ask me for expo.dev credentials. If I give them it will create a project on your server and link the project ID.
Look, I understand that Expo is very slick and customer-friendly with your CI tightly integrated, but a service can never remain forever. It also feels weird that I cannot opt-out of the server dependency at any time. I know that I can ditch Expo and use RN directly, but I was hoping that I can build an app with the slick Expo tool chain with peace in mind, that I can always fall back to do truly local builds without any remote dependency.
If this means that I have to eject from Expo, it defeats the purpose and I rather move to RN directly which will give me more opportunities like building for Windows and macOS.
Your concerns sound reasonable. We'll try to address them soon.
@dsokal Thanks a lot. Good news though. I checked the documentations of ReactNative regarding my error above. When I run npx react-native start
before debugging the APK in Android Studio, the build will work and even watch my JavaScript files for any changes. So I think I solved my issue/concern already and I want to share how local building works without the expo.dev CI being involved.
I can just run npx expo prebuild && npx react-native run-android
or npx expo prebuild && npx react-native run-ios
to debug without Expo Go. I can then use npx react-native bundle ...
to bundle the JavaScript properly for release builds. It get's the job done.
So luckily I know that I can peacefully use Expo and its CI and have always the option to fall back to local building, as long as I keep the signing local as you mentioned.
Will my configuration be compatible with expo plugins when I decide to build locally? I.e. will expo prebuild
add everything that I need to bypass Expo CI in all circumstances?
I don't know if I fully understand your message but for what it's worth, you need to use react-native start
because simulator/emulator builds don't bundle your JS code.
As for the other question - I think expo-cli / react-native cli should be pretty much compatible with each other.
Hi @dsokal
Is there any way to run eas build --platform android --local
without expo credentials
EAS CI is great service but we don't have public network access due to company's policy
Proceeding with outdated version.
[Network] request to https://api.expo.dev/graphql failed, reason: read ECONNRESET
Error: GraphQL request failed.
I would like to know that too. Thanks!
@trevorwang To be able to build the project in Android without EAS, I used these commands:
# To generate all the Android and IOS files
npx expo prebuild
# Make sure to connect your device or to run your Emulator
npx react-native run-android --mode="release"
# If you want to sign the APK and publish to Google Play Store.
npx react-native build-android --mode=release
Remember to follow up the React Native Documentation to sign the APK and publish to Google Play Store.
@Youngermaster Many thanks. Will try later.
@trevorwang You are welcome, I hope that fix your issue, It worked for my First App in React Native with Expo, I'll deploy tomorrow if everything goes right (If Google Play accepts my App).
Hi! I managed to create andorid standalone release apk by launching "npx expo prebuild && cd ../andorid && ./gradlew assembleRelease" But is there any way to create ios simulator build (archive) without eas and without paid Apple Developer Account?
npx expo prebuild && npx react-native run-android
Throws me the error below. I am trying to build a debug standalone expo app
[Unable to load script.Make sure you are either running a Metro server or that your bundle 'index.android.bundle' is packaged correctly for release](https://stackoverflow.com/questions/55441230/unable-to-load-script-make-sure-you-are-either-running-a-metro-server-or-that-yo)
@trevorwang To be able to build the project in Android without EAS, I used these commands:
# To generate all the Android and IOS files npx expo prebuild # Make sure to connect your device or to run your Emulator npx react-native run-android --mode="release" # If you want to sign the APK and publish to Google Play Store. npx react-native build-android --mode=release
Remember to follow up the React Native Documentation to sign the APK and publish to Google Play Store.
For anyone trying to just build an APK you can do the prebuild command and after:
cd android && ./gradlew assembleRelease
Hi! Sorry to dig up an old thread. I just want to confirm — is there no way to run a build locally via eas, for example:
eas build --local --profile development-detox --platform ios
Without having to login?
@trevorwang
Hi! Sorry to dig up an old thread. I just want to confirm — is there no way to run a build locally via eas, for example:
eas build --local --profile development-detox --platform ios
Without having to login?
EAS seems need login every time. There is a workaround for me to build for ios device locally,
expo prebuild
+ expo run:ios --configuration Release --device [your device/simulator Identifier]
For android, you can use expo prebuild -p android
to generate android project structure.
Then use npx react-native build-android --interative
to build the app. --interative
flag will scan the gradle tasks and you can choose .aab or .apk as output file.
Use expo
to build the final app is optional choose, you can build the app use gradlew
、react-native
command or expo
command.
Upper level command call bottom level command. expo
and react-native
are upper level command, they all need to call gradlew
to build the app.
What are you guys doing in your CI for the build step?
Expo comes with the default
"build": "expo export --output-dir ./build --platform all",
Does it make sense to swap this to expo prebuild
? That way I truly build the intended output?
What purpose does the export serve if I'm not using expo to serve up web?
Edit: expo build seems to run the prebuild anyways.
@Youngermaster
Your solution works
# To generate all the Android and IOS files
npx expo prebuild
# Make sure to connect your device or to run your Emulator
npx react-native run-android --mode="release"
# If you want to sign the APK and publish to Google Play Store.
npx react-native build-android --mode=release
But when I tried to run npx react-native start , it didn't work The error occured is error: Error: Unable to resolve module @/store/store on line import { store } from "@/store/store"; If I change the code to import { store } from "../store/store"; It works. But I need @ to work on all of my import, Do you have any suggestion for this
Thank you in advance
Summary
I assume this should be a mistake. When running local builds on my own infrastructure, there is no need to ask for authentication. This is very important, because it ensures that EAS can even function in a local environment when the Expo service is not available.
Environment
Reproducible demo or steps to reproduce from a blank project