Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter apk installed but but cannot be found/opened

I have been spending some weeks to try out to figure out this problem but I cannot manage to get it to work.

Context:

Flutter run

  • I can perform "flutter run" and it will launch the app on my phone.
  • After closing the app, I cannot see it in the apps page. I cannot search for it.
  • The only way way to "reach" the app is to go to settings -> apps. Here I cannot open the app, the only option is to uninstall it.

Flutter build

  • I can build an app. "flutter build apk" works fine.
  • If a previous app version of the app is installed, It fails to install the apk.
  • If I uninstall the previous app from settings -> apps, I can install the new apk. But I cannot open it. It only says "Done" and "Open" is grayed out.

What I have tried:

  • Uninstall app from settings -> app
  • flutter clean
  • Removed signing from build.gradle
  • Change singing release to debug
  • flutter build apk -split-per-api
  • This guide https://flutteragency.com/how-to-fix-release-apk-is-not-working-properly/
  • Uninstalling "for all users"
  • Running "adb shell am start com.example/.mainActivity" -> Works
  • "adb shell pm list packages" shows my packet id

Additional information I don't know if it matters, but I recently added signing config and released an appbundle to the App Store. Might there be issues with conflicting appbundle and apk file?

My "flutter doctor -v"

[✓] Flutter (Channel stable, 2.10.4, on macOS 12.1 21C52 darwin-arm, locale sv-SE)
    • Flutter version 2.10.4 at /Users/*/dev/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision c860cba910 (4 weeks ago), 2022-03-25 00:23:12 -0500
    • Engine revision 57d3bac3dd
    • Dart version 2.16.2
    • DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    • Android SDK at /Users/*/Library/Android/sdk/
    • Platform android-32, build-tools 32.1.0-rc1
    • ANDROID_HOME = /Users/*/Android/Sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)

[✓] VS Code (version 1.64.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.38.1

[✓] Connected device (1 available)
    • Chrome (web) • chrome • web-javascript • Google Chrome 100.0.4896.122

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

´´´

like image 373
K B Avatar asked Jun 05 '26 14:06

K B


1 Answers

I solved it

Problem was my intents.

How they were:

<intent-filter>
    <action android:name="android.intent.action.MAIN"/>
    <category android:name="android.intent.category.LAUNCHER"/>
    <action android:name="android.intent.action.VIEW" />          
    <category android:name="android.intent.category.DEFAULT" />        
    <category android:name="android.intent.category.BROWSABLE" /> 
</intent-filter>

How they should be:

<intent-filter>
    <action android:name="android.intent.action.MAIN"/>
    <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
    <action android:name="android.intent.action.VIEW" />            
    <category android:name="android.intent.category.DEFAULT" />        
    <category android:name="android.intent.category.BROWSABLE" /> 
</intent-filter>
like image 155
K B Avatar answered Jun 08 '26 04:06

K B