flutterdartandroid-activitylaunchtel

flutter Unhandled Exception: PlatformException(ACTIVITY_NOT_FOUND, No Activity found to handle intent


In my flutter app, I use a GestureDetector with await to make the following call:

launchUrl(Uri.parse(url));

While the url is tel:00

I put this in the AndroidManifest.xml

 <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
                <action android:name="android.intent.action.VIEW" />
                <action android:name="com.dsociety.activities.MyBrowser" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <intent-filter>
                <action android:name="com.scytec.datamobile.vd.gui.android.AppPreferenceActivity" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>

I have this error in the log

 Unhandled Exception: PlatformException(ACTIVITY_NOT_FOUND, No Activity found to handle intent { tell:00 }, null, null)

Solution

  • Try to add this to your AndroidManifest.xml:

    <manifest ...>
        <queries>
          <intent>
            <action android:name="android.intent.action.VIEW" />
            <data android:scheme="tel" />
          </intent>
        </queries>
    ...
    

    Read carefully the documentation at https://pub.dev/packages/url_launcher

    UPDATE:

    The problem is a typo in your link (tell instead of tel)