Android sdk target folder is neither empty nor does

Разработка под Android: устанавливаем SDK

Такая популярная операционная система как Android не может обойтись без мощных и простых средств разработки. И именно здесь Android SDK (Software Development Kit или Набор средств для разработки ПО) показывает себя с лучшей стороны. Сегодня мы установим SDK и посмотрим, что он умеет. Это будет цикл статей о разработке приложений и игр для Android

Содержание

Подготовка к установке

Android SDK поддерживает большинство современных операционных систем под архитектурой x86 и x86_64, в том числе Windows, многие дистрибутивы Linux и Mac OS X. Также на ПК должен быть установлен Java Development Kit (Java 7 или Java 8), который обязательно потребуется для многих возможностей SDK, ведь Android неразрывно связан с Java.

Читайте также:  Где находится серийный номер андроид

Стоит заметить, что для встроенного эмулятора Android необходимо хорошее «железо» на PC, как, в принципе, и для других современных средств разработки.

Установка с помощью Android Studio

Уже долгое время существует Android Studio — официальная IDE (Integrated Development Enviroment) для разработки под Android. Туда уже включено всё необходимое и устанавливается в один клик. Достаточно лишь установить IDE, и вы также сможете использовать все возможности SDK, интегрированные внутри среды разработки.

Скачать Android Studio можно с официального сайта. Там же можно найти много полезных гайдов по работе с Android SDK, но, к сожалению, доступны они исключительно на английском языке.

Установка отдельного пакета

Если вы не рассчитываете использовать такой мощный инструмент как Android Studio или у вас уже есть установленная Intellij IDEA, на основе которой и работает эта среда разработки, то вы можете установить Android SDK отдельно. Однако никаких других преимуществ этот метод установки не даст и рекомендуется воспользоваться предыдущим способом.

Для загрузки отдельного пакета инструментов для разработки без IDE необходимо воспользоваться сайтом Android Developer. Игнорируя все возможные упоминания об Android Studio, спускаемся в самый низ страницы и находим раздел «Get just command line tools» — можно также воспользоваться поиском по странице. После скачивания подходящего пакета для вашей операционной системы, достаточно распаковать в любое удобное для вас хранилище — рекомендуется также указать местоположение SDK в Intellij IDEA (Project Structure > SDK).

Запуск и возможности

Для получения доступа ко всему функционалу Android SDK достаточно запустить пакетный файл android, если вы работаете под Windows, или же в терминале выполнить команду «android» в папке «tools/» вашего SDK для запуска на Linux и MacOS X. Вам будет предложено установить инструменты для разных версий API, чем больше инструментов установлено — тем лучше. Загрузка пакетов может занять много времени в зависимости от вашей системы и скорости интернет-соединения.

Перейдём к описанию основных инструментов:

  • Platform-tools включает в себя основные инструменты взаимодействия с Android, такие как ADB, fastboot и systrace. Android Debugging Bridge поможет отследить ошибки в работе приложений на смартфоне, а также выполнять некоторые действия по работе с APK; fastboot, знакомый всем любителям прошивки своих Android-девайсов, работает в паре с ADB и помогает наладить работу устройства ещё до загрузки ОС, а systrace способен анализировать скорость работы процессов в операционной системе;
  • Build-tools работают вместе с Platform-tools, но могут быть обновлены отдельно. Сюда входят такие утилиты как ProGuard для защиты ваших APK-файлов, JOBB для работы с расширениями в формате *.obb, и Zipalign, необходимый для оптимизации ваших готовых приложений;
  • Кроме того, в SDK предусмотрен продвинутый эмулятор ОС Android, в котором вы сможете протестировать любые приложения и опробовать функции свежих версий Android. Однако для качественной эмуляции необходимо хорошее железо на ПК, также рекомендуется использовать эмуляцию работы x86.

Зачем же нужен Android SDK?

Android SDK — универсальный набор инструментов, который пригодится каждому пользователю смартфона или планшета, работающего под операционной системой Android. Обычный юзер может получить доступ к необходимым логам, восстановить устройство из нерабочего состояния и получить доступ к полноценному эмулятору, тогда как для разработчика это тот самый необходимый минимум, чтобы начать создавать игры и программы для Android.

Источник

Command failed: /home/raja/.buildozer/android/platform/android-sdk/tools/bin/sdkmanager tools platform-tools #922

Comments

rajashah33 commented Jun 23, 2019 •

Versions

  • Python: 2.7.15+ / 3.6.7
  • OS: Linux Mint
  • Buildozer:

Description

I am trying to run ‘buildozer android debug deploy run’ command for generating first apk.
I think there is some problem related to sdkmanager.
Previously, there was an error that ‘sdkmanager not found’ so I downloaded from developer site and placed it in the path specified in the error.
Now this error has been arised.
Please help.

buildozer.spec

The text was updated successfully, but these errors were encountered:

AndreMiras commented Jun 23, 2019

Don’t you have ore log context? Could you share the complete log?

rajashah33 commented Jun 24, 2019

Don’t you have ore log context? Could you share the complete log?

below is the txt file. Please see it.

AndreMiras commented Jun 25, 2019

Thanks for sharing. Well this looks properly weird.
Indeed this part looks completely of:

