NDK Android path setup issue for version 19.0.5232133 on Mac OS - flutter

I'm trying to run a flutter project on Mac OS, which uses specific NDK version 19.0.5232133. This NDK version is manually downloaded in the path "/Users/user_name/Library/Android/sdk/ndk/19.0.5232133".
Issue 1 - Unable to clear cache of previously downloaded NDK version on Android Studio
Issue 2 - Execution fails

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 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

Error android:layout_marginEnd with appcompat v7 library

I got this error:
removing attribute http://schemas.android.com/apk/res/android:layout_marginEnd from <ImageView>
from the abc_activity_chooser_view.xml XML file when compiling the appcompat v7 library in my Android project.
Things I have tried:
Uninstall Eclipse Luna and Android SDK completely.
Re-install Eclipse Luna and Android SDK.
Install the require Android components via Android SDK Manager.
In Eclipse, ask Android Lint to ignore the error in Preferences and Skip Library Project Dependencies.
Clean and build all projects.
Add -clean directive to eclipse.ini file.
But without any success.
Tools I used are:
OS: Window 7 64-bit
IDE: Eclipse Luna Service Release 2 (v4.4.2) Build 20150219-0600
64-bit
Android SDK: Android v5.1.1 (API Level 22)
ADT: v23.0.6.1720515
Android SDK Tools: v24.1.2
Android SDK Platform Tools: v22
Android SDK Build Tools: v22.0.1
Android Support Repository: v12
Android Support Library: v22
Does anyone have any suggestion on how to fix, or workaround this error till Google fix this error?
I can't deploy my Android package until this error is fixed.
Thanks for any help.
To fix the android:layout_marginEnd error, within Eclipse, open the project.properties file within the appcompat v7 library and add the following directives:
target=android-21
sdk.buildtools=21.1.2
Note: You may need to install the Android SDK Build Tools v21.1.2 [if you haven't already] via the Android SDK Manager.
For those wishing to support Android 5.1+ (API 22) in your Android apps, you can add the following directives to the project.properties file of each of your Android project:
target=android-22
sdk.buildtools=22.0.1
Note: You may need to install the Android SDK Build Tools v22.0.1 [if you haven't already] via the Android SDK Manager.
So, in essence, you're using one version of the Android SDK Build Tools to build your Android apps, and another to fix the android:layout_marginEnd error in the appcompat v7 library.
The documentation for the sdk.buildtools directive is here. The documentation also include info on how to setup the buildToolsVersion directive in the build.gradle file for those using Android Studio and Gradle.