I am trying to follow this installations to flutter_health_connect but I keep gettings the followint error
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
> Android resource linking failed
C:\gitHub\flutterApp01\asking\build\app\intermediates\packaged_manifests\debug\AndroidManifest.xml:131: error: resource array/health_permissions (aka com.example.asking:array/health_permissions) not
found.
error: failed processing manifest.
when I attempt to add this code as part of the instruction in the istallation process
<activity android:name=".MainActivity">
<meta-data android:name="health_permissions" android:resource="@array/health_permissions" />
<intent-filter>
<action android:name="androidx.health.ACTION_SHOW_PERMISSIONS_RATIONALE" />
</intent-filter>
</activity>
can someone help me understand where in my current manifest.xml shoud i add that without breaking the code i have tried almos anything to fix it
and this is my current manifest
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:label="asking"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:taskAffinity=""
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<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>
</activity>
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
<queries>
<package android:name="com.google.android.apps.healthdata" />
<intent>
<action android:name="android.intent.action.PROCESS_TEXT"/>
<data android:mimeType="text/plain"/>
</intent>
</queries>
<uses-permission android:name="android.permission.health.READ_ACTIVE_CALORIES_BURNED"/>
<uses-permission android:name="android.permission.health.WRITE_ACTIVE_CALORIES_BURNED"/>
</manifest>
The error message clearly describes that array/health_permissions
is not found. So to solve this issue you need to add the health_permissions.xml
file under the 'value` directory in your Android module.
Please see the health_permissions.xml
in the example project.
https://github.com/imdzx/flutter_health_connect/blob/master/example/android/app/src/main/res/values/health_permissions.xml
health_permissions.xml
<resources>
<array name="health_permissions">
<item>androidx.health.permission.ActiveCaloriesBurned.READ</item>
<item>androidx.health.permission.ActiveCaloriesBurned.WRITE</item>
<item>androidx.health.permission.BasalBodyTemperature.READ</item>
<item>androidx.health.permission.BasalBodyTemperature.WRITE</item>
<item>androidx.health.permission.BasalMetabolicRate.READ</item>
<item>androidx.health.permission.BasalMetabolicRate.WRITE</item>
<item>androidx.health.permission.BloodGlucose.READ</item>
<item>androidx.health.permission.BloodGlucose.WRITE</item>
<item>androidx.health.permission.BloodPressure.READ</item>
<item>androidx.health.permission.BloodPressure.WRITE</item>
<item>androidx.health.permission.BodyFat.READ</item>
<item>androidx.health.permission.BodyFat.WRITE</item>
<item>androidx.health.permission.BodyTemperature.READ</item>
<item>androidx.health.permission.BodyTemperature.WRITE</item>
<item>androidx.health.permission.BoneMass.READ</item>
<item>androidx.health.permission.BoneMass.WRITE</item>
<item>androidx.health.permission.CervicalMucus.READ</item>
<item>androidx.health.permission.CervicalMucus.WRITE</item>
<item>androidx.health.permission.CyclingPedalingCadence.READ</item>
<item>androidx.health.permission.CyclingPedalingCadence.WRITE</item>
<item>androidx.health.permission.Distance.READ</item>
<item>androidx.health.permission.Distance.WRITE</item>
<item>androidx.health.permission.ElevationGained.READ</item>
<item>androidx.health.permission.ElevationGained.WRITE</item>
<item>androidx.health.permission.ExerciseSession.READ</item>
<item>androidx.health.permission.ExerciseSession.WRITE</item>
<item>androidx.health.permission.ExerciseSession.READ</item>
<item>androidx.health.permission.ExerciseSession.WRITE</item>
<item>androidx.health.permission.ExerciseSession.READ</item>
<item>androidx.health.permission.ExerciseSession.WRITE</item>
<item>androidx.health.permission.ExerciseSession.READ</item>
<item>androidx.health.permission.ExerciseSession.WRITE</item>
<item>androidx.health.permission.FloorsClimbed.READ</item>
<item>androidx.health.permission.FloorsClimbed.WRITE</item>
<item>androidx.health.permission.HeartRate.READ</item>
<item>androidx.health.permission.HeartRate.WRITE</item>
<item>androidx.health.permission.Height.READ</item>
<item>androidx.health.permission.Height.WRITE</item>
<item>androidx.health.permission.HipCircumference.READ</item>
<item>androidx.health.permission.HipCircumference.WRITE</item>
<item>androidx.health.permission.Hydration.READ</item>
<item>androidx.health.permission.Hydration.WRITE</item>
<item>androidx.health.permission.LeanBodyMass.READ</item>
<item>androidx.health.permission.LeanBodyMass.WRITE</item>
<item>androidx.health.permission.MenstruationFlow.READ</item>
<item>androidx.health.permission.MenstruationFlow.WRITE</item>
<item>androidx.health.permission.Nutrition.READ</item>
<item>androidx.health.permission.Nutrition.WRITE</item>
<item>androidx.health.permission.OvulationTest.READ</item>
<item>androidx.health.permission.OvulationTest.WRITE</item>
<item>androidx.health.permission.OxygenSaturation.READ</item>
<item>androidx.health.permission.OxygenSaturation.WRITE</item>
<item>androidx.health.permission.Power.READ</item>
<item>androidx.health.permission.Power.WRITE</item>
<item>androidx.health.permission.RespiratoryRate.READ</item>
<item>androidx.health.permission.RespiratoryRate.WRITE</item>
<item>androidx.health.permission.RestingHeartRate.READ</item>
<item>androidx.health.permission.RestingHeartRate.WRITE</item>
<item>androidx.health.permission.SexualActivity.READ</item>
<item>androidx.health.permission.SexualActivity.WRITE</item>
<item>androidx.health.permission.SleepSession.READ</item>
<item>androidx.health.permission.SleepSession.WRITE</item>
<item>androidx.health.permission.SleepSession.READ</item>
<item>androidx.health.permission.SleepSession.WRITE</item>
<item>androidx.health.permission.Speed.READ</item>
<item>androidx.health.permission.Speed.WRITE</item>
<item>androidx.health.permission.StepsCadence.READ</item>
<item>androidx.health.permission.StepsCadence.WRITE</item>
<item>androidx.health.permission.Steps.READ</item>
<item>androidx.health.permission.Steps.WRITE</item>
<item>androidx.health.permission.SwimmingStrokes.READ</item>
<item>androidx.health.permission.SwimmingStrokes.WRITE</item>
<item>androidx.health.permission.TotalCaloriesBurned.READ</item>
<item>androidx.health.permission.TotalCaloriesBurned.WRITE</item>
<item>androidx.health.permission.Vo2Max.READ</item>
<item>androidx.health.permission.Vo2Max.WRITE</item>
<item>androidx.health.permission.WaistCircumference.READ</item>
<item>androidx.health.permission.WaistCircumference.WRITE</item>
<item>androidx.health.permission.Weight.READ</item>
<item>androidx.health.permission.Weight.WRITE</item>
<item>androidx.health.permission.WheelchairPushes.READ</item>
<item>androidx.health.permission.WheelchairPushes.WRITE</item>
</array>
</resources>