我正在使用AndroidX和Kotlin支持的Android Studio中构建Flutter应用程序。 我添加了Google Nearby Messages API from pub.dev并尝试构建。
这会导致以下错误:
Launching lib\main.dart on SM T395 in debug mode...
Initializing gradle...
Resolving dependencies...
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':google_nearby_messages_api:processDebugManifest'.
> Cannot read packageName from C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\google_nearby_messages_api-0.0.15\android\src\main\AndroidManifest.xml
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 15s
Finished with error: Gradle task assembleDebug failed with exit code 1
如果我打开Android模块并运行Gradle sync,则会出现此错误:
ERROR: Cannot read packageName from C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\google_nearby_messages_api-0.0.15\android\src\main\AndroidManifest.xml
Affected Modules: google_nearby_messages_api
没有相关的Dart代码可显示。