Mac Os ANDROID_NDK not set - android

I am trying to run the sample project of the following project: https://github.com/Shopify/react-native-skia
When I try to start it it gives me the following error message, it says ANDROID_NDK not set.
As you can see from the image android ndk is installed.
Where am I doing wrong?

From the README.md in this GitHub-project:
If you have Android Studio installed, make sure $ANDROID_NDK is available. ANDROID_NDK=/Users/username/Library/Android/sdk/ndk-bundle for instance.
If the NDK is not installed, you can install it via Android Studio by going to the menu File > Project Structure And then the SDK Location section. It will show you the NDK path, or the option to Download it if you don't have it installed.
So it seems that you need to create a environment variable called ANDROID_NDK which points to your NDK-installation.
Since I use Android NDK for my current project, I know this isn't setup automatically.
Environment variables on MacOS: https://support.apple.com/guide/terminal/use-environment-variables-apd382cc5fa-4f58-4449-b20a-41c53c006f8f/mac

Related

Cordova fails to find ANDROID_HOME environment variable

I looked all over Google and Stack Overflow for an answer, but I couldn't find the right one for me. I am learning Cordova and I'm trying to run the android emulator through terminal, and when I run 'sudo cordova emulate android' I get this message:
''Failed to find 'ANDROID_HOME' environment variable. Try setting it manually.
Detected 'avdmanager' command at /Users/username/Library/Android/sdk/cmdline-tools/latest/bin but no 'tools/bin' directory found near.
Try reinstall Android SDK or update your PATH to include valid path to SDK/tools/bin directory.''
But I set the variables in the ~./bash_profile file and it looks like this:
export ANDROID_HOME="/Users/username/Library/Android/sdk"
export ANDROID_SDK_ROOT=$ANDROID_HOME
export PATH=${PATH}:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools
export PATH=${PATH}:$ANDROID_HOME/tools/bin
export PATH="$PATH:$ANDROID_HOME/build-tools/30.0.0-rc2"
I am using a MacOS Mojave, does anyone know what the issue is?
Thanks in advance
Apparently, in the latest version of Android Studio, the old SDK tools (under /tools, which Cordova seems to expect) are already considered obsolete. There is a solution documented here on how to install the old version of SDK tools.
Open Android Studio
Open Tools -> Sdk Manager
Click on the Sdk Tools Tab
Uncheck Hide Obsolete Packages
Check Android Sdk Tools (Obsolete)
Click Apply
This should download the old SDK tools under the correct folder.
However, I think Cordova also needs to keep up with the newest Android development tools. There's another change I needed to make after this:
I had to delete the tools/emulator and tools/emulator-check binaries, and add $ANDROID_HOME/emulator to my $PATH, since the current emulator binary lives under emulator/emulator instead of path/emulator. See this post.
Then I was finally able to launch the app directly via Cordova.

How to fix 'Android SDK not found at this location' error while installing flutter?

I'm installing flutter in my Ubuntu 18.10. I'll be using Visual Studio Code for flutter development. I've not installed Android Studio.
I've downloaded Android Command line tools from official android site and extracted it in a separate folder in Documents/development/android
I set the path for ANDROID_HOME in the bashrc file by following the flutter documentation
Here is the .bashrc file
And the Android toolchain error
It seems that , you set the ANDROID_HOME variable but it is not added to PATH.
Make sure you add the ANDROID_HOME to the path as below
export PATH=$PATH:$ANDROID_HOME/bin
and re-launch the console.
update
In order for Android SDK to work fine, you need to set path for the below SDK packages.
..android-sdk\tools
..android-sdk\platform-tools
and your ANDROID_HOME will be
..android-sdk
I am not sure what you are referring to when you are saying that you have downloaded Android Command Line tools. From the output in your terminal, it tells me that you do not have the SDK files in your machine. To download the Android SDK, please see this link here and download the tar file that matches your operating system. Then extract the tar file in the folder which you have set as ANDROID_HOME. This should work fine.
In case you are having the same error, I strongly recommend downloading the Android Studio and install the Android SDK through the Android Studio. The flutter documentation says so as well. You can always uninstall or remove Android Studio after it is being installed and if you are not considering using it.
please replace yout android sdk in thatway this is default installation location of sdk C:\Users\Intel\AppData\Local\android\android_sdk

Unable to locate the Android SDK

