You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unhandled Exception: PlatformException(UNABLE_TO_START_ACTIVITY, No Activity found to handle Intent
{ act=androidx.activity.result.contract.action.REQUEST_PERMISSIONS (has extras) },
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=androidx.activity.result.contract.action.REQUEST_PERMISSIONS (has extras) }
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2239)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1878)
at android.app.Activity.startActivityForResult(Activity.java:5589)
at android.app.Activity.startActivityForResult(Activity.java:5547)
at dev.duynp.flutter_health_connect.FlutterHealthConnectPlugin.onMethodCall(FlutterHealthConnectPlugin.kt:127)
at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:258)
...
My AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<queries>
<package android:name="com.google.android.apps.healthdata" />
</queries>
<uses-permission android:name="android.permission.health.READ_BLOOD_GLUCOSE"/>
<uses-permission android:name="android.permission.health.WRITE_BLOOD_GLUCOSE"/>
<application
android:label="my_app"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="androidx.health.ACTION_SHOW_PERMISSIONS_RATIONALE" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
The Health Connect app is installed on the emulator. Any idea what I am missing?
The text was updated successfully, but these errors were encountered:
hartmannj
changed the title
PlatformException UNABLE_TO_START_ACTIVITY when asking for permission
PlatformException UNABLE_TO_START_ACTIVITY when asking for permission in debug
Sep 2, 2023
It seems to work with emulators using Android SDK 33 Google Play.
This could potentially mean that it will crash on all devices with Android 14, or it is a bug in the SDK 34 Google Play emulator image.
In Android 13, you declare permissions using a custom permissions format, in a resource file that is linked to the manifest:
To support Android 14, developers need to move to the standard permissions format:
OS: Android 14
Device: Emulator (Pixel 7 Pro, Android SDK 34 Google Play)
When trying to request for permissions like following:
the app crashes with exception:
My AndroidManifest.xml:
The Health Connect app is installed on the emulator. Any idea what I am missing?
The text was updated successfully, but these errors were encountered: