目的
UbuntuでAndroidSDKのsdkmanagerを実行したい。
(→ python-for-androidを実行したい。)
前回質問で解決したと思ったのですが私の思い違いでした。
すみません。
前回の経緯(まとめと詳細追記)
- python-for-androidと依存関係のインストール
- AndroidNDK,SDKのダウンロード、インストール
/opt/android-sdk
下にtools
を配置
sudo /opt/android-sdk/tools/bin/sdkmanager --list
を実行するとエラーが発生
sudo /opt/android-sdk/tools/bin/sdkmanager 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 With --install (optional), installs or updates packages. By default, the listed packages are installed or (if already installed) updated to the latest version. With --uninstall, uninstall the listed packages. <package> is a sdk-style path (e.g. "build-tools;23.0.0" or "platforms;android-23"). <package-file> is a text file where each line is a sdk-style path of a package to install or uninstall. Multiple --package_file arguments may be specified in combination with explicit paths. With --update, all installed packages are updated to the latest version. With --list, all installed and available packages are printed out. With --licenses, show and offer the option to accept licenses for all available packages that have not already been accepted. With --version, prints the current version of sdkmanager. Common Arguments: --sdk_root=<sdkRootPath>: Use the specified SDK root instead of the SDK containing this tool --channel=<channelId>: Include packages in channels up to <channelId>. Common channels are: 0 (Stable), 1 (Beta), 2 (Dev), and 3 (Canary). --include_obsolete: With --list, show obsolete packages in the package listing. With --update, update obsolete packages as well as non-obsolete. --no_https: Force all connections to use http rather than https. --proxy=<http | socks>: Connect via a proxy of the given type. --proxy_host=<IP or DNS address>: IP or DNS address of the proxy to use. --proxy_port=<port #>: Proxy port to connect to. --verbose: Enable verbose output. * If the env var REPO_OS_OVERRIDE is set to "windows", "macosx", or "linux", packages will be downloaded for that OS.
#------bashrc 末尾に追記 # python for android #export ANDROIDSDK="/opt/android-sdk" export ANDROIDSDK="$HOME/Documents/android-sdk" export ANDROIDNDK="$HOME/Documents/android-ndk-r21" export ANDROIDAPI="27" export NDKAPI="21" export ANDROIDKVER="r10e" # android sdk path #export ANDROIDSDK="/opt/android-sdk" export ANDROID_HOME="$HOME/Documents/android-sdk" export PATH=$PATH:$ANDROID_HOME/tools export PATH=$PATH:$ANDROID_HOME/platform-tools
#--------bash_profileに追記 # Android SDK Tools #if [ -d "/opt/android-sdk/tools/bin" ]; then # export PATH=$PATH:/opt/android-sdk/tools/bin if [ -d "$HOME/Documents/android-sdk/tools/bin" ]; then export PATH=$PATH:$HOME/Documents/android-sdk/tools/bin fi
sudo apt-get install android-sdk
を実行python-for-android recipes
を実行
sudo /opt/android-sdk/tools/bin/sdkmanager [sudo] ubun のパスワード: 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 With --install (optional), installs or updates packages. By default, the listed packages are installed or (if already installed) updated to the latest version. With --uninstall, uninstall the listed packages. <package> is a sdk-style path (e.g. "build-tools;23.0.0" or "platforms;android-23"). <package-file> is a text file where each line is a sdk-style path of a package to install or uninstall. Multiple --package_file arguments may be specified in combination with explicit paths. With --update, all installed packages are updated to the latest version. With --list, all installed and available packages are printed out. With --licenses, show and offer the option to accept licenses for all available packages that have not already been accepted. With --version, prints the current version of sdkmanager. Common Arguments: --sdk_root=<sdkRootPath>: Use the specified SDK root instead of the SDK containing this tool --channel=<channelId>: Include packages in channels up to <channelId>. Common channels are: 0 (Stable), 1 (Beta), 2 (Dev), and 3 (Canary). --include_obsolete: With --list, show obsolete packages in the package listing. With --update, update obsolete packages as well as non-obsolete. --no_https: Force all connections to use http rather than https. --proxy=<http | socks>: Connect via a proxy of the given type. --proxy_host=<IP or DNS address>: IP or DNS address of the proxy to use. --proxy_port=<port #>: Proxy port to connect to. --verbose: Enable verbose output. * If the env var REPO_OS_OVERRIDE is set to "windows", "macosx", or "linux", packages will be downloaded for that OS.
前回はこれで解決したと思っていたのですが、
そもそもsdkmanagerと関係ありませんでした。
今回の経緯(前回以降に行ったこと)
python-for-android
のアプリケーション構築のためのコマンドを実行
~$ p4a apk --private /media/sf_VM-share --package=org.example.myapp --name "Myapp" --version 0.1 --bootstrap=sdl2 --requirements=python3,kivy
- 「android」または「sdkmanager」のバイナリが見つからない
というエラー発生
[INFO]: Will compile for the following archs: armeabi-v7a [INFO]: Found Android API target in $ANDROIDAPI: 27 [ERROR]: Build failed: Could not find `android` or `sdkmanager` binaries in Android SDK [INFO]: Instructions: Make sure the path to the Android SDK is correct
$HOME/Documents/android-sdk
にAndroidSDKのtools
を配置bashrc
とbash_profile
のPATHを編集して実行すると別のエラー
~$ sudo $HOME/Documents/android-sdk/tools/bin/sdkmanager sudo: /home/***/Documents/android-sdk/tools/bin/sdkmanager: コマンドが見つかりません
PATHも確認したのですが反映されているようです。
~$ echo $PATH ...:/home/***/Documents/android-sdk/tools:/home/***/Documents/android-sdk/platform-tools
結果
/opt
配下にtoolsを配置して実行した場合はsdkmanagerが実行できるがエラーになる$HOME/Documents
配下にtoolsを配置して実行するとsdkmanagerが見つからないエラーになるapt-get
でインストールしたsdkは/usr/lib
配下にあるのですが/android-sdk/tools/bin
の下にsdkmanagerがない
sdkmanagerが実行できないのはtoolsの配置場所が悪いのでしょうか?
それともPATHの記述や記述するファイルが間違っているのでしょうか?
またはそれ以外に問題があるのでしょうか?
長文になってしまいましたがアドバイスお願いします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/05/19 01:18
2020/05/19 01:52