EAS Cheatsheet

Stage Release für Plattformen

eas build --profile stage --platform ios
eas build --profile stage --platform android

Production Release für Plattformen bauen

eas build --profile production --platform ios
eas build --profile production --platform android

Production Release für Plattformen veröffentlichen

eas submit --platform ios
eas submit --platform android

Over the air Update für alle Apps in Release-Channel „staging“

expo publish --release-channel staging

Ein neues Update mit einem neuen Branch erstellen

eas update --branch Campaignadvertisement --message "Kampagnenwerbung integriert"Code-Sprache: JavaScript (javascript)

Einem Channel einen Branch zuweisen

channel:edit production –branch version-2.0

Dokumentation

Mehrere Node Versionen mit NVM

If you’re like me, and switch a lot between different projects, you’ve most likely run across problems with Node.js versions when building the frontend.
That’s a problem we can solve rather easily with NVM.

But first things first, what is NVM?
NVM (Node Version Manager) is a tool for installing and managing different Node versions. All you need to do is install NVM and the versions of Node you need.

How to install and use NVM on Windows

Download the latest version of NVM (nvm-setup.zip) from Github.
Now, extract and install using the .exe file. It’s easy!

For installing on Linux and MacOS I would refer to the readme found on GitHub.

Now that we have NVM installed we can start using it in our terminal of choice.

The commands I use the most:

nvm list
Lists the installed versions of node. The selected version is shown with ‚*‘

nvm list available
Shows a list of available Node versions to download

nvm install <version>
This command lets you install different Node versions. To download the latest version just use: nvm install latest.

nvm use <version>
Specify what version of Node to use.

And if you want to see a list of all the commands available just enter NVM in cmd to list them all:

Now if you’re a .net developer like me and use Visual Studio daily, there can sometimes be an issue with Visual Studio not using the Node version specified by NVM.
The fix I found that works for me:
In Visual Studio, go to Tools -> Options -> search for ‚external web tools‘ in the searchbar.

As shown in the image add the path to the folder where Node.js is installed to the top of the list. Usually this is C:\Program Files\nodejs
Most likely it will work now.

Nützliche Kommandos für NVM:

// check version

node -v || node --version 

// list locally installed versions of node

nvm ls 

// list remove available versions of node

nvm ls-remote 

// install specific version of node

nvm install 18.16.1 Code-Sprache: CSS (css)

// set default version of node

nvm alias default 18.16.1 Code-Sprache: CSS (css)

// switch version of node

nvm use 20.5.1 Code-Sprache: CSS (css)

// install latest LTS version of node (Long Term Support)

nvm install --lts 

// install latest stable version of

node nvm install stable

PHP 8 Codeanpassungen

Return type of ... should either be compatible with ...Code-Sprache: JavaScript (javascript)

Entweder, wenn der Returntype variiert über die Methode die Annotation
#[\ReturnTypeWillChange] einfügen oder die Signatur, speziell meistens den Rückgabewert anpassen.

Deprecated: Creation of dynamic property DefaultBehaviour::$nonExistingProp is deprecatedCode-Sprache: PHP (php)

Ab PHP 8.2 sind dynamische Klasseneigenschaften deprecated und Klassen damit versiegelt. Sollte das dennoch benötigt werden, muss über der Klasse die Annotation #[AllowDynamicProperties] angegeben werden.

Function utf8_encode() is deprecatedCode-Sprache: PHP (php)

Diese Funktion ist zu ersetzen durch
mb_convert_encoding($string, 'UTF-8', 'ISO-8859-1');

Function utf8_decode() is deprecatedCode-Sprache: PHP (php)

Diese Funktion ist zu ersetzen durch
mb_convert_encoding($string, 'ISO-8859-1', 'UTF-8');

Github + SSH Key Authentifizierung

SSH keypair setup for GitHub (or GitHub/GitLab/BitBucket, etc, etc)

Create a repo.

Make sure there is at least one file in it (even just the README.md)

Generate a SSH key pair (private/public):

ssh-keygen -t rsa -C "your_email@example.com"
Code-Sprache: JavaScript (javascript)

or even better:

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
Code-Sprache: JavaScript (javascript)

It also possible to use ed25519. There are pros and cons, but personally I’ve had some issues and that is the reason I’ve chosen to stick to 4096 rsa for now.

Copy the contents of the public SSH key

macOS:

pbcopy &lt; ~/.ssh/id_rsa.pub
Code-Sprache: HTML, XML (xml)

GNU/Linux (requires the xclip package):

xclip -sel clip &lt; ~/.ssh/id_rsa.pub
Code-Sprache: HTML, XML (xml)

Windows Command Line:

type %userprofile%\.ssh\id_rsa.pub | clip

Git Bash on Windows / Windows PowerShell:

cat ~/.ssh/id_rsa.pub | clip
Code-Sprache: JavaScript (javascript)

or ofcourse copy it via your favorite editor, cat, or whatever suits your needs 🙂

Copy the public SSH key to GitHub

Copy the contents of the to your SSH keys to your GitHub account settings (https://github.com/settings/keys).

Test the SSH key:

ssh -T git@github.com
Code-Sprache: CSS (css)

Change directory into the local clone of your repository (if you’re not already there) and run:

git remote set-url origin git@github.com:username/your-repository.git
Code-Sprache: JavaScript (javascript)

Now try editing a file (try the README) and then do:

git add -A
git commit -am &quot;Update README.md&quot;
git push
Code-Sprache: HTML, XML (xml)

Add the key to the ssh-agent

ssh-add ~/.ssh/id_rsa
Code-Sprache: JavaScript (javascript)

You should not be asked for a username or password. If it works, your SSH key is correctly configured.

Fehler in react-native-gesture-handler

NUR beim Ausführen der nativen App kommt es zu dem Fehler. Während der Entwicklung fällt der Fehler nicht auf.

Nachvollziehen kann man den Fehler, bevor man einen Releasbuild in der Expo-Cloud macht, auch schon durch einen lokalen Build. So spart man sich Zeit und vorallem Buildkontingent im Free-Plan von Expo.

Dafür macht man den Prebuild, startet das Projekt (.workspace-Datei !) in XCode und führt es am besten im Simulator aus. Dabei kommt es zu folgendem Fehler:

ERROR TypeError: Cannot read property 'dropGestureHandler' of nullCode-Sprache: JavaScript (javascript)

Der Stack in dem Fall dazu war:

This error is located at:
in PanGestureHandler (created by PanGestureHandler)
in PanGestureHandler (created by Card)
in RCTView (created by View)
in View
in Unknown (created by Card)
in RCTView (created by View)
in View (created by Card)
in Card (created by CardContainer)
in CardContainer (created by CardStack)
in RNSScreen
in Unknown (created by InnerScreen)
in Suspender (created by Freeze)
in Suspense (created by Freeze)
in Freeze (created by DelayedFreeze)
in DelayedFreeze (created by InnerScreen)
in InnerScreen (created by Screen)
in Screen (created by MaybeScreen)
in MaybeScreen (created by CardStack)
in RNSScreenContainer (created by ScreenContainer)
in ScreenContainer (created by MaybeScreenContainer)
in MaybeScreenContainer (created by CardStack)
in RCTView (created by View)
in View (created by Background)
in Background (created by CardStack)
in CardStack (created by HeaderShownContext)
in RNCSafeAreaProvider (created by SafeAreaProvider)
in SafeAreaProvider (created by SafeAreaInsetsContext)
in SafeAreaProviderCompat (created by StackView)
in RCTView (created by View)
in View (created by GestureHandlerRootView)
in GestureHandlerRootView (created by StackView)
in StackView (created by StackNavigator)
in PreventRemoveProvider (created by NavigationContent)
in NavigationContent
in Unknown (created by StackNavigator)
in StackNavigator (created by AppNavigator)
in EnsureSingleNavigator
in BaseNavigationContainer
in ThemeProvider
in NavigationContainerInner (created by AppNavigator)
in RCTView (created by View)
in View (created by AppNavigator)
in AppNavigator (created by Connect(AppNavigator))
in Connect(AppNavigator) (created by App)
in Provider (created by App)
in App (created by withDevTools(App))
in withDevTools(App)
in RCTView (created by View)
in View (created by AppContainer)
in RCTView (created by View)
in View (created by AppContainer)
in AppContainer
in main(RootComponent), js engine: hermes

Das Problem ist, dass die Expo-Mitinstallierte Version des Packages sich offensichtlich von der offiziellen Version unterscheidet. In dem Fall ist die Bibliothek React Navigation auch von dem Package abhängig und kommt mit der Expo-Version nicht klar.

LÖSUNG:

Unter node_modules den Ordner react-native-gesture-handler löschen und mit bspw. Yarn als Dependency hinzufügen:

yarn add react-native-gesture-handler

Expo – Tooling für lokal Build

Fastlane installieren

sudo gem install fastlane -NV

Fastlane in PATH für die jeweilige Shell aufnehmen

export PATH="/usr/local/bin/fastlane:$PATH"Code-Sprache: JavaScript (javascript)

iOS Plattform für XCode Kommandozeile installieren

xcodebuild -downloadPlatform iOS

Bauen der App über EAS

eas build --local --platform ios

Um einen Prebuild der App zu bauen (XCode Projekt) folgendes ausführen

npx expo prebuild --platform ios --clean

Expo – Debuggen von Releasebuilds

Das Problem mit der Fehlernachvollziehbarkeit bei Releasebuild ist, die Logs dazu auszulesen.
Dafür kann man aber unter iOS:

  • Das Device an den Mac anschließen
  • Die App Konsole öffnen
  • Das Device auswählen
  • Über die Suche den Namen der App für Prozesse eingeben
  • Die App starten und die Logs einsehen

Für Android

  • Das Device an den PC anschließen
  • Android Studio öffnen
  • Die App starten
  • Nach dem Namen der App filtern
  • Über LogCat die Logs auslesen

Expo Artikel dazu.