Skip to content

flutter build aar fails with type plugin #137564

@razfazz

Description

@razfazz

Is there an existing issue for this?

Steps to reproduce

  1. Create a plugin with the following command

flutter create -t plugin --platforms android --org com.plugi pl_plugin

  1. Create aar file with command

flutter build aar

Expected results

The process should produce an aar file

Actual results

Running Gradle task 'assembleAarDebug'...                           7.0s

e: C:\Users\user\repos\code\pl_plugin\android\src\main\kotlin\com\plugi\pl_plugin\PlPlugin.kt: (3, 28): Unresolved reference: NonNull

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction

Code sample

Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[√] Flutter (Channel stable, 3.13.9, on Microsoft Windows [Version 10.0.22621.2428], locale en-DE)
    • Flutter version 3.13.9 on channel stable at C:\Users\user\devenv\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision d211f42860 (5 days ago), 2023-10-25 13:42:25 -0700
    • Engine revision 0545f8705d
    • Dart version 3.1.5
    • 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\user\AppData\Local\Android\sdk
    • Platform android-34, build-tools 34.0.0
    • 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.3)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.7.34024.191
    • 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.83.1)
    • VS Code at C:\Users\user\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension can be installed from:
       https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (4 available)
    • GM1913 (mobile)   • 94dbf972 • android-arm64  • Android 12 (API 31)
    • Windows (desktop) • windows  • windows-x64    • Microsoft Windows [Version 10.0.22621.2428]
    • Chrome (web)      • chrome   • web-javascript • Google Chrome 118.0.5993.118
    • Edge (web)        • edge     • web-javascript • Microsoft Edge 118.0.2088.76

[√] Network resources
    • All expected network resources are available.

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: buildBuilding flutter applications with the toola: pluginsSupport for writing, building, and running plugin packagesfound in release: 3.13Found to occur in 3.13found in release: 3.16Found to occur in 3.16has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-androidOwned by Android platform teamtoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions