Repository navigation
[flutter module] Flutter_tools/gradle/aar_init_script.gradle' line: 15 - AAR build fail #57795
Copy link
Copy link
Closed
Labels
a: existing-appsIntegration with existing apps via the add-to-app flowIntegration with existing apps via the add-to-app flowc: crashStack traces logged to the consoleStack traces logged to the consolec: regressionIt was better in the past than it is nowIt was better in the past than it is nowt: gradle"flutter build" and "flutter run" on Android"flutter build" and "flutter run" on AndroidtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Description
Steps to Reproduce
- Create an add-to-app module:
flutter create -t module --org com.example path_provider_issue - Add dependency
path_provider: ^1.5.1to pubspec.yaml and runflutter pub get - Run
flutter build aar
If opening pubspec.lock I found that:
path_provider_macos:
dependency: transitive
description:
name: path_provider_macos
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.0.4+3"
and if I force path_provider_macos to 0.0.4+2 in pubspec.yaml, the build passes.
path_provider_macos 0.0.4+3 removes the android module, but Flutter tries to evaluate android/build.gradle inside it.
Logs
➜ path_provider_issue $ ls -a
. .dart_tool .gitignore .metadata lib pubspec.lock
.. .flutter-plugins .idea .packages path_provider_issue.iml pubspec.yaml
.android .flutter-plugins-dependencies .ios README.md path_provider_issue_android.iml test
➜ path_provider_issue $ flutter pub get
Running "flutter pub get" in path_provider_issue... 0.3s
➜ path_provider_issue $ flutter build aar
Running Gradle task 'assembleAarDebug'...
Running Gradle task 'assembleAarDebug'... Done 3.3s
FAILURE: Build failed with an exception.
* Where:
Initialization script '/Users/perqinxie/App/flutter-latest-stable/packages/flutter_tools/gradle/aar_init_script.gradle' line: 15
* What went wrong:
Android property not found.
* 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 2s
Gradle task assembleAarDebug failed with exit code 0.
Running flutter doctor -v:
➜ path_provider_issue $ flutter doctor -v
[✓] Flutter (Channel stable, v1.17.1, on Mac OS X 10.15.4 19E287, locale ja-CN)
• Flutter version 1.17.1 at /Users/perqinxie/App/flutter-latest-stable
• Framework revision f7a6a7906b (9 days ago), 2020-05-12 18:39:00 -0700
• Engine revision 6bc433c6b6
• Dart version 2.8.2
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Users/perqinxie/Library/Android/sdk
• Platform android-29, build-tools 29.0.3
• ANDROID_HOME = /Users/perqinxie/Library/Android/sdk
• ANDROID_SDK_ROOT = /Users/perqinxie/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.5, Build version 11E608c
• CocoaPods version 1.8.4
[✓] Android Studio
• Android Studio at /Applications/Android Studio 4.1 Preview.app/Contents
• Flutter plugin version 45.1.2
• Dart plugin version 193.6911.31
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] Android Studio (version 3.6)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 45.1.1
• Dart plugin version 192.8052
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
[!] IntelliJ IDEA Ultimate Edition (version 2020.1.1)
• IntelliJ at /Applications/IntelliJ IDEA.app
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• For information about installing plugins, see
https://flutter.dev/intellij-setup/#installing-the-plugins
[✓] VS Code (version 1.45.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.10.2
[✓] Proxy Configuration
• HTTP_PROXY is set
• NO_PROXY is *.oa.com,*.tencent.com,127.0.0.1,localhost
• NO_PROXY contains 127.0.0.1
• NO_PROXY contains localhost
[✓] Connected device (1 available)
• BLN AL10 • JJRDU16A26004316 • android-arm64 • Android 8.0.0 (API 26)
! Doctor found issues in 1 category.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
a: existing-appsIntegration with existing apps via the add-to-app flowIntegration with existing apps via the add-to-app flowc: crashStack traces logged to the consoleStack traces logged to the consolec: regressionIt was better in the past than it is nowIt was better in the past than it is nowt: gradle"flutter build" and "flutter run" on Android"flutter build" and "flutter run" on AndroidtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Activity
TahaTesser commentedon May 22, 2020
Edit:
Misunderstood, path_provider_macos isn't separate than path_provider
perqin commentedon May 22, 2020
Thanks for the solution.
By the way, what if I am working on a project targeting both macOS and Android? I believe this is a bug of Flutter build tool, because the generated Gradle script loads plugin from deprecated
.flutter-pluginsfile.tiagoantunes commentedon May 22, 2020
same issue,
#57810
[-]path_provider_macos 0.0.4+3 breaks Android build[/-][+][flutter module] Flutter_tools/gradle/aar_init_script.gradle' line: 15 - AAR build fail[/+]creativecreatorormaybenot commentedon May 25, 2020
@TahaTesser This is not fixed by just using
path_providerbecause it depends onpath_provider_macos. Basically, mostflutter/pluginscurrently break Flutter module builds on Android.#46304 only fixed APK and AAB builds but not AAR builds.
Here is a list of the offending commits by @cg021:
cyanglaz commentedon May 25, 2020
cc @blasten
TahaTesser commentedon May 26, 2020
@creativecreatorormaybenot
Thanks for explanation, i have found the mentioned issue later than this
blasten commentedon May 26, 2020
If you are on the latest stable, this issue can be solved by just running
flutter cleanand thenflutter build aar.Flutter clean will delete the .android directory, and then
flutter build aarwill regenerate a new.androiddirectory that includes an updated version ofinclude_flutter.groovy.creativecreatorormaybenot commentedon May 27, 2020
@blasten That did not seem to work for us. Our CD showed this issue and it was using both the latest
stableversion and a clean project afaic.perqin commentedon May 27, 2020
@blasten I'm using Flutter 1.17.1 and
flutter cleandoesn't work.wanjm commentedon May 27, 2020
I didn't depend on path_provider, and come across such error, and flutter doesn't work;
blasten commentedon May 28, 2020
This issue also affects apps because 54dba4c isn't on
1.17.1(stable).blasten commentedon May 28, 2020
This is now fixed on stable. Run
flutter upgradewhile on the stable channel.jimneylee commentedon Jun 1, 2020
just show my found answer for others: https://stackoverflow.com/questions/59942331/android-property-not-found-error-while-building-flutter-aar
github-actions commentedon Aug 20, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.