I already had Android Studio and the Android SDK installed. I later added Flutter and the Flutter SDK. Here is my problem: When I run
flutter doctor
It shows,
that I do not have the Android SDK installed.
You can configure the Android SDK for your project using
flutter config --android-sdk /path/to/android/sdk
The PATH variable also should contain the SDK, like
export PATH=$PATH:/usr/local/opt/android-sdk/emulator:/usr/local/opt/android-sdk/build-tools/26.0.1:/usr/local/opt/android-sdk/platform-tools:/usr/local/opt/android-sdk/tools
/usr/local/opt/android-sdk and 26.0.1 might not match your system. That's just an example.
Step-by-step guidance for Windows with pictures
Step 1.
If you see this error, it means Flutter does not locate your Android SDK.
There are two folders containing all files of the "Android SDK". They are "Platform" and "Platform Tools":
Those folders are located in my computer here:
C:\Users\ZohaibSaleem\AppData\Local\Android\Sdk
(My name is Zohaib Saleem, and you should replace my username folder name with your computer username.)
Step 2
Type "Env" in the search bar of Windows
Click on "System Variable Environment"
Click on "Advanced and Environment Variable"
Go to System Variable → Path → Edit:
Now paste the path of both folder "platform" and "platform-tools", respectively.
In my case, the paths are:
C:\Users\ZohaibSaleem\AppData\Local\Android\Sdk\platforms
C:\Users\ZohaibSaleem\AppData\Local\Android\Sdk\platform-tools
After adding the path to your System variable it looks like:
Click OK
Restart PowerShell and again run the command "flutter doctor".
Now, the Android SDK problem is resolved, but you faced another problem:
To resolve this issue, just run the command
flutter doctor --android-licenses
And accept all with "Y". At the end, after typing multiple 'Y's, again run 'flutter doctor' and all is set!
flutter config --android-sdk /your path
example
flutter config --android-sdk /root/Android/Sdk
Tools > SDK Manager > Android SDK
images
Locate the Android SDK folder (e.g., D:\SDK).
Add platforms (D:\SDK\platforms) and platform-tools (D:\SDK\platform-tools) to the PATH variable.
Run flutter doctor. It should not show any errors or warnings.
For this issue you have to add three variables to the Path in the:
C:\Users\admin\AppData\Local\Android\platforms // The path to
platform
C:\Users\admin\AppData\Local\Android\platform-tools //
The path to platform-tool
C:\Users\Admin\AppData\Local\Android\emulator // The path to
emulator

How do I setup Cordova?

I am having some problems with getting started with my first Cordova app in Visual Studio.
When I create a new Cordova Project, I am presented with a page that says:
We've detected issues with your system's environment configuration
And it lists 3 things that need to be installed:
Android SDK The software is missing from your system. You may also have to configure it after installation. Instructions
Apache Ant The software is missing from your system. You may also have to configure it after installation. Instructions
Git CLI The software is missing from your system. You may also have to configure it after installation. Instructions
I already have the Android SDK installed. So how can I let Visual Studio know where it is? A search for this on Google did not yield any results that were related.
Searching for Git CLI did not yield any results. How do I install this?
I haven't even tried installing Apache Ant yet because I can't get past the other two.
How can I install Git CLI and how do I let VS know where my Android SDK is located?
P.S. I am aware that each of those list items has an 'instructions' link, however, I am unable to access those pages, they say "Webpage is not accessible" in Chrome, Firefox and IE (and Spartan).
I guess you have already installed Tools for Apache Cordova.
Once you did that and you can't install them with the tool, download them manually in their official websites. You can then add the path for these items in :
Tools > Options > Tools for Apache Cordova > Environment Variables
Here is a screen of mine :
I hope it helps
Not sure these are solutions, but something to check for:
If you're using VS2013, ensure you have update 4. Visual Studio Tools for Cordova only relies runs on VS 2013 and 2015.
Of course, ensure you have the latest Tools for Cordova CTP 3.1 (http://www.microsoft.com/en-us/download/details.aspx?id=42675)
In my system path, I have C:\Program Files (x86)\Android\android-sdk\platform-tools. I have ANT_HOME as a system/environment variable set to C:\apache-ant-1.9.3. I have ADT_HOME as a system/environment variable set to C:\Program Files (x86)\Android\android-sdk. I have GIT_HOME set to C:\Program Files (x86)\Git.
Setup your PATH environment variable on Windows
From the Desktop, right-click My Computer and click Properties.
Click Advanced System Settings link in the left column.
In the System Properties window click the Environment Variables button.
Select the PATH variable from the System variables section.
Select the Edit button.
You need to add the path to your Android SDK platform-tools and tools directory. In my example I will use "C:\Development\android-sdk-windows" as the directory the SDK is installed in. Append the following text into the text box:
;C:\Development\android-sdk-windows\platform-tools;C:\Development\android-sdk-windows\tools
Save your edit. Close the Environment Variables dialog.
Additionally, you may need to include %JAVA_HOME%\bin to your PATH as well. To check to see if this is required, run a command prompt and type java. If the program can not be found add %JAVA_HOME%\bin to the PATH. You may need to specify the full path instead of using the %JAVA_HOME% environment variable.
Finally, you may need to include %ANT_HOME%\bin to your PATH as well. To check to see if this is required, run a command prompt and type ant. If the program can not be found add %ANT_HOME%\bin to the PATH. You may need to specify the full path instead of using the %ANT_HOME% environment variable.

could not find adb:do you have android sdk installed and the tools + platform-tools folders added to your PATH?

Actually I have set the path in Environment variables.
By adding new path like ANDROID_HOME and value set to D:\adt-bundle-windows-x86-20140702\sdk
and in systems variables I have edited the path as PATH and the value set to D:\adt-bundle-windows-x86-20140702\sdk\tools\;D:\adt-bundle-windows-x86-20140702\sdk\platform-tools\
When I run the web driver script using junit I am getting the following error
A new session could not be created. (Original error:could not find adb:do you have android sdk installed and the tools + platform - tools folders added to your PATH?)
I have created script in web-driver using JUnit and I have launched emulator. And I have started appium server. I am not getting any error in my coding.
Please help me in resolving this issue.
Do you have adb under platform-tools or tools? check if that is true.
For ex: in mac os if you dl the standalone sdk you do not get a proper build and you have to update your platform tools/tools.
You can open your sdk manager and choose to update your platform tools/tools/build tools if you happen to have an empty/incomplete version of either.
Hope that resolves your issue.

Categories

Resources