Reputation: 31
flutter build aar fail
error info : Task 'assembleAarDebug' not found in root project 'android_generated'.
sudo flutter build aar fixed this problem,but wo want't do it,
fluter doctor info
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable/v1.17.5.taobao, v1.17.0-4.0.pre.32, on Mac OS X 10.15.6 19G2021, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✗] Xcode - develop for iOS and macOS
✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
Download at: https://developer.apple.com/xcode/download/
Or install Xcode via the App Store.
Once installed, run:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch
✗ CocoaPods not installed.
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart
side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To install:
sudo gem install cocoapods
[✓] Android Studio (version 3.6)
[✓] VS Code (version 1.51.1)
[!] Connected device
! No devices available
some one can help me
Upvotes: 2
Views: 353
Reputation: 31
I fixed this problem
org.gradle.configureondemand=false, This configuration is useful to me, this is the truth。
In the initialization script(aar_init_script.gradle),the task assembleAarDebug is be Added by the method projectsEvaluated。
if you set 'org.gradle.configureondemand=true', The execution order of the script has been modified, The task assembleAarDebug has not been added yet, gradle will execute it。
This is the cause of this error(Unable to build AAR, Task 'assembleAarDebug' not found).
Note that the priority of gradle.properties in the gradle home directory(/Users/username/.gradle/) is higher than that in the project。
Upvotes: 1