azhon / flutter_app_update

一个Flutter版本简单、轻量、可随意定制的Android版本更新库;A simple, lightweight, and customizable Android version update library for Flutter
Apache License 2.0
36 stars 13 forks source link

Android 平台的 build.gradle 缺少 namespace #15

Closed LittleSheep2Code closed 1 month ago

LittleSheep2Code commented 1 month ago

最新 pub.dev 版本的包 (3.1.0)

A problem occurred configuring project ':flutter_app_update'.
> Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl.
   > Namespace not specified. Specify a namespace in the module's build file: /Users/littlesheep/.pub-cache/hosted/pub.dev/flutter_app_update-3.1.0/android/build.gradle. See https://d.android.com/r/tools/upgrade-assistant/set-namespace for information about setting the namespace.

     If you've specified the package attribute in the source AndroidManifest.xml, you can use the AGP Upgrade Assistant to migrate to the namespace value in the build file. Refer to https://d.android.com/r/tools/upgrade-assistant/agp-upgrade-assistant for general information about using the AGP Upgrade Assistant.

.../android/build.gradle 的 android 块里面加一行配置

android {
    namespace 'com.azhon.flutter_app_update'
    compileSdkVersion 31
    // ...
}

就可以正常编译了

btw 我的项目 AGP 是 8.6.0 的

azhon commented 1 month ago

已经升级了gradle,可以使用最新的3.1.1版本