NativeScript Linux Setup (Install Android SDK Platform 28 packages) failed - nativescript

When following the official NativeScript installation for Linux (https://docs.nativescript.org/start/ns-setup-linux) you will get to Step 6: Install all packages for the Android SDK Platform 28.
If you just paste the mentioned command into the CLI like this:
sudo $ANDROID_HOME/tools/bin/sdkmanager "tools" "emulator" "platform-tools" "platforms;android-28" "build-tools;28.0.3" "extras;android;m2repository" "extras;google;m2repository"
It will fail with the following warrning:
Warning: Could not create settings
java.lang.IllegalArgumentException
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.<init>(SdkManagerCliSettings.java:428)
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.createSettings(SdkManagerCliSettings.java:152)
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.createSettings(SdkManagerCliSettings.java:134)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:57)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)

The solution is to add the following flag to the command --sdk_root=${ANDROID_HOME} after you have set the ANDROID_HOME environment variable at step 3 (https://docs.nativescript.org/start/ns-setup-linux).
This appears to be a bug with the way sdkmanager locates the SDK installation folder. The whole command then looks like this:
sudo $ANDROID_HOME/tools/bin/sdkmanager --sdk_root=${ANDROID_HOME} "tools" "emulator" "platform-tools" "platforms;android-28" "build-tools;28.0.3" "extras;android;m2repository" "extras;google;m2repository"

Related

How to install specific version of windows sdk using chocolatey?

I have C++ project with its target platform version type as 10.0.15063.0 and target platform as Windows 10.
I tried to create a azure pipeline that builds and publishes the artifacts, but I am facing issue to install windows sdk of specific version using choco(i.e 10.0.15063.x).
command tried :
choco install windows-sdk-10.0 --version=10.0.15063
I am getting error saying the package not found in the sources listed. Is there any way to fix the issue.
The version 10.0.15063.0 is not in the choco package list. As an alternative, you can download the installation from link, and install it via command.
Download bash command:
curl -LO "https://download.microsoft.com/download/E/1/B/E1B0E6C0-2FA2-4A1B-B322-714A5586BE63/windowssdk/winsdksetup.exe"
chmod 777 winsdksetup.exe # add permission for execution
Install in powershell silently:
Start-Process winsdksetup.exe -ArgumentList "/q" -Wait
Verify the version on my local machine:
However, the version number is strange, it shows 10.1.15063 actually in control panel.
So I can install it with choco command instead:
choco install windows-sdk-10.1 --version=10.1.15063.468 -y
Please check the version in regedit and control panel.
Doesn't look like that version is available. You can confirm this by searching for the package and listing all versions using choco list or choco search (search and list are synonyms for choco.exe):
choco list -a windows-sdk-10.0
Today, only one version is available: 10.0.26624. You can try to get the attention of the package maintainer on the package listing via the comments or Contact Maintainers link in the sidebar to update it or you can build your own and host on an internal feed for your use case.

(MacOS/homebrew) PANIC: Broken AVD system path. Check your ANDROID_SDK_ROOT value

installed:
brew cask install android-sdk
brew cask install android-platform-tools
brew cask install intel-haxm
export ANDROID_SDK_ROOT="/usr/local/share/android-sdk"
created emulator:
sdkmanager "system-images;android-27;google_apis;x86"
avdmanager create avd -n default --abi google_apis/x86 -k "system-images;android-27;google_apis;x86" -p ~/.android/avd/default
start emulator:
emulator -avd default
The message:
PANIC: Broken AVD system path. Check your ANDROID_SDK_ROOT value [/usr/local/share/android-sdk]!
this answer mentions platform/platform-tools folders must be in SDK_ROOT.
ls /usr/local/share/android-sdk
emulator licenses patcher system-images tools
What's wrong and why?
This was the missing part:
sdkmanager "platform-tools" "platforms;android-27"
That installs the missing parts of SDK. Error message could be better, of course.
Also not clear if the line below was even needed.
brew cask install android-platform-tools

How to solve Android Studio problems?

Hello I have installed in my Ubuntu Android Studio with the intention of using them SDK with React Native, Cordova, Phonegap, etc.
I have searched other questions on this site and tried the solutions they offered, but the result so far is that what I show next, after 10 days installing and testing I have decided to ask my question.
I made the installation according to the official page of Android Studio and in several ways, but I can not get it to work.
Now I have the installation of the following way, to avoid problems of permissions:
Copy the downloaded folder from Android Studio to /usr/local/
For the SDK I chose a folder in my personal folder /home/charly/Android/sdk/
Install the necessary libraries for 32-bit sudo apt-get install libc6: i386 libncurses5: i386 libstdc ++ 6: i386 lib32z1 lib32bz2-1.0
To run the Android Studio installer, I placed it in the Android Studio location in the bin folder using the terminal:
cd/usr/local/android-studio/bin
Execute: ./studio.sh
I edit the .bashrc file: sudo vim ~/.bashrc and add the following to the end of the file:
export PATH=${PATH}:/home/charly/Android/sdk/tools
export PATH=${PATH}:/home/charly/Android/sdk/platform-tools
Install:
sudo apt-get install lib32stdc ++ 6
sudo apt-get install lib32z1
When I run android sdk and android avd the answer is: Order «android» not found. When should I take the SDK Manager and AVD Manager, respectively.
Also, there is another problem and when executing printenv ANDROID_HOME the result of the console is: /opt/android-sdk/ And in this folder is not Android Studio.
When I try to run an Android application from React Native: react-native run-android I get an error:
S server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug) ...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ': app'.
> The SDK directory '/ opt / android-sdk' does not exist.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 0s
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/getting-started.html
Command failed: ./gradlew installDebug
Error: Command failed: ./gradlew installDebug
    at checkExecSyncError (child_process.js: 611: 11)
    at Object.execFileSync (child_process.js: 629: 13)
    at runOnAllDevices (/home/charly/proyec/App/node_modules/react-native/local-cli/runAndroid/runAndroid.js:299:19)
    at buildAndRun (/home/charly/proyect/App/node_modules/react-native/local-cli/runAndroid/runAndroid.js:135:12)
    at isPackagerRunning.then.result (/home/charly/proyect/App/node_modules/react-native/local-cli/runAndroid/runAndroid.js:65:12)
    at process._tickCallback (internal / process / next_tick.js: 68: 7)