I have never seen that before in buildozer/p4a but that looks more like a system misconfiguration issue than a buildozer issue.
I would give these a try anyway https://stackoverflow.com/questions/6784463/error-trustanchors-parameter-must-be-non-empty

JavierGonzalezAlvarez commented Oct 5, 2019

Versions

Description:

I wonder if you solve this issue, cos I have the same problem with sdkmanager when I complie with buildozer.

Error:

Exception in thread «main» java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.android.repository.api.SchemaModule$SchemaModuleVersion.(SchemaModule.java:156)
at com.android.repository.api.SchemaModule.(SchemaModule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.(AndroidSdkHandler.java:81)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
. 5 more

Command failed: /home/easy-peasy/.buildozer/android/platform/android-sdk/tools/bin/sdkmanager tools platform-tools

Buildozer failed to execute the last command
The error might be hidden in the log above this error
Please read the full log, and search for it before raising an issue with buildozer itself.
In case of a bug report, please add a full log with log_level = 2

Источник

VS 16.7.0 P3.1 Android SDK License Acceptance Dialog #4880

Comments

gmck commented Jun 28, 2020

Nearly every compiler error triggers this dialog. When I Accept, the build window then displays the following.

The first time it happened, after updating to Preview 3.1, I then just updated the SDK manually. All is ok until the next compiler error when the dialog reappears. If I run it again — same result. Again all is ok until the next compiler error and back it comes. The cmdline-tools folder was created 24/07/2020 and contains a subfolder latest, which contains bin and lib folders both dated 24/07/2020. There are no files in cmdline-tools folder only the folder latest, so the Trying to fallback to «tools».. errors would be correct.

Manually running the Android SDK Manager within VS indicates there are no available updates.

The text was updated successfully, but these errors were encountered:

brendanzagaeski commented Jun 28, 2020

Thanks for submitting this item! This is an unfortunate known issue in Visual Studio 2019 version 16.7 Preview 3, but there are a few workaround options available:

Option A – Set the AndroidCommandLineToolsVersion MSBuild property to latest :

Open the .csproj project file for the Xamarin.Android app project in Visual Studio or another text editor.

Find an existing closing

tag in the file, and add the following additional

element after it:

This option is included in the Visual Studio release notes, but it’s a bit hard to find: https://docs.microsoft.com/visualstudio/releases/2019/release-notes-preview#xamarin

After a fix for this issue becomes available in the next Visual Studio 2019 version 16.7 Preview, be sure to remove the workaround

element to allow the project to use the default recommended value of AndroidCommandLineToolsVersion .

Option B – Temporarily disable the Auto Install Android SDKs feature and ignore the message in the Error List:

Open Tools > Options, open the Xamarin > Android Settings item, and uncheck Auto Install Android SDKs.

After a fix for this issue becomes available in the next Visual Studio 2019 version 16.7 Preview, be sure to re-enable Auto Install Android SDKs.

Option C – Click Cancel on the Android SDK — License Acceptance dialog each time it pops up and ignore the message in the Error List.

Explanation: In this particular case, the «missing Android SDKs» error does not interfere with the build process, so it is OK to ignore the error and dismiss the Android SDK — License Acceptance dialog each time it appears.

Источник

Command failed: /home/raja/.buildozer/android/platform/android-sdk/tools/bin/sdkmanager tools platform-tools #922

Comments

rajashah33 commented Jun 23, 2019 •

Versions

  • Python: 2.7.15+ / 3.6.7
  • OS: Linux Mint
  • Buildozer:

Description

I am trying to run ‘buildozer android debug deploy run’ command for generating first apk.
I think there is some problem related to sdkmanager.
Previously, there was an error that ‘sdkmanager not found’ so I downloaded from developer site and placed it in the path specified in the error.
Now this error has been arised.
Please help.

buildozer.spec

The text was updated successfully, but these errors were encountered:

AndreMiras commented Jun 23, 2019

Don’t you have ore log context? Could you share the complete log?

rajashah33 commented Jun 24, 2019

Don’t you have ore log context? Could you share the complete log?

below is the txt file. Please see it.

AndreMiras commented Jun 25, 2019

Thanks for sharing. Well this looks properly weird.
Indeed this part looks completely of:

I have never seen that before in buildozer/p4a but that looks more like a system misconfiguration issue than a buildozer issue.
I would give these a try anyway https://stackoverflow.com/questions/6784463/error-trustanchors-parameter-must-be-non-empty

JavierGonzalezAlvarez commented Oct 5, 2019

Versions

Description:

I wonder if you solve this issue, cos I have the same problem with sdkmanager when I complie with buildozer.

Error:

Exception in thread «main» java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.android.repository.api.SchemaModule$SchemaModuleVersion.(SchemaModule.java:156)
at com.android.repository.api.SchemaModule.(SchemaModule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.(AndroidSdkHandler.java:81)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
. 5 more

Command failed: /home/easy-peasy/.buildozer/android/platform/android-sdk/tools/bin/sdkmanager tools platform-tools

Buildozer failed to execute the last command
The error might be hidden in the log above this error
Please read the full log, and search for it before raising an issue with buildozer itself.
In case of a bug report, please add a full log with log_level = 2

Источник

Оцените статью