Flutter:AndroidManifest 找不到@xml 资源

Flutter: AndroidManifest cannot find @xml resource

我创建了一个 flutter 应用程序,我想为其实现一个主屏幕小部件。第一次尝试,我遵循本教程: https://medium.com/@ashishgarg1998/how-to-create-home-screen-app-widgets-in-flutter-ce3458f3638e

复制代码片段后,构建时抛出以下异常:

Execution failed for task ':app:processDebugResources'.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Android resource linking failed
     /Users/me/Documents/MyApp/myapp/android/app/src/main/AndroidManifest.xml:41:13-42:55: AAPT: error: resource xml/widget_info (aka de.myapp.myapp:xml/widget_info) not found.

AndroidManifest.xml中的错误代码是:

<receiver android:name="AppWidgetProvider" >
    <intent-filter>
         <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
    </intent-filter>
    <meta-data 
         android:name="android.appwidget.provider"
         android:resource="@xml/widget_info" />
</receiver>

显然,找不到 widget_info.xml 文件。我试图只使用完整的文件路径,但编译器只允许我使用 @xml/... 符号。我怎样才能解决这个问题?旁注:我没有任何 Android/Kotlin 经验,只有 Flutter。

下面,你可以看到我的文件结构:

实际上我现在自己找到了解决方案。 AndroidManifest.xml 文件正在寻找

中的 @xml 资源
android/app/src/main/res

文件夹而不是

android/app/res

教程建议的文件夹。所以移动 widget_info.xml 文件就成功了。