Unity 2022.1.20f1 Fresh Install - Missing NDK for Android - unity3d

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

Related

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 app could not locate aapt while building

When I was trying to build and run a flutter app it shows me the following message:
"Could not locate aapt. Please ensure you have the Android buildtools installed.
Exception: Problem building Android application: see above error(s)."
I already have both build tools and the android sdk installed, so I don't know what might have caused this issue.
Going into the folder where the android sdk is located and under the 'build-tools' delete everything inside it, then using android studio re install the build tools this will fix the issue
check in cmd flutter doctor
something like this will occur
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
X Android SDK file not found: C:\Users\aksha\AppData\Local\Android\sdk\build-tools\30.0.3\aapt.
problem is your sdk version 30.0.3 is not installed successfully
try to download it seperatelly from
https://androidsdkoffline.blogspot.com/p/android-sdk-build-tools.html?m=1
and unzip it and replace its contant with 30.0.3 at location C:\Users\aksha\AppData\Local\Android\sdk\build-tools\30.0.3
restart
done
For me the issue was resolved by running flutter doctor in cmd. The issue was accepting licenses. Running flutter doctor --android-licenses and then typing y for all licenses resolved the issue.
You can use this command flutter config --android-sdk after updating the android studio and can refer to the path from SDK manager
I was able to generate apk but I was also unable to install the apk in device I removed the error by following steps-
go to C:\Users\aksha\AppData\Local\Android\sdk\build-tools\30.0.3 (check show hidden items option)
delete this folder inside build-tools (because the error is not installed properly).
for resolving this issue, we have to uncheck all the latest plateforms (android (S)12 etc) and click apply after this restart the studio and check all these platforms again at least one latest and apply(ok).
Open Android Studio->files->Settings->Appearence & Behavior->System
Settings->Android SDK->SDK plateforms(Latest)
run flutter command to accept the licenses. (type Y then enter for all)
flutter doctor --android-licenses
all is done
It will be an Android Studio bug.
I updated Android Studio to the latest Beta version and fixed it.
I hope it will be of help to you too.
If you are using ubuntu check /home/username/Android/Sdk folder present or not, I think your sdk folder deleted or moved to new location. thats why this issue happen.
You must update your build tools of SDK by using SDK manager in android studio.
go to androidstudio->sdkmanager->sdktools->then update build tools
Delete uncompleted downloads in the "C:\Users\User\AppData\Local\Android\Sdk.downloadIntermediates" folder and reinstall the SDK build tools via the Android Studio's SDK manager.

Flutter doctor --android-license Module java.xml.bind not found

For mac I got issue with flutter config --android-studio-dir= is not a good path to my AndroidStudio Directory
I just type on my terminal to restart the path to AndroidStudio Directory
flutter config --android-studio-dir=
I found many peoples have problem with this and then with SDK manager
For SDK manager just included in SDK Tools in AndroidStudio all packages instead of NDK
if you include NDK then you will have a problem with build Android App

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

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.

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.