Multiple packages are installed together with Android build-tools package - android-sdk-manager

I noticed that the CMDL installation of the build-tools package using sdkmanager (version 3.0) installs emulator and platform-tools packages.
sdkmanager --verbose "build-tools;30.0.3"
Info: Preparing "Install SDK Patch Applier v4 (revision: 1)".
Info: "Install SDK Patch Applier v4 (revision: 1)" ready.
Info: Installing SDK Patch Applier v4 in /opt/android/patcher/v4
Info: "Install SDK Patch Applier v4 (revision: 1)" complete.
Info: "Install SDK Patch Applier v4 (revision: 1)" finished.
Info: Preparing "Install Android Emulator (revision: 30.4.5)".
Info: "Install Android Emulator (revision: 30.4.5)" ready.
Info: Installing Android Emulator in /opt/android/emulator
Info: "Install Android Emulator (revision: 30.4.5)" complete.
Info: "Install Android Emulator (revision: 30.4.5)" finished.
Info: Preparing "Install Android SDK Platform-Tools (revision: 31.0.0)".
Info: "Install Android SDK Platform-Tools (revision: 31.0.0)" ready.
Info: Installing Android SDK Platform-Tools in /opt/android/platform-tools
Info: "Install Android SDK Platform-Tools (revision: 31.0.0)" complete.
Info: "Install Android SDK Platform-Tools (revision: 31.0.0)" finished.
Info: Preparing "Install Android SDK Tools (revision: 26.1.1)".
Info: "Install Android SDK Tools (revision: 26.1.1)" ready.
Info: Installing Android SDK Tools in /opt/android/tools
Info: "Install Android SDK Tools (revision: 26.1.1)" complete.
Info: "Install Android SDK Tools (revision: 26.1.1)" finished.
Info: Preparing "Install Android SDK Build-Tools 30.0.3 (revision: 30.0.3)".
Info: "Install Android SDK Build-Tools 30.0.3 (revision: 30.0.3)" ready.
Info: Installing Android SDK Build-Tools 30.0.3 in /opt/android/build-tools/30.0.3
Info: "Install Android SDK Build-Tools 30.0.3 (revision: 30.0.3)" complete.
Info: "Install Android SDK Build-Tools 30.0.3 (revision: 30.0.3)" finished.
Execution of following command actually ends up with multiple platform-tools installation:
sdkmanager --verbose "platform-tools" "build-tools;30.0.3"
...
Warning: Package "com.android.repository.impl.generated.v1.RemotePackage#5f56a566" (platform-tools) should be installed in "/opt/android/platform-tools" but it already exists. Installing in "/opt/android/platform-tools-2" instead.
...
Do you know about any reason of such behavior and is there any way how to skip emulator package installation?

Behavior described in my question has been modified (tested with sdkmanager version 7.0):
sdkmanager --verbose "build-tools;33.0.0"
Info: Preparing "Install Android SDK Build-Tools 33 (revision: 33.0.0)".
Info: "Install Android SDK Build-Tools 33 (revision: 33.0.0)" ready.
Info: Installing Android SDK Build-Tools 33 in /opt/android/build-tools/33.0.0
Info: "Install Android SDK Build-Tools 33 (revision: 33.0.0)" complete.
Info: "Install Android SDK Build-Tools 33 (revision: 33.0.0)" finished.
I assume that original problem has been therefore fixed.

Related

VSCODE: Flutter failing to build for Android

