Unity не видит android sdk

Настройка Android SDK

Прежде чем вы сможете запустить написанный код на Android-устройстве, нужно выполнить несколько простых действий. Это относится как к работе с Unity, так и к созданию приложений с нуля.

1. Скачать Android SDK

Зайдите на страницу Android Developer SDK. Скачайте архив с последней версией Android SDK и распакуйте его.

2. Установить Android SDK

Следуйте инструкциям на странице Installing the SDK (причём, вы можете свободно пропустить опциональные части, относящиеся к Eclipse). В шаге 4 руководства Installing the SDK убедитесь, что добавили как минимум одну Android platform (Android платформу) с уровнем API равным или выше 9 (платформа 2.3 или выше), Platform Tools и USB drivers (USB драйверы), если вы используете Windows.

3. Удостовериться, что система определяет ваше устройство

Это может быть не так просто, особенно на Windows системах, в которых драйвера часто бывают источником проблем. Также, с вашим устройством может идти дополнительная информация или особые драйверы от производителя.

Для Windows: если Andoid устройство автоматически определяется системой, вам все равно придётся обновить драйверы на те, который поставляются с Android SDK. Это делается через диспетчер устройств Windows. —>Если устройство не определяется автоматически, используйте драйверы из Android SDK или особые драйверы, предоставленные производителем. —>Дополнительную информацию можно найти здесь: USB Drivers for Windows

Для Mac: если вы разрабатываете на OSX, тогда обычно не требуется никаких дополнительных драйверов.

Важно: Не забудьте включить “Отладку по USB” на вашем устройстве. Перейдите в Настройки -> Параметры разработчика , для включения отладки по USB. Начиная с Android Jelly Bean 4.2, параметры разработчика по умолчанию скрыты. Для их включения, понажимайте несколько раз пальцем на строку в меню Настройки -> Об устройстве -> Номер сборки . После этого вам станет доступен пункт Настройки -> Параметры разработчика .

Если вы не уверены, что ваше устройство корректно установилось в системе, пожалуйста, прочтите страницу Решение проблем при разработке под Android для дополнительной информации.

4. Добавить путь до Android SDK в Unity

При первой сборке проекта под Android (или если Unity не сможет обнаружить SDK), вас попросят указать местоположение папки, в которую вы установили Android SDK (вы должны выделить корневую папку установленного SDK). Путь до Android SDK также можно изменить в редакторе, выбрав в меню Unity > Preferences и перейдя в раздел External Tools окна настроек.

Источник

Решение проблем при разработке под Android

Ошибка “No Platforms Found”:

  1. Удалите установленный Android SDK и убедитесь, что у вас нигде не установлены ещё копии.
  2. Обновите Java до последней стабильной версии. Никогда не забывайте, что хоть самая последняя версия не должна конфликтовать, у пользователей в прошлом всё равно бывали проблемы.
  3. Скачайте свежую копию самого последнего ADT Bundle и установите его следуя инструкциям. Это должно корректно откалибровать инструменты разработки: http://developer.android.com/sdk/index.html
  4. Настройте Unity на работу с установленным Android SDK.

Unity не удаётся установить ваше приложение на ваше устройство

  1. Убедитесь, что ваш компьютер видит ваше устройство и может взаимодействовать с ним. Для деталей см. Публикация сборок.
  2. Проверьте консоль Unity на наличие сообщений об ошибках. Это часто помогает в определении проблемы.

Если у вас появляется ошибка “Unable to install APK, protocol failure” во время сборки, то это значит, что ваше устройство подключено через USB-порт с низким питанием (возможно порт на клавиатуре или ещё на какой-нибудь периферии). Если такое случается, то попробуйте подсоединить устройство в USB порт на самом компьютере.

Читайте также:  Unsupported class file major version 60 android

Ваше приложение падает сразу после запуска.

  1. Убедитесь, что вы не пытаетесь использовать NativeActivity с устройствами, которые это не поддерживают.
  2. Попробуйте убрать все нативные плагины, что у вас есть.
  3. Попробуйте отключить stripping.
  4. Используйте adb logcat чтобы получить отчёт о крахе с вашего устройства.

Building DEX Failed

Это ошибка, которая выдаёт сообщение, вроде следующего:-

Обычно это вызвано неверной версией Java на вашем компьютере. Обновление Java до последней версии обычно решает проблему.

Приложение падает через несколько секунд после начала проигрывания видео.

Убедитесь, что Settings->Developer Options->Don’t keep activities не включено на вашем телефоне. Проигрыватель видео — это отдельное приложение и поэтому обычное игровое приложение будет закрыто, если проигрыватель видео включён.

Моя игра закрывается, когда я жму кнопку сна

Измените тег activity в файле AndroidManifest.xml так , чтобы он содержал тег android:configChanges , сделайте это таким образом, как описано здесь.

Пример тега activity может выглядеть, например, вот так:-

Источник

Unity3D не видит Android SDK

android sdk + unity3d
Здравствуйте! Хотел спросить у меня вылезла ошибка после переустановки android sdk. И теперь когда.

