I downloaded Command line tools via the following link, but encounters this error when running sdkmanager:
https://developer.android.com/studio
Where do the bugs come from, because other bats run without bugs.
PS C:\Android> sdkmanager --version
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)
Usage:
sdkmanager [--uninstall] [<common args>] [--package_file=<file>] [<packages>...]
sdkmanager --update [<common args>]
sdkmanager --list [<common args>]
sdkmanager --licenses [<common args>]
sdkmanager --version
Related
I've got a project that is working fine in windows os but when I switched my laptop and opened an existing project in MacBook Pro M1. I'm unable to run an existing android project in MacBook pro M1. first I was getting
Execution failed for task ':app:kaptDevDebugKotlin'. > A failure
occurred while executing
org.jetbrains.kotlin.gradle.internal.KaptExecution >
java.lang.reflect.InvocationTargetException (no error message)
this error was due to the Room database I applied a fix that was adding below library before Room database and also changed my JDK location from file structure from JRE to JDK.
kapt "org.xerial:sqlite-jdbc:3.34.0"
//Room components
kapt "org.xerial:sqlite-jdbc:3.34.0"
implementation "androidx.room:room-ktx:$rootProject.roomVersion"
kapt "androidx.room:room-compiler:$rootProject.roomVersion"
androidTestImplementation "androidx.room:room-testing:$rootProject.roomVersion"
after that now I'm getting an issue which is Unknown host CPU architecture: arm64
there is an SDK in my project that is using this below line.
android {
externalNativeBuild {
ndkBuild {
path 'Android.mk'
}
}
ndkVersion '21.4.7075529'
}
App Gradle
externalNativeBuild {
cmake {
path "src/main/cpp/CMakeLists.txt"
version "3.18.1"
//version "3.10.2"
}
}
[CXX1405] error when building with ndkBuild using
/Users/mac/Desktop/Consumer-Android/ime/dictionaries/jnidictionaryv2/Android.mk:
Build command failed. Error while executing process
/Users/mac/Library/Android/sdk/ndk/21.4.7075529/ndk-build with
arguments {NDK_PROJECT_PATH=null
APP_BUILD_SCRIPT=/Users/mac/Desktop/Consumer-Android/ime/dictionaries/jnidictionaryv2/Android.mk
APP_ABI=arm64-v8a NDK_ALL_ABIS=arm64-v8a NDK_DEBUG=1
APP_PLATFORM=android-21
NDK_OUT=/Users/mac/Desktop/Consumer-Android/ime/dictionaries/jnidictionaryv2/build/intermediates/cxx/Debug/4k4s2lc6/obj
NDK_LIBS_OUT=/Users/mac/Desktop/Consumer-Android/ime/dictionaries/jnidictionaryv2/build/intermediates/cxx/Debug/4k4s2lc6/lib
APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n} ERROR:
Unknown host CPU architecture: arm64
which is causing this issue and whenever I comment on this line
path 'Android.mk'
it starts working fine, is there any way around which will help me run this project with this piece of code without getting this NDK issue?
Update - It seems that Room got fixed in the latest updates, Therefore you may consider updating Room to the latest version (2.3.0-alpha01 / 2.4.0-alpha03 or above)
use ndkVersion "24.0.8215888" update ndk to this version and no need to edit any script :)
GitHub Issue Tracker
solved this issue.
Finder -> Go To Folder(/Users/mac/Library/Android/sdk/ndk/21.4.7075529)
-> now edit ndk-build open it in text editor and paste below code script and re-run your project.
from
#!/bin/sh
DIR="$(cd "$(dirname "$0")" && pwd)"
$DIR/build/ndk-build "$#"
to
#!/bin/sh
DIR="$(cd "$(dirname "$0")" && pwd)"
arch -x86_64 /bin/bash $DIR/build/ndk-build "$#"
Reference Link
To solve this on a Apple Silicon M1 I found three options
A
Use NDK 24
android {
ndkVersion "24.0.8215888"
...
}
You can install it with
echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install 'ndk;24.0.8215888'
or
echo "y" | sudo ${ANDROID_HOME}/sdk/cmdline-tools/latest/bin/sdkmanager --install 'ndk;24.0.8215888'
Depending what where sdkmanager is located
B
Change your ndk-build to use Rosetta x86. Search for your installed ndk with
find ~ -name ndk-build 2>/dev/null
eg
vi ~/Library/Android/sdk/ndk/22.1.7171670/ndk-build
and change
DIR="$(cd "$(dirname "$0")" && pwd)"
$DIR/build/ndk-build "$#"
to
DIR="$(cd "$(dirname "$0")" && pwd)"
arch -x86_64 /bin/bash $DIR/build/ndk-build "$#"
C
convert your ndk-build into a cmake build
I am trying to build a kivy apk and I keep getting this error, " Build failed: Android SDK dir was not specified, exiting.". What do I need to do to fix it?
and when i run:
python3 -m pythonforandroid.toolchain create --dist_name=simpleapp --bootstrap=sdl2 --requirements=python3,kivy,android --arch armeabi-v7a --copy-libs --color=always --storage-dir="/home/haryo/kivy-game-2.0/.buildozer/android/platform/build" --ndk-api=21
i get:
[INFO]: Will compile for the following archs: armeabi-v7a
[ERROR]: Build failed: Android SDK dir was not specified, exiting.
You need to...specify the sdk dir. Use the --sdk-dir=... argument to pass the path to the Android SDK.
You'll also need to do the same for the NDK.
I want to execute the following command
bundle install && rake install
but an error comes up and I try to figure out whats going on. I found that i need to install nokogiri. But when I try to install it an error comes up again. Any ideas? :/
sudo gem install nokogiri -v '1.8.5'
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.5.0/gems/nokogiri-1.8.5/ext/nokogiri
/usr/bin/ruby2.5 -r ./siteconf20181210-12550-orku3c.rb extconf.rb
checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
Using mini_portile version 2.3.0
checking for gzdopen() in -lz... no
zlib is missing; necessary for building libxml2
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/$(RUBY_BASE_NAME)2.5
--help
--clean
--use-system-libraries
--enable-static
--disable-static
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--enable-cross-build
--disable-cross-build
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/nokogiri-1.8.5/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /var/lib/gems/2.5.0/gems/nokogiri-1.8.5 for inspection.
Results logged to /var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/nokogiri-1.8.5/gem_make.out
I am getting error for tsc -w command in VS Code integrated terminal. But I am able to run it from NodeJs Command promopt.
`error TS5023: Unknown option 'w'
Use the '--help' flag to see options.
Version 1.0.3.0
Syntax: tsc [options] [file ..]
Examples: tsc hello.ts
tsc --out foo.js foo.ts
tsc #args.txt`
just delete old versions from path C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0 or desired v, then just tsc --version from terminal
I'm trying to build gnome-weather using jhbuild, but running build process results in the following errors:
checking for python extension module directory... ${exec_prefix}/lib64/python2.7/site-packages
checking for headers required to compile python extensions... ./configure: line 14697: /usr/local/bin/python-config: No such file or directory
not found
configure: error: Python headers not found
*** Error during phase configure of gobject-introspection: ########## Error running ./autogen.sh --prefix /home/pgolinski/jhbuild/install --disable-static --disable-gtk-doc *** [7/36]
[1] Rerun phase configure
[2] Ignore error and continue to build
[3] Give up on module
[4] Start shell
[5] Reload configuration
[6] Go to phase "wipe directory and start over"
[7] Go to phase "clean"
[8] Go to phase "distclean"
Strangely the error says that Python headers were not found even though I have python-devel installed. I managed to find python-config in usr/bin so how to change its directory for configure? Or maybe the problem lies elsewhere? (I just want to build gnome-weather)
you can download the last version of gnome-weather here:
https://git.gnome.org/browse/gnome-weather/snapshot/gnome-weather-3.14.1.zip
and compile that with these command after unzip it:
libtoolize
aclocal
autoheader
autoconf
automake --add-missing --foreign
./configure
make && make install
this should work.8y3
Here's what finally worked for me if someone struggles with something similair in future:
PYTHON=/usr/bin/python jhbuild build gnome-weather