I'm trying to use the android sdk without installing Android Studio because of hardware constraints. SYSTEM INFO[https://i.stack.imgur.com/oIsS4.png ]
So I've been following this tutorial https://dev.to/jay_js/setting-up-flutter-without-android-studio-olo so far so good, up until sdkmanager "system-images;android-29;google_apis;x86_64"
When i try executing that code i get Warning: Failed to read or create install properties file. I went into my 'Android' directory and saw these files only:[https://i.stack.imgur.com/pY7KR.png ] (screenshot from my pc).
Further into tools directory:[https://i.stack.imgur.com/bD22G.png ]
Am i missing files or what?
NB i plan on using the sdk for visual studio code. Feel free to ask for more screenshots:)
For Linux Ubuntu:
Just execute the command below:
sudo chmod -R a+w [path/to/android/sdk]
Source:[https://github.com/bitrise-steplib/steps-install-missing-android-tools/issues/57 ]
Related
I often compare my new build apk size with the production build and I am looking for options to automate this activity such that it compares both new and prod apk sizes and reports me.
I am aware of APK Analyzer of Android Studio but I want to do that using command-line tools. This doc lists the usage of apkanalyzer but upon running this command
apkanalyzer -h apk file-size myapk.apk
It says "'apkanalyzer' is not recognized as an internal or external command, operable program or batch file." though I have already set the environment path to \Android\sdk\tools\bin.
Not sure why command-line is not recognizing this command, could you let me know where I could possibly have gone wrong or is there any other way to check apk file size using command-line?
Thanks for any help in advance.
apkanalyzer is unix shell script, here converted batch script for windows, make sure to change APP_HOME and CLASSPATH to match your setup. save it as apkanalyzer.cmd
#echo off
::##############################################################################
::##
::## apkanalyzer start up script for Windows
::##
::## converted by ewwink
::##
::##############################################################################
::Attempt to set APP_HOME
SET SAVED=%cd%
SET APP_HOME=C:\android\sdk\tools
SET APP_NAME="apkanalyzer"
::Add default JVM options here. You can also use JAVA_OPTS and APKANALYZER_OPTS to pass JVM options to this script.
SET DEFAULT_JVM_OPTS=-Dcom.android.sdklib.toolsdir=%APP_HOME%
SET CLASSPATH=%APP_HOME%\lib\dvlib-26.0.0-dev.jar;%APP_HOME%\lib\util-2.2.1.jar;%APP_HOME%\lib\jimfs-1.1.jar;%APP_HOME%\lib\annotations-13.0.jar;%APP_HOME%\lib\ddmlib-26.0.0-dev.jar;%APP_HOME%\lib\repository-26.0.0-dev.jar;%APP_HOME%\lib\sdk-common-26.0.0-dev.jar;%APP_HOME%\lib\kotlin-stdlib-1.1.3-2.jar;%APP_HOME%\lib\protobuf-java-3.0.0.jar;%APP_HOME%\lib\apkanalyzer-cli.jar;%APP_HOME%\lib\gson-2.3.jar;%APP_HOME%\lib\httpcore-4.2.5.jar;%APP_HOME%\lib\dexlib2-2.2.1.jar;%APP_HOME%\lib\commons-compress-1.12.jar;%APP_HOME%\lib\generator.jar;%APP_HOME%\lib\error_prone_annotations-2.0.18.jar;%APP_HOME%\lib\commons-codec-1.6.jar;%APP_HOME%\lib\kxml2-2.3.0.jar;%APP_HOME%\lib\httpmime-4.1.jar;%APP_HOME%\lib\annotations-12.0.jar;%APP_HOME%\lib\bcpkix-jdk15on-1.56.jar;%APP_HOME%\lib\jsr305-3.0.0.jar;%APP_HOME%\lib\explainer.jar;%APP_HOME%\lib\builder-model-3.0.0-dev.jar;%APP_HOME%\lib\baksmali-2.2.1.jar;%APP_HOME%\lib\j2objc-annotations-1.1.jar;%APP_HOME%\lib\layoutlib-api-26.0.0-dev.jar;%APP_HOME%\lib\jcommander-1.64.jar;%APP_HOME%\lib\commons-logging-1.1.1.jar;%APP_HOME%\lib\annotations-26.0.0-dev.jar;%APP_HOME%\lib\builder-test-api-3.0.0-dev.jar;%APP_HOME%\lib\animal-sniffer-annotations-1.14.jar;%APP_HOME%\lib\bcprov-jdk15on-1.56.jar;%APP_HOME%\lib\httpclient-4.2.6.jar;%APP_HOME%\lib\common-26.0.0-dev.jar;%APP_HOME%\lib\jopt-simple-4.9.jar;%APP_HOME%\lib\sdklib-26.0.0-dev.jar;%APP_HOME%\lib\apkanalyzer.jar;%APP_HOME%\lib\shared.jar;%APP_HOME%\lib\binary-resources.jar;%APP_HOME%\lib\guava-22.0.jar
SET APP_ARGS=%*
::Collect all arguments for the java command, following the shell quoting and substitution rules
SET APKANALYZER_OPTS=%DEFAULT_JVM_OPTS% -classpath %CLASSPATH% com.android.tools.apk.analyzer.ApkAnalyzerCli %APP_ARGS%
::Determine the Java command to use to start the JVM.
SET JAVACMD="java"
where %JAVACMD% >nul 2>nul
if %errorlevel%==1 (
echo ERROR: 'java' command could be found in your PATH.
echo Please set the 'java' variable in your environment to match the
echo location of your Java installation.
echo.
exit /b 0
)
:: execute apkanalyzer
%JAVACMD% %APKANALYZER_OPTS%
While checking the output of appium-doctor command - The following error was seen -
android, apkanalyzer could NOT be found in /Users/{user_name}/Library/Android/sdk!
The solution was to enable Android SDK Command-line tools from Android Studio Preferences
Checkout the screenshot
Hope this helps
APK Analyzer tool is available in android studio https://developer.android.com/studio/build/apk-analyzer.html.
Most the command executable options can be used just with the good UI available in the Android Studio.
The apkanalyzer file (with no extension) in my sdk>tools>bin installed on my windows 10 pc is a Unix Shell script.
Windows doesn't recognize this file as a valid command.
This appears to be a bug in the windows install of the Android SDK Tools 26.1.1.
This means that apkanalyzer does not exist in your SDK path.
To download it, just got to SDK Manager and click on Android SDK Tools, then click Ok to continue and download the missing tools.
SDK manager
As others have mentioned, make sure you have installed the Android SDK Tools via the SDK Manager. They should show up in <your_sdk_root>/tools/bin. A long time ago I added <your_sdk_root>/tools to my $PATH in my ~/.bash_profile, but never added <your_sdk_root>/tools/bin; apparently I missed the note that as of SDK Tools, Revision 25.3.0 tools were deprecated or otherwise moved to there among other places.
Seee also
https://developer.android.com/studio/command-line/ for details on the regular Tools, Build, Platform, and Emulator tools.
In Android Studio > Tools > sdkmanager > install Android SDK Command line tools
This worked for me!
I've submitted a bug report to Google: https://issuetracker.google.com/issues/124064881
Apparently it's broken on Windows.
be sure that Android Studio "Commandline Tools" installed on your system.
Then, add the following information into your system path;
C:\Users\user\AppData\Local\Android\Sdk\tools
C:\Users\user\AppData\Local\Android\Sdk\tools\bin
C:\Users\user\AppData\Local\Android\Sdk\cmdline-tools\latest
C:\Users\user\AppData\Local\Android\Sdk\cmdline-tools\latest\bin
It worked for me..
M. Yaşar Özden
I have a Jeknins installation on my local PC. I'm successfully able to integrate Android application code with github and generate .apk file as an artifact.
The problem is in the test case execution. I cannot get the Android emulator to start.
It says:
\sdk/tools/android.bat" create avd -f -a -c 500M -s 480x640 -n hudson_en-US_480_480x640_android-21_armeabi-v7a -t android-21 --abi armeabi-v7a
[android] Could not create Android emulator: Failed to parse AVD config file
Recording test result.
I have already tried this:
Could not create Android emulator: Failed to parse AVD config file
Also, I ran the same create command from command line and it successfully craeted the AVD.
Not a complete answer, but it seems that the andoid Sdk update that came out recently - SDK Tools, Revision 25.3.0 (March 2017) - has made some significant changes.
The Android emulator jenkins plugin uses the android command (/home/jenkins/Android/Sdk/tools/android), but if I copy the commands from the console output and try and run that from the command line on the Jenkins machine I get:
[android] /home/jenkins/Android/Sdk/tools/android create avd -f -a -s HVGA -n hudson_en-US_120_HVGA_7.02 -t 7.02
[android] Could not create Android emulator: Failed to parse AVD config file
and try and run that from the command line on the Jenkins machine I get:
The android command is no longer available.
For manual SDK and AVD management, please use Android Studio.
For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager
So it seems that from 25.3.0 onwards, the 'android' command is deprecated and has been removed, but the emulator plugin hasn't been updated to reflect this.
As a solution, the best bet seems to be to install an earlier version of the android Sdk that still supports the 'android' command, at least until the plugin is updated.
Try leaving the sdcard field empty.
I ran the command that the android plugin printed out via a shell script and added -v (for verbose) after android.
I then saw that the problem was that it could not create an sdcard.
When not filling in an sdcard size, it worked.
I use Ubuntu 14.04 LTS.
My JDK version is 1.8.0_31.
I downloaded Android Studio archive, unpacked it and ran a studio.sh file. But every time the installation begins an error occurs:
Refresh Sources:
Failed to fetch URL http ://dl-ssl.google.com/android/repository/addons_list-2.xml, reason: File not found
Fetched Add-ons List successfully
Refresh Sources
Failed to fetch URL http ://dl-ssl.google.com/android/repository/repository-10.xml, reason: File not found
Refresh Sources:
Failed to fetch URL http ://dl-ssl.google.com/android/repository/repository-10.xml, reason: File not found
There is nothing to install or update.
The following SDK components were not installed: build-tools-21.1.1, source-21, sys-img-x86-addon-google_apis-google-21, extra-android-m2repository, android-21, extra-google-m2repository, addon-google_apis-google-21, platform-tools
Moreover, when I run the studio.sh file following text appears in terminal:
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=350m; support was removed in 8.0
Also I tried to install the Android Studio from Paolo Rotolo's repository, but the same problem occurs.
I am rookie in Ubuntu, so I hope only for your help.
I also met this problem. Even I can download the xml files from browser, the android update sdk process keep reporting file not found. A search from google leads me to here:
https://code.google.com/p/android/issues/detail?id=76268
The first anwser reminds me of permission problem of ~/.android. I checked, and found that this hidden directory is not owned by me. Change the owner of the directory solve the problem.
Its not that tough actually, just follow the following steps:
first of all make sure your ubuntu is uptodate. open >Unity>Software updater.
Install latest Jdk - in my case its Java8
Installing java
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
Make it default version
sudo apt-get install oracle-java8-set-default
Installing Android Studio
Download Android Studio from here, use All Android Studio Packages
Extract the archive file into an appropriate location for your applications, eg: /opt. Use the filename of your downloaded archive, in my example android-studio-ide-141.2178183-linux.zip
sudo unzip android-studio-ide-141.2178183-linux.zip -d /opt
To launch Android Studio, navigate to the /opt/android-studio/bin directory in a terminal and execute ./studio.sh. Or use a desktop file, see below. Make sure you type "./studio.sh"
You may want to add /opt/android-studio/bin to your PATH environmental variable so that you can start Android Studio from any directory.
sudo studio.sh
running it as root solved for me
I making a small game in python with pygame.
I wanted to make the game available for android.
Hopefully, there was PGS4A for this
After doing the configuration I had to build it.
So I just typed the command:
python android.py build ~/project/programming/python/gameEngine release install
And I ended up with this error:
BUILD FAILED
/home/turquoisepotato/project/programming/python/pgs4a-0.9.6/android-sdk/tools/ant/build.xml:570: The following error occurred while executing this line:
/home/turquoisepotato/project/programming/python/pgs4a-0.9.6/android-sdk/tools/ant/build.xml:622: The following error occurred while executing this line:
/home/turquoisepotato/project/programming/python/pgs4a-0.9.6/android-sdk/tools/ant/build.xml:658: Execute failed: java.io.IOException: Cannot run program "/home/turquoisepotato/project/programming/python/pgs4a-0.9.6/android-sdk/platform-tools/aapt" (in directory "/home/turquoisepotato/project/programming/python/pgs4a-0.9.6/android-sdk/extras/google/play_licensing/library"): error=2, No such file or directory
What do I do with this. I'm lost.
I'm using crunch bang linux 11.
You're probably using a 64-bit OS, while the binaries are compiled against 32-bit libraries.
I'm not familiar with CrunchBang's repositories, but you can probably try
sudo apt-get install libc6:i386 libstdc++6:i386 zlib1g:i386 lib32ncurses5
and then run the installer again.
For some reason, this is a common problem that usually occurs on Windows with pgs4a 0.9.6.
Take a look at this.
To make sure that the directory structure of the unzipped file is the same as the screenshot.
You do not have a full android-sdk installed. You need the missing files that the error refers to. You can either roll-back to pgs4a 0.9.4, which doesn't use those licensing files or reinstall android-sdk
craig#ubuntu-desktop:~/Documents/python/pgs4a-0.9.6$ cd android-sdk/
craig#ubuntu-desktop:~/Documents/python/pgs4a-0.9.6/android-sdk$ ls
add-ons extras platforms platform-tools SDK Readme.txt temp tools
craig#ubuntu-desktop:~/Documents/python/pgs4a-0.9.6/android-sdk$ cd extras/
craig#ubuntu-desktop:~/Documents/python/pgs4a-0.9.6/android-sdk/extras$ ls
google
craig#ubuntu-desktop:~/Documents/python/pgs4a-0.9.6/android-sdk/extras$ cd google/
craig#ubuntu-desktop:~/Documents/python/pgs4a-0.9.6/android-sdk/extras/google$ ls
play_apk_expansion play_licensing
craig#ubuntu-desktop:~/Documents/python/pgs4a-0.9.6/android-sdk/extras/google$ cd play_licensing/
craig#ubuntu-desktop:~/Documents/python/pgs4a-0.9.6/android-sdk/extras/google/play_licensing$ ls
library LICENSE.txt README.txt sample source.properties test
craig#ubuntu-desktop:~/Documents/python/pgs4a-0.9.6/android-sdk/extras/google/play_licensing$
This link may help.
http://discussion.pychildren.org/t/windows-installation/10
To fix it go to this site http://ady.my/viewer/ and, in the section build, download the most recent version of build-tools. Extract the files 'aapt' and 'dx' and the directory 'lib' and move these all for the especified folder on the terminal /home/turquoisepotato/project/programming/python/pgs4a-0.9.6/android-sdk/platform-tools.
The code will be similar with this below:
mv aapt dx lib /home/turquoisepotato/project/programming/python/pgs4a-0.9.6/android-sdk/platform-tools
But the PGS4A is obselete. I suggest for you, use the Python for Android, that you find in this link: http://python-for-android.readthedocs.org/en/latest/
I need to do somethings that must be done from the command prompt of the android tool.
but every one says it's in the platform tools folder in the sdk path but which file is it?
that might help:
the contents of platform tools folder:
aapt.exe
adb.exe
aidl.exe
dexdump.exe
dx.bat
fastboot.exe
llvm-rs-cc.exe
source.properties
AdbWinApi.dll
AdbWinUsbApi.dll
Did you mean android Adb command lin tool if so see this link
if you want to manage emulator from command line see these three link it will help you a lot
Android Emulator
Using the Android Emulator
Android Emulator on Linux
There is an android command, but it's not an executable - run the android.bat in the tools directory, and you should be able to make the changes you need. If you add the tools directory to your system path, you'll be able to run android from any directory when using the command line.