flutter run
Launching lib/main.dart on AC2001 in debug mode...
Checking the license for package SDK Patch Applier v4 in /home/diva/Android/Sdk/licenses
Warning: License for package SDK Patch Applier v4 not accepted.
Checking the license for package Android Emulator in /home/diva/Android/Sdk/licenses
Warning: License for package Android Emulator not accepted.
Checking the license for package Android SDK Tools in /home/diva/Android/Sdk/licenses
Warning: License for package Android SDK Tools not accepted.
Checking the license for package Android SDK Build-Tools 29.0.2 in /home/diva/Android/Sdk/licenses
Warning: License for package Android SDK Build-Tools 29.0.2 not accepted.
Checking the license for package Android SDK Platform 30 in /home/diva/Android/Sdk/licenses
Warning: License for package Android SDK Platform 30 not accepted.
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Failed to install the following Android SDK packages as some licences have not been accepted.
patcher;v4 SDK Patch Applier v4
platforms;android-30 Android SDK Platform 30
emulator Android Emulator
tools Android SDK Tools
build-tools;29.0.2 Android SDK Build-Tools 29.0.2
To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html
Using Android SDK: /home/diva/Android/Sdk
* 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'...
Running Gradle task 'assembleDebug'... Done 2,203ms
Exception: Gradle task assembleDebug failed with exit code 1
I am trying to run Flutter using VSCODE and haven't downloaded Android Studio. I have just started learning Flutter, so pretty new.
Android SDK build Tool == 29.0.3
and Flutter == 2.2.3
NEW: After running flutter doctor, It said I should run for android-licenses
Android toolchain - develop for Android devices
(Android SDK version 29.0.3)
• Android SDK at /home/diva/Android/Sdk
• Platform android-29, build-tools 29.0.3
• Java binary at:
/usr/lib/jvm/java-11-oracle/bin/java
• Java version Java(TM) SE Runtime Environment
18.9 (build 11.0.11+9-LTS-194)
✗ Android license status unknown.
Run `flutter doctor --android-licenses` to
accept the SDK licenses.
See
https://flutter.dev/docs/get-started/install/
linux#android-setup for more details.
[✓] Chrome - develop for the web
• Chrome at google-chrome
flutter doctor --android-licenses
Android sdkmanager tool not found
(/home/diva/Android/Sdk/tools/bin/sdkmanager).
Try re-installing or updating your Android SDK,
visit
https://flutter.dev/docs/get-started/install/linux#
android-setup for detailed instructions.
run this 'flutter doctor --android-licenses' then enter y for accepting each
licenses. the CMD will show you each license one by one which you have
to accept by entering y in CMD prompt. It solved my problem. I hope
this will also work for you
As the error output is suggesting. You need to accept license agreements
Android SDK packages as some licences have not been accepted.
to solve this
go to your terminal
flutter doctor --android-licenses
press (y) to
accept

(M1 Mac) Android Studio Doesn't Detect Android Emulator

I just downloaded android emulator through android studio. Didn't use the GitHub repo to download dmg file. Then I started the S level API android emulator from and manager. Android emulator boots but android studio doesn't detect and doesn't run app on it.
What could be the problem?
Reproduced:
Remove *.lock files in avd folder (Didn't work)
flutter doctor -v
[✓] Flutter (Channel stable, 2.2.1, on macOS 11.4 20F71 darwin-arm, locale tr-TR)
• Flutter version 2.2.1 at /Users/alperenbaskaya/Desktop/flutter
• Framework revision 02c026b03c (2 weeks ago), 2021-05-27 12:24:44 -0700
• Engine revision 0fdb562ac8
• Dart version 2.13.1
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/alperenbaskaya/Library/Android/sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.5, Build version 12E262
• CocoaPods version 1.10.1
[✓] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
• 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 1.8.0_242-release-1644-b3-6915495)
[!] Connected device
! No devices available
! Doctor found issues in 1 category.
1)Try enabling USB Debugging in the Android emulator itself, as you would do on a real device. Settings-> Developer options-> enable USB Debugging.
2)Probably the project you are running is not compatible (API version/Hardware requirements) with the emulator settings. Check-in your build.gradle file if the target SDK and minimum SDK version are lower or equal to the SDK version of your Emulator.
You should also uncheck Tools > Android > Enable ADB Integration
If your case is different then restart your Android Studio and run the emulator again.
For more info:
Android studio: emulator is running but not showing up in Run App "choose a running device"
Android Studio does not detect the emulator
I went to the AVD Manager and in the options for the particular emulator I selected "Cold Boot Now" and it resolved my issue.

Flutter run stuck at Preparing "Install Android SDK Build-Tools 28.0.3 (revision: 28.0.3)"

