Expo cannot open development build on android emulator

Viewed 105

I'm trying to run my Expo managed project on Android simulator with npx expo run:android.

I have expo-dev-client installed.

When I run npx expo run:android, it fails with the message:

CommandError: Couldn't open Android app with activity "com.my.app.name://expo-development-client/?url=http%3A%2F%2F192.168.0.13%3A8081" on device "Pixel_4".
The app might not be installed, try installing it with: npx expo run:android -d Pixel_4

I ran npx expo run:android -d Pixel_4 as suggested in the above error message only to get the exact same error message as above.

On the emulator, I was able to confirm that the development build is installed.

However, the Expo CLI apparently cannot open the app.

Could someone guide me to the right direction to solve this issue?

1 Answers

The instructions on expo tells us that we have to use npx expo start and expo handles a (when server is running) installation into the device, even it's a plugged-in or emulator. When you run npx expo run:android your expo get's conflict with the built-in. The expo-dev-client is basically just necessary when you really need a built-in app installed for others development proposes. so:

Delete the installed app when you ran the build command and just run npx expo start and choose one of the prompt options (also tells you what each command do), like "a" for android, "i" for IOS ready qr code, etc.. and expo will handle it

references:

https://docs.expo.dev/get-started/create-a-new-app/ https://docs.expo.dev/development/getting-started/

Related