Android SDK не видит устройство
Пытаюсь запустить проект на своем китайском планшете (Go clever insigma 800m), возможно ли что это.

Eclipse Kepler не видит Android SDK
Установил Eclipse Kepler, который скачал с официального сайта сегодня. И установил Android SDK.

PhoneGap. Как его использовать? В чем его недостатки по сравнению с Android SDK, Windows Phone SDK, iOS SDK?
В вики написано, что PhoneGap 7

Решение

Добавлено через 4 часа 35 минут
После экспериментов всё же запустилось на 1.8.0_162. Посмотрите тему, что я скинул, может и вам поможет.

Актуально на сегодня:

JDK 1.8.0.25 (1.8.0_152) //скачать, установить стандартно и скопировать в Юнити, предварительно удалив её JDK.
SDK Unity // стандарт
NDK Unity // стандарт
Gradle 6.5.1-all //скачать, закинуть в Юнити (возможно в ней нет папки gradle, — создать. Если есть, то удалить.)

Важно!
По неизвестной мне причине Юнити ставит \бэкслэш в пути к своим инструментам.
Это мешает ей получить полный доступ к SDK и JDK (как на скринах).
Правится очень просто вручную: скопировать путь, снять галочку, вставить путь, заменить на /слэш .

Вот и пригодилось)

Добавлено через 56 минут
JDK 1.8.0.25
Поставляется компанией Microsoft стандартно с Visual Studio.
Mac — $HOME/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25
Windows — C:\Program Files\Android\jdk\microsoft_dist_openjdk_1.8.0.25

Gradle 6.5.1 (Complete)
https://gradle.org/releases/

Лично у меня просто батник лежит в C:\Program Files\Unity\Hub\Editor\2019.4.21f1\Editor\Data\PlaybackEngin es\AndroidPlayer\SDK\platform-tools . Ярлык на столе.

1. В смарте включил вайфай (точка, клиент — не имеет значения).
2. В смарте — Настройки — О телефоне — Общая информация: запомнил IPADRESS, прописал его в батнике.
3. Коннект смарта через USB, он спросил в каком режиме, я ответил MTP (мультимедиа).
4. Старт батника. Слышно реконнект usb.

«No Android SDK found. configure an Android SDK». Что делать?
Сначала Андроид Студио зависал при компиляции приложения и выдавал сообщение, что слетел.

Sdk в настойках Android Studio и sdk в Project Structure
То есть получается что путь к sdk которое использует Android Studio прописывается в Settings.

Источник

Не удается заставить Android SDK работать для Unity [duplicate]

Вам просто нужно запустить это:

Если дамп содержит несколько баз данных, вы должны опустить имя базы данных:

Чтобы запустить эти команды, откройте командную строку (в Windows) и cd в каталоге, где выполняется исполняемый файл mysql.exe вам, возможно, придется немного оглядеться, это будет зависеть от того, как вы установили mysql, то есть автономно или как часть пакета, такого как WAMP). Когда вы находитесь в этом каталоге, вы должны просто ввести команду.

1 ответ

Решение этой проблемы постоянно меняется с течением времени, когда Unity и Android SDK меняются.

Обратите внимание, что его проблема, по-видимому, исправлена ​​в Unity 2017.1.

1) Для Windows загрузите «tools_r25.2.3-windows.zip» и разархивируйте его.

2) Для MacOSX загрузите «tools_r25. 2.3-macosx.zip » и разархивируйте его.

3) Добавьте путь распакованного SDK к настройкам Edit -> ] —> Внешние инструменты —> SDK box.

STILL NOT WORKING?

Удалить SDK Tools 25 и Android SDK Tools 26. Удалить как SDK Platform-Tools, так и SDK Tools. Используйте номер версии ниже.

Читайте также:  Работа с nfc android studio

Вы не правильно настроили SDK .

Для настройки Android SDK выполните следующие действия.

1. Убедитесь, что в SDKpath нет пробелов. Поэтому создайте папку с именем AndroidSDK в каталоге C .

2. Скопируйте папку Android-sdk в каталог C:/AndroidSDK .

Теперь ваш путь к SDK должен выглядеть так:

3. Обновите свой Android SDK-путь в редакторе Unity.

Теперь проверьте, работает ли это, пытаясь снова создать для Android.

Если это не удается, продолжайте снизу

4. Загрузите последнюю версию Unity.

5. Перезагрузите SDK , затем скопируйте файл в C:/AndroidSDK/Android-sdk .

6. Вернитесь в Unity и обновите путь

7. Создайте проект для Android еще раз, он покажет ошибку и попросит вас обновить SDK.

Нажмите кнопку «Обновить Android SDK». Unity автоматически обновит ваш SDK. Затем ваш SDK должен выглядеть как-то внизу. Ваша проблема должна быть удалена.

Источник

Android environment setup

Whether you’re building an Android application in Unity or programming it from scratch, you must set up the Android Software Development Kit (SDK) before you can build and run any code on your Android device. By default, Unity installs a Java Development Kit based on OpenJDK.

1. Download the Android SDK