I have just set up flutter development environment and after creating first app, on flutter run, debug console is stuck at
Preparing "Install Android SDK Build-Tools 28.0.3 (revision: 28.0.3)".
Flutter is trying to install Android SDK build tools. This will be installed even if you already have a different version of the SDK. Since the SDK is quite large, it may take some time to download and unpack
In my case it caused by McAfee. After turning off the virus scan and firewall functions everything went well.

How to Install Android SDK commandline tool for Flutter upgrade error?

How to install Android SDK commandline tool on a Ubuntu remote server which doesn't have Display/GUI.
When I run, 'flutter upgrade' it gives me the below and I wanted to know if I can use Android SDK commandline tool for resolving the issue.
$flutter upgrade
Upgrading Flutter from /home/yvelumani/flutterDev/sdk/flutter...
Building flutter tool...`
Upgrading engine...
Downloading Android Maven dependencies...
Failed to download the Android dependencies
Downloading Android Maven dependencies... 127.7s (!)
Flutter 1.22.0-10.0.pre.133 • channel master • https://github.com/flutter/flutter.git
Framework • revision 577de1c44e (46 minutes ago) • 2020-09-10 15:55:03 -0700
Engine • revision fee6f9e533
Tools • Dart 2.10.0 (build 2.10.0-110.0.dev)
Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 1.22.0-10.0.pre.133, on Linux, locale en_US.UTF-8)
[!] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, set ANDROID_HOME to that location.
You may also want to add it to your PATH environment variable.
✗ Android SDK file not found: adb.
[!] Android Studio (not installed)
[✓] Proxy Configuration
[!] Connected device
! No devices available
! Doctor found issues in 3 categories.
I have downloaded android SDK commandline tool from https://developer.android.com/studio#command-tools. But I am not sure how to install this tool and what path to be chosen as ANDROID_HOME?
NOTE: I am not going/able to use Android Studio for my app development.
Thanks for the help in advance.
Android Studio >> Tools >> SDK Manager >> SDK Tools >> Android SDK Command Line Tools

Flutter SDK is not authorized by AVD

I'm running Android studio as an administrator in Windows 10. The AVD is a Nexus 5X API 28. I'm trying to run the flutter demo, but the device drop-box still shows "no devices", it only has the "Open Android Emulator" option, which I clicked to start the AVD:
The output of
flutter doctor -v
is:
[√] Flutter (Channel stable, v1.0.0, on Microsoft Windows [Version 10.0.17134.407], locale en-US)
• Flutter version 1.0.0 at C:\Users\User\flutter_windows_v1.0.0-stable\flutter
• Framework revision 5391447fae (10 days ago), 2018-11-29 19:41:26 -0800
• Engine revision 7375a0f414
• Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)
[√] Android toolchain - develop for Android devices (Android SDK 28.0.3)
• Android SDK at C:\Users\User\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
• All Android licenses accepted.
[√] Android Studio (version 3.2)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 31.1.1
• Dart plugin version 181.5656
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
[!] Connected device
• Device emulator-5554 is not authorized.
You might need to check your device for an authorization dialog.
! Doctor found issues in 1 category.
Unlike in a real phone connected via USB, here there is no authorization dialog when I start the AVD. How can I authorize the phone?
This simple solution worked: Wipe data and Cold Boot.
Didn't work:
Note that in the Terminal of the Android studio, adb is not recognized (following flutter installation instructions). You can add the android SDK location path to the PATH environmental variable just to be able to run adb, but this won't give you more information than flutter doctor -v. The android SDK path should be already in Tools|SDK Manager, which is in my case "C:\Users\User\AppData\Local\Android\Sdk", nothing to do with "android-sdk-windows". Killing and restarting adb didn't work.
Logcat shows the message "Please configure Android SDK" (click on "configure", opens "Project Structure" window). The paths to SDK and default JDK are valid. Installing NDK miscofigured something else, so I uninstalled it and left this path field empty. Under "Project", all Version and Repository fields are empty.
You should add ANDROID_HOME variable to your class_path
set ANDROID_HOME=C:\<installation location>\android-sdk-windows
set PATH=%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools
Taken from this
After that call flutter doctor -v and flutter devices