[help] Android build error
victor-nerdunited opened this issue · comments
- I have read the README
- I have done the setup for Android
- [] I have done the setup for iOS
- [] I have ran the sample app and it does not work there
Version
Technology | Version |
---|---|
Workmanager version | 0.5.1 |
Xcode version | NA |
Swift version | NA |
iOS deployment target | NA |
Flutter SDK version | >=2.18.0 <4.0.0 |
Describe the error
The example app builds and runs. I created a new flutter app based off of flutter fire and added workmanager to it. The app builds and runs without workmanager, but if I add workmanager it wont build with this error:
$ flutter run
Using hardware rendering with device sdk gphone64 x86 64. If you notice graphics artifacts, consider enabling software rendering with "--enable-software-rendering".
Launching lib\main.dart on sdk gphone64 x86 64 in debug mode...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':workmanager'.
> Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl.
> Namespace not specified. Please specify a namespace in the module's build.gradle file like so:
android {
namespace 'com.example.namespace'
}
If the package attribute is specified in the source AndroidManifest.xml, it can be migrated automatically to the namespace value in the build.gradle file using the AGP Upgrade Assistant; please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information.
* 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 1s
Running Gradle task 'assembleDebug'... 2,182ms
Exception: Gradle task assembleDebug failed with exit code 1
Output of flutter doctor -v
$ flutter doctor -v
┌─────────────────────────────────────────────────────────┐
│ A new version of Flutter is available! │
│ │
│ To update to the latest version, run "flutter upgrade". │
└─────────────────────────────────────────────────────────┘
[√] Flutter (Channel stable, 3.13.2, on Microsoft Windows [Version 10.0.22621.2283], locale en-US)
• Flutter version 3.13.2 on channel stable at C:\flutter\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision ff5b5b5fa6 (5 weeks ago), 2023-08-24 08:12:28 -0500
• Engine revision b20183e040
• Dart version 3.1.0
• DevTools version 2.25.0
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at C:\Users\VictorPonce\AppData\Local\Android\Sdk
• Platform android-34, build-tools 34.0.0
• ANDROID_HOME = C:\Users\VictorPonce\AppData\Local\Android\Sdk
• Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.7.4)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.7.34031.279
• Windows 10 SDK version 10.0.22621.0
[√] Android Studio (version 2022.3)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)
[√] VS Code (version 1.82.2)
• VS Code at C:\Users\VictorPonce\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.72.0
[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22621.2283]
• Chrome (web) • chrome • web-javascript • Google Chrome 117.0.5938.92
• Edge (web) • edge • web-javascript • Microsoft Edge 117.0.2045.36
[√] Network resources
• All expected network resources are available.
• No issues found!
I mentioned the example app runs before, but if I remove the relative reference to the workmanager plugin and use pub.dev then it fails with the same error as my app.
Please try again with the new version 0.5.2.
@ened that did it, thank you!