Visual Studio in OSX: Installing Android SDK Platform-Tools v26.0.0 failed - unity3d

I'm trying to compile to Android using Unity3D. The normal procedure is installing Android Studio. However I want to use Visual Studio Community (Preferences -> SDK Locations -> Android) to avoid downloading Android Studio because I do not plan to use it:
The rest of components seems to be installed well. However the Android SDK Platform-Tools installation outputs the following error:
Installing Android SDK Platform-Tools v26.0.0 failed
Could not find a
part of the path
"/Users/username/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/package.xml".
I have been able to install it after creating an empty folder named platform-tools manually. Unfortunately it seems it has not been installed correctly because the folder only contains one file named: package.xml of much less than 7 Mb. Unity also output the following error:
Android SDK is outdated
SDK Tools version 0.0.0 < 24.0.0.
Workarounds seem easy (both can be downloaded from here: https://developer.android.com/studio/index.html):
Install Android Studio: it seems the easier and quick way, but >500Mb HardDisk space
Install only command line tools: not so easy and quick
However I guess I'm very stubborn and curious: why could it be failing?

Hey mate for me it worked to create the missing folder manually.
So this folder:
/Users/username/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/
Is actually missing so if you do this:
$ cd /Users/username/Library/Developer/Xamarin/android-sdk-macosx/
$ mkdir platform-tools
And try to run the installer from VS UI
it should install the platform-tools package.
Complement from #benjamingranados:
Also check that the destiny folder in the "Locations" Tab is the same.

Related

Unity 2022.1.20f1 Fresh Install - Missing NDK for Android

I have re-installed Unity 2022.1.20f1 after I did an update.
However, I can no longer compile and Android Project for the Quest 2.
It reports Android NDK not found or invalid. Please, fix it in Edit/Unit->Preferences->External Tools.
Here it tells me I am missing the Android NDK with a fixed path of
C:\Program Files\Unity\Hub\Editor\2022.1.20f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK
And as you can see from the image below, There is no NDK folder.
I have re-installed it twice.
I installed another version of the Editor and the NDK folder does exist in it's respective location.
I have tried to use the NDK for the working Version but it reports anything other than 21.3.6528147 are not officially supported.
I am at my wits end and wondered if anybody else has had this issue?
Many thanks
Mark
Hello you need to install the android NDK separatly and then provide the new NDK folder path in the setting of Unity as well as the SDK of android folder path as well. You have 2 methodes to do so 1 : to just install install android studio with all the stuff I mentioned or 2: just install them one by one from the website NDK Installation
SDK Installation

Flutter doctor can't find Android SDK, but everything is set

I'm on Ubuntu 20.04 LTE
My Android SDK Location (shown in Android studio) is /home/myuser/Android/Sdk
The error goes as follows:
✗] 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, please use
`flutter config --android-sdk` to update to that location.
What I did to try to fix it:
Fresh installs of both Flutter (via snap) and Android studio (via apt, because when I install it also via snap, Flutter can't find even Android studio then).
Set configs:
flutter config --android-sdk="/home/myuser/Android/Sdk"
flutter config --android-studio-dir="/opt/android-studio-2021.1.1/android-studio"
Set paths in .bashrc:
export ANDROID_HOME=$HOME/Android/Sdk/
export PATH=$PATH:$ANDROID_HOME/tools/
export PATH=$PATH:$ANDROID_HOME/platform-tools/
In Android studio, I installed:
Dart and Flutter plugins.
SDK Platforms: 9.0(Pie), 10.0(Q), 11.0(R), 12.0(S), Android API 32
SDK Tools:
Android SDK Build-Tools 33-rc2
Android SDK Command-line Tools (latest)
Android Emulator 31.2.9
Android SDK PLatform-Tools 33.0.1
Trying to do flutter doctor --android-licenses doesn't do anything as it can't find Android SDK.
And I also can't run flutter doctor without adding sudo, because it stops after the first result and then runs for infinity.
Go to SDK tools and install all Support Repositories. Also check if there are any empty folders inside your SDK folder, if there are any empty folders, please delete them.Then follow the usual steps you mentioned,
Setting the config,
flutter config --android-sdk "/home/myuser/Android/Sdk"
Then finally run the flutter doctor again.
I use ubuntu too and the below is my environment.
Please try something like this in your vim ~./bashrc or vim ~/.zshrc
Change the paths as it is in your environment:
JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
export JAVA_HOME
export JRE_HOME
export PATH
export PATH=$PATH:~/development/flutter/bin
if it doesn't work try installing Flutter manually:
https://docs.flutter.dev/get-started/install/linux#install-flutter-manually
As the error message says, ANDROID_SDK_ROOT or previously known as ANDROID_HOME are not set in your environment variables.
To fix that, you will need to:
export ANDROID_SDK_ROOT=/path/to/android/studio/installation
export ANDROID_HOME=/path/to/android/studio/installation
export PATH=$PATH:/path/to/android/studio/installation
Due to some legacy reasons, there are a few variables pointing to the same thing. To make sure your Flutter SDK is getting it, you can set all of them.
Note: if you don't want to set them every time your laptop reboots, feel free to add them into ~/.bashrc.
Theoretically, during the installation of Android Studio, the variables above should be set for you, but, in reality, it doesn't always happen which is the reason you are seeing the error message.
Not sure but maybe the problem is caused by snap, since it was sandboxing the applications you install. I remember having a problem like this on something different. You can try installing flutter manually (downloading the zip and so on...) rather than using snap.

Flutter SDK Is Not Found In The Specified Location

I'm extremely frustrated right now after I updated Android Studio to have the latest Flutter and Dart Plugins. Now it tells me "No FLutter SDK configured" and when I give it the SKD path it just says, "Flutter SDK Is Not Found In The Specified Location." The Dart plugin works fine.
I have looked for an answer for hours and nothing works. I've downloaded the NDK, flutter doctor works perfectly, and I've tried set the SDK path to pretty much every file inside my flutter folder (inside /Documents).
Any tips?
Go to - Configure -> Tools > SDK Manager > Android SDK > SDK Tools, and search for flutter. You will get flutter SDK for Android.
If you are using Visual studio, also install plugins for flutter in Visual Studio.
» Steps:
Download Flutter SDK: Here
Extract Flutter:
tar xf ~/Downloads/flutter_linux_v1.7.8+hotfix.4-stable.tar.xz
Path export for particular terminal:
export PATH="$PATH:`pwd`/flutter/bin"
Permanent Path export:
Open bashrc file: Go to home directory terminal -> nano ~/.bashrc
Write at end of file:
export PATH=" [PATH_Where_Flutter SDK Extracted] /flutter/bin:$PATH"
example: export PATH="/home/sid/0_aaa_iauro/Flutter/s/flutter/bin:$PATH"
Run the following command to see if there are any dependencies you need to
install to complete setup:
flutter doctor -v
Add Flutter extension to vs-code.
Locate Flutter SDK.
Make New project in flutter:
flutter create Project_name
» Important Links:
Linux Install
Getting Started with Flutter on Linux for Android [Beginner Tutorial]
How To Install And Setup Flutter On Ubuntu 18.04.1 LTS (Bionic Beaver)
Part 2-A: Install Flutter in Windows – Step by Step Guide
Check for path variable (bashrc file):
Flutter – Step by Step Installation on Linux – Ubuntu
If you are using a fresh new Android Studio install as me, try installing missing packages for SDK support in Android Studio as described here: https://ladwhocodes.blogspot.com/2019/02/fix-flutter-sdk-not-found-in-specified-location.html
Go to Menu > Tools > SDK Manager > Android SDK (left side of the dialog) > SDK Tools (tab).
Select 'Support Repository' and 'NDK' checkboxes.
Click OK.
It will prompt you to install some dependencies. Install them.
What happen to me was because there is a space in my android sdk path (which is my username). I copy to C:\android\sdk and problem gone. Probably the space cause issue to NDK thus affect to Flutter sdk.
in my case, it was caused by local changes to the flutter git repo. On command line, everything worked, but in Android Studio it failed to detected the flutter sdk which caused all flutter commands to fail (even though flutter bin dir is in my path). The local changes were probably caused by trying out the beta version of flutter and returning to stable afterwards.
solution: delete flutter dir and redownload (I actually reverted all changes using the git clean command)

Run react-native on android emulator

I try to run react-native app on genymotion android emulator on my mac.
When I write react-native run-android It gets
Running /usr/local/opt/android-sdk/platform-tools/adb reverse tcp:8081 tcp:8081
error: closed
Could not run adb reverse: Command failed: /usr/local/opt/android-sdk/platform-tools/adb reverse tcp:8081 tcp:8081
Building and installing the app on the device (cd android && ./gradlew installDebug...
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
MacBook-Pro-MacBook:ART-CarefulPeople macbook$
Then I've tried:
react-native start
react-native run-android
The same result.
Then I've tried:
react-native bundle --entry-file index.android.js --platform android --bundle-output android/app/src/main/assets/index.android.bundle
curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"
react-native run-android
The same result.
I've tried just adb reverse tcp:8081 tcp:8081 and it says error: closed
When I try to run app on android-sdk emulator it gets the same error above but without error: closed.
From android studio I can run this app and it works on genymotion.
Tell me please what should I do to run my app on android emulator?
I had a similar problem, and after spending so much time and lots of searching about this issue the only trick worked for me:
Please Install the Required SDKs as shown in this figure
Configure Required SDKs
If You have already installed it, so you must have to update the following SDKs:
Android SDK Tool (update it to latest version)
Android SDK Platform-tools (update it to latest version)
Android SDK Build-tools (update it to latest version)
Android Support Repository under Extra folder (update it to latest version)
You Must have at least Installed the Same version Android API as the installed Android SDK Build-tools & Android SDK Platform-tools version as shown in the Configure Required SDKs figure above.
Note: Local Maven repository for Support Libraries which is listed as the SDK requirement in the official docs of React-native is now named as Android Support Repository in the SDK Manager .
On macOs I manage to fix this by adding:
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
to ~/.zsh_profile file.
and than type to your terminal
source $HOME/.zsh_profile
The issue was caused by using iTerm2 shell so it's required to edit its own config instead of default $HOME/.bash_profile as described in the official documentation https://reactnative.dev/docs/environment-setup
React Native (On Mac OS Big SUR)
i was stuck here. But updating the environment settings for Android studio did the trick.
nano ~/.zshrc
and paste
export ANDROID_SDK_ROOT=$HOME/Library/Android/sdk
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator:$PATH
export PATH=$PATH:$ANDROID_HOME/tools:$PATH
export PATH=$PATH:$ANDROID_HOME/tools/bin:$PATH
export PATH=$PATH:$ANDROID_HOME/platform-tools:$PATH
export JAVA_HOME=$(/usr/libexec/java_home)
control + o to save
then enter
then control + x to exit
then do
source ~/.zshrc to compile
kill the runnig terminals and run
npx react-native run-android
You can also try use "doctor" command. It will fix most cases.
npx #react-native-community/cli doctor
I had similar issue running emulator from android studio everytime, or on a physical device. Instead, you can quickly run android emulator from command line,
android avd
Once the emulator is running, you can check with adb devices if the emulator shows up.
Then you can simply use
react-native run-android to run the app on the emulator.
Make sure you've platform tools installed to be able to use adb. Or you can use
brew install android-platform-tools
It happened to me that I had an instance of the packager running with an old project (I ran react-native start as usual). I was using Ubuntu 14.04. So what I did was to stop that instance and go to my project folder and in two different console tabs I ran these two commands separately:
npm start #here I used to run react-native start
react-native run-android
npm start is defined in my package.json as:
"start": "node_modules/react-native/packager/packager.sh"
I don't know if there is a sort of confusing stuff for react-native but that did the trick.
On Windows 10 and Android Studio you can go in Android Studio to "File"->"Settings" in Settings then to "Appearance & Behavior" -> "System Settings" -> "Android SDK".
In the Tab "SDK Tools" active:
"Android SDK Build-Tools .."
"Android Emulator"
"Android SDK Plattform-Tools"
"Android SDK Tools"
If all installed then you can start the Emulator in Android Studio with "Tools" -> "Android" -> "AVD Manager".
If the Emulator run you can try "react-native run-android"
If emulator not installed then try this command, (if homebrew installed)
brew install android-platform-tools
might be it will help.
Had a similar problem. I updated my Genymotion and my android SDK's/libraries/dependencies and all seemed to work. To update my SDK's I used android sdk manager {ANDROID_SDK_FOLDER}/tools/android sdk
In my case, there was an issue with the android/gradlew file. I think this happens when we move the code from Windows to Mac OS.
Reference:- https://stackoverflow.com/a/62216646/4786087
I was able to clean the android/gradlew file by running the following commands -
Step 1. On android folder cmd run
chmod +x gradlew
Step 2. After that run
./gradlew clean
Step 3. Next in the root of the project, run
react-native run-android
This should start building the app and launch it in the simulator if everything else is fine.
Try
brew cask install android-platform-tools
adb reverse tcp:9090 tcp:9090
run the app
In my case, this was happening because the android/gradlew file did not have execute permission. Once granted, this worked fine
You probably haven't run the Android SDK in forever.
So you probably just have to update it.
If you open the Android Studio Software it'll probably let you know that and ask to update it for you. Otherwise refer to following link: Update Android SDK

Android studio:import NDK project from eclipse

I exported project from Eclipse(windows) and imported it to android studio V 0.4.2(ubuntu).
The project include working NDK library.
I get this error when try to run my app:
Execution failed for task ':app:compileDebugNdk'.
NDK not configured
From others stackoverflow posts, I understand that it is an issue.
But get no workaround for this.
Should i proceed the development with eclipse for now, or is that the a lazy option ?
EDIT :
I run this command:
export NDK=~/Downloads/android-ndk-r9c
and then :
and then go to my app directory and run this:
ndk-build
And i get this:
yarinkos-u#yarinkosu-MSI-Notebook-EX600:~/AndroidStudioProjects/AndEngineEXperimental$ ndk-build
/home/yarinkos-u/Downloads/android-ndk-r9c/ndk-build: 1: /home/yarinkos-u/Downloads/android-ndk-r9c/ndk-build: dirname: not found
/home/yarinkos-u/Downloads/android-ndk-r9c/ndk-build: 132: /home/yarinkos-u/Downloads/android-ndk-r9c/ndk-build: uname: not found
ERROR: Unknown host operating system:
What i did wrong?
It seems that the script running,but i miss something there.
EDIT 2:
i mistakenly runing this also :
export PATH=~/Downloads/android-ndk-r9c
so i get the error above.
If i running onlt this :
export NDK=~/Downloads/android-ndk-r9c
I get ndk-build not found error.
NDK Support is introduced from Android Studio 0.4.1 only, so make sure you are running AS 0.4.1 or above.
Android gradle plugin must be 0.7.+ in build.gradle file and also new NDK integration requires NDK r9c .
Lines from Developer tools blog under Release 0.4.1
Supports importing NDK projects. If the imported project contains NDK
sources, these are imported into the jni/ source set of the project,
the module name is inferred from the Makefile and stored in the Gradle
file, and the ndk.dir property is defined in local.properties.
Check more about it here :
http://tools.android.com/recent
you need to download the NDK for your operatings system # https://developer.android.com/tools/sdk/ndk/index.html once it's downloaded, install it it'll extract the contents to the correct file system it needs to be in it'll take some time, also make sure you are running the latest android studio. it worked for me. good luck.