usafutb0l3r
usafutb0l3r

Reputation: 69

Unable to launch app in Android emulator: Stuck on 'Flutter: Launching...' and 'Waiting for observatory port to be available...'

I'm dealing with a very frustrating problem where I am unable to launch my app with my Android emulator. I am using VS Code and Android Studio for the emulator. It keeps getting hung up.

When I try to launch from VS Code (Run > Start Debugging), it hangs on Flutter: Launching... enter image description here

When I try to launch from Powershell (flutter run --verbose), it hangs on Waiting for observatory port to be available...

[ +228 ms] Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x20000000 cmp=com.ceventures.app.locationalerts.cedric.eicher/.MainActivity (has extras) }
[   +4 ms] Waiting for observatory port to be available...

Initially, going down some rabbit holes online led me to think my package/app id might be wrong. Here are what they are in all locations:

android/app/src/main/AndroidManifest.xml:

package="com.ceventures.app.locationalerts.cedric.eicher">

android/app/src/profile/AndroidManifest.xml:

package="com.ceventures.app.locationalerts.cedric.eicher">

android/app/src/debug/AndroidManifest.xml:

package="com.ceventures.app.locationalerts.cedric.eicher">

android/app/build.gradle:

defaultConfig { applicationId "com.ceventures.app.locationalerts.cedric.eicher" minSdkVersion 21 targetSdkVersion 30 versionCode flutterVersionCode.toInteger() versionName flutterVersionName multiDexEnabled true }

android/app/google-services.json:

"package_name": "com.ceventures.app.locationalerts.cedric.eicher"

android/app/src/main/kotlin/com/example/locationalertsapp/MainActivity.kt:

package com.ceventures.app.locationalerts.cedric.eicher

Things I have tried:

Any help is appreciated, this is driving me crazy! It just worked a few days ago!

Upvotes: 0

Views: 4595

Answers (2)

dvaupel
dvaupel

Reputation: 1

When I had the same problem this worked for me:

  1. Close the stuck emulator.
  2. Open Android Studio, go to Virtual Device Manager. Select the device and under the options (three dots icon), select "Wipe Data".
  3. Do a cold boot.

Tested with Ubuntu 22.04.

Upvotes: 0

usafutb0l3r
usafutb0l3r

Reputation: 69

SOLVED -- NOTE I AM OP

So after a week of dealing with this, the following led me to getting things to finally work:

  1. Doing a windows update

  2. Switching to the flutter stable branch, and then doing flutter upgrade

  3. Doing a cold boot of my emulator device

  4. Resolving pubspec package issues and the environment: and sdk: versions worked for all the packages (if they don't, you'll be alerted)

  5. Updating the following to the original com.example.locationalertsapp

    android/app/src/main/AndroidManifest.xml android/app/src/profile/AndroidManifest.xml android/app/src/debug/AndroidManifest.xml

I really don't know why this all worked. I had to step away from this issue for a few days just because I couldn't handle it anymore and I felt like I was down rabbit hole after rabbit hole.

Hopefully this helps someone in the future!

Upvotes: 0

Related Questions