You can install the Android SDK using command line tools or through Android Studio. Android Studio provides an easy to use GUI based tool but installs additional software on your computer. Using the command line tools is a smaller download and does not install additional software, but it can be more challenging to use.

1a. Install the Android SDK using the command line tools

Install or unpack the Android SDK. After installing, open the Android SDK Manager and add at least one Android SDK Platform, the Platform Tools, the Build Tools, and the USB drivers if you’re using Windows.

To install an Android platform SDK and the associated tools:

Unzip the tools folder to a location on your hard drive.

Open a command-prompt window.

Navigate to the bin folder in the location where you unzipped the tools folder:

install folder > tools > bin

Use the sdkmanager command line tool to retrieve the list of packages that you can install. The installable packages include the Platform SDKs, Build Tools, Platform tools, and other tools.

Select a version of the Platform SDK to install. Platform SDKs take the following form in the list: platforms;android-xx. The xx indicates the SDK level. The larger the number, the newer the package. Typically, you can install the latest available version. However, there might be cases where Google has released a new version of the SDK that causes errors when you build your Unity Project. In that case, you must uninstall the SDK and install an earlier version. The general format of the command for package installation is sdkmanager

. You can install the corresponding Platform Tools and Build Tools at the same time.

Example: sdkmanager “platform-tools” “platforms;android–27” “build-tools;27.0.3”

  1. If you are running on Windows, install the USB device drivers:

This installs the SDK to a directory named platforms in the same directory you unzipped the tools folder to.

c: \platforms

1b. Install the SDK using Android Studio

Install Android studio from the Android developer portal. The Android developer portal provides detailed installation instructions.

Note: Android Studio provides some ease of use benefits, but it is not fully tested for compatibility with Unity installs. If you encounter errors, Unity recommends using the command line method.

When installing the Android platform SDK and other tools, you can typically install the latest available version. There might be cases in which Google has released a new version of the SDK that causes errors when you build your Unity Project. In that case, uninstall the SDK and install an earlier version.

Install the associated Platform and Build tools at the same time. If you are running on Windows, install the USB device drivers.

2. Enable USB debugging on your device

To enable USB debugging, you must first enable Developer options on your device. To do this, find the build number in your device’s Settings menu. The location of the build number varies between devices; for stock Android, it’s usually in Settings > About phone > Build number. For specific information on your device and Android version, refer to your hardware manufacturer.

After you navigate to the build number using the instructions above, tap on the build number seven times. A pop-up notification saying “You are now X steps away from being a developer” appears, with “X” being a number that counts down with every additional tap. On the seventh tap, Developer options are unlocked.

Note: On Android versions prior to 4.2 (Jelly Bean), the Developer options are enabled by default.

Go to Settings > Developer options, then enable USB debugging. Android now enters debug mode when it is connected to a computer via USB.

Connect your device to your computer using a USB cable. If you are developing on a Windows computer, you might need to install the device-specific USB driver. See the manufacture website for your device for additional information.

The setup process differs for Windows and macOS and is explained in detail on the Android developer website. For more information on connecting your Android device to the SDK, refer to the Running Your App section of the Android Developer documentation.

3. Configure the Android SDK path in Unity

The first time you create a Project for Android (or if Unity later fails to locate the SDK), Unity asks you to locate the folder in which you installed the Android SDK.

If you installed the SDK using the sdkmanager, you can find the folder in \platforms .

If you installed the SDK when you installed Android Studio, you can find the location in the Android Studio SDK Manager. To open the SDK Manager from Android Studio, go to Tools > Android > SDK Manager or select SDK Manager in the toolbar.

To change the location of the Android SDK, in the Unity menu bar go to Unity > Preferences > External Tools.

4. Download and set up the Android NDK

If you are using the IL2CPP scripting backend for Android, you need the Android Native Development Kit (NDK). It contains the toolchains (such as compiler and linker) needed to build the necessary libraries and produce the output package (APK). If you are not targeting the IL2CPP backend, you can skip this step.

Download Android NDK version r16b (64-bit) from the NDK Downloads web page. Extract the android-ndk-r16b folder to a directory on your computer and note the location.

The first time you build a Project for Android using IL2CPP, Unity asks you to locate the folder in which you installed the Android NDK. Select the root folder of your NDK installation. To change the location of the Android NDK, in the Unity Editor, navigate to the menu: Unity > Preferences to display the Unity Preferences dialog box. Here, click External Tools.

Using an alternate Java Development Kit

Unity recommends that you use the JDK installed with the Android build tools, to ensure that you receive the correct version and configuration.

If you have manually installed the JDK and do not want to duplicate the installation, you can specify the location in the Unity Preferences window. To do this, go to Preferences > External tools and enter the directory path in the JDK field:

Preferences for Android external tools

Warning: The Android tools do not support JDK 9 or later; an alternate JDK must be version 8. Unity does not officially support versions of the JDK other than the one embedded in the Android Build Tools.

To change the JDK that Unity uses to build Android apps:

Open the Project.

In the left navigation column, select External Tools.

Uncheck JDK Installed with Unity (recommended).

In the JDK field enter the path to the JDK or use the Browse button to locate it.

2018–11–21 Page amended with editorial review

Источник

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