ANDROID - build app bare flow

Hi Guys, sorry but i need your help…
i used:

expo 37.0.3
react-native: ~0.61.5

my project: expo init with minimal bare

i make:
expo eject
expo publish

and in android studio buld apk

but when i try to luch the apk i have a error:
unabled to load script. make sure you running a metro server…

any idea?

when i make a expo publish in windows 10 i have this error:

Impossibile trovare il percorso specificato.
› Closing Expo server
› Stopping Metro bundler
spawn /bin/cp ENOENT
Set EXPO_DEBUG=true in your env to view the stack trace.

Any suggestion ?

I’ve found that this is due to adb not being available in your system. If this is the case, when running in your terminal adb devices you will get: -bash: adb: command not found
You need to add two environment variables for it to work. In your terminal run these:
export ANDROID_SDK=/Users/[your_user]/Library/Android/sdk
export PATH=/Users/[your_user]/Library/Android/sdk/platform-tools:$PATH
remember to set the proper path for you, by replacing [your_user].
You can either add them temporarily or permanent. Check this link for more information about that.
Once you have those variables added, try running in your terminal: adb devices, you should see your connected device or devices listed there.
Finally go to your expo’s project root directory and run: npm run android this will spin up a new metro server and install your development app into your connected device, pointing to this metro server.
After this, and the app has been installed in your device, then you can star using Android Studio to rebuild the app.

hi, now work but i need to create a signed apk…

the last question is await Notifications.getDevicePushTokenAsync();

i have this message:
Possible Unhandled Promise Rejection (id: 20):
TypeError: null is not an object (evaluating ‘_ExponentNotifications.default.getDevicePushTokenAsync’)

there is any reason?

many thansk

any suggestion about that? is normal?


Probably you already figured it out, but to create a signed apk or an android app bundle (aab) you need to do that through Android Studio: Build > Generate Signed Bundle / APK… from the menu.
Now about the promise rejection, how are you importing the notifications library?