How can I solve these problems?
Why does it tell me that SDKs do not exist in '/opt/android-sdk' if I set up .bashrc to say they are in home/charly/Android/sdk?
Maybe the question is extensive, but I want to explain the whole installation and they can see the mistakes I've made in this one.
Thank you
You need to set the ANDROID_HOME environment variable in one of your bash startup scripts. This is explained in detail elsewhere on Stackoverflow.
Alternatively, you could add a local.properties file to configure the SDK location.

dotnet: command not found in Mac

So I downloaded NET Core 2.1 SDK for mac and installed it. But when I run the dotnet command from terminal it throws -bash: dotnet: command not found error.
I am trying to use the dotnet new react to spin up a new .Net Core/React project.
How can I fix this? Thanks!
Make sure your macOS version meets the prerequisites
https://learn.microsoft.com/en-us/dotnet/core/macos-prerequisites?tabs=netcore2x
If it does, then after installing via the installer, in a new terminal run this command
ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/
Then try dotnet --version
hopefully that should work
EDIT:
You might need to add x64 like so:
ln -s /usr/local/share/dotnet/x64/dotnet /usr/local/bin/
Courtesy of Stan in the comments
For Mac M1
sudo ln -s /usr/local/share/dotnet/x64/dotnet /usr/local/bin/
If you add symbolic link to /usr/local/bin/ but you get file exist error.
You can delete the dotnet file at /usr/local/bin/
or
at you finder Shift + ⌘ Command + G and type /usr/local/bin/ , delete the dotnet file in finder.
For M1 and M2, make sure you are installing the Arm64 version -
Marcelo Gonella
Just another way how to successfully install dotnet on a Mac: using Homebrew, you can simply run:
brew install dotnet
to have it install. Advantages include automatic updates via brew upgrade and less to worry about permissions or any of the workarounds mentioned as solutions before me.
You can find the formula information here: https://formulae.brew.sh/formula/dotnet
You also need to download & install Runtime from here
If you are using the dotnet x64 installer for mac which can be found here , use this command
sudo su
ln -s /usr/local/share/dotnet/x64/dotnet /usr/local/bin/
I solved by editing ~/.zshrc
#Add .NET to $PATH
export PATH="/usr/local/share/dotnet:$PATH"
Run sudo ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/ in the command line, you then should be prompted for your password. This is the solution that worked for me on Mac OS Catalina.
.NET 6.x on MacOS I had to run with updated path
ln -s /usr/local/share/dotnet/**x64**/dotnet /usr/local/bin/
Run with sudo if you getting a permission error.
I solved it this way:
Add entry to .bash_profile
Before:
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/libexec:/opt/gradle/gradle-4.10.2/bin
After:
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/libexec:/opt/gradle/gradle-4.10.2/bin:/usr/local/share/dotnet
For Rider Users: If you are installed Rider and making development on it, dotnet must be installed on your machine.
For me, I can not found dotnet installation in specified locations; here or microsoft documentations. But Rider makes its own installation.
Go to Rider - Preferences - Buildy, execution, deploymend - Toolset and build and get the path of ".NET CLI executable path". This path specifies the path of sdk installation.
You can run the command below with location you found.
sudo ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/
If you are using mac with M1 (arm) make sure you install the Arm64 version and not the x64 version that you download by default

Alcatraz - Xcode Command Line Tools are not currently installed

I'm managing Xcode plug-ins via Alcatraz.
Everything was alright until I installed and then uninstalled Git following instruction in the uninstalled.sh file in official git.zip file:
sudo rm -rf /usr/local/git/ (in my case it's /usr/local/git/bin/git)
sudo rm /etc/paths.d/git
sudo rm /etc/manpaths.d/git
I have no idea what I've done with git would affect Alcatraz.
Once I click Package Manager in Xcode I get this error:
I found nothing to download in the Preference Download section,
and I did try to install the Command Line Tool following Xcode Command Line Tool tutorial
Here's how I verified it:
myMacBook-Air:~ me$ xcode-select -p
/Applications/Xcode.app/Contents/Developer
And even:
myMacBook-Air:~ me$ gcc --version
Configured with:--prefix=/Applications/Xcode.app/Contents/Developer/usr
--with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.0.0 (clang-700.0.72) Target: x86_64-apple-darwin14.5.0
Thread model: posix
The warning still pops up.
Did I fail to install the command line tool?
(or maybe it's not about the git but has something related to the Xcode 7 upgrade?)
How could I fix this?
This answer actually works,
looks like Alcatraz has something to do with git.

Resources