How can I build and signed (keystore) the .apk file using 'apkbuilder.bat' via windows command-line ?
I try to run the following line:
apkbuilder.bat %APK_File_Name% -u -z %Project_Path%\bin\resources.ap_ -f %Project_Path%\bin\classes.dex -rf %Project_Path%
but I'm getting the following exception:
java.lang.ArrayIndexOutOfBoundsException: 1
at com.android.sdklib.build.ApkBuilderMain.main<ApkBuilderMain.java:61>
Please help. Thanks
You can do it in command line (.bat) in windows using ant.
with:
"ant release"
You build the apk unsigned.
Then you need to add the call to "jarsigner" and "zipalign" in the bat to complete the task.
You can find an example of the command line to call these tools here:
http://developer.android.com/guide/publishing/app-signing.html#signapp
Best,
I would suggest using Ant and the build files generated by the Android tools rather than trying to handroll your own. If nothing else, you can use the build files as a reference to determine how it uses the various tools to perform each step.
Related
What I am trying to do: I am trying to install ktlint on windows locally
What I tried:
Used below command in command prompt
curl -sSLO https://github.com/pinterest/ktlint/releases/download/0.38.1/ktlint && chmod a+x ktlint
Also tried above command by using in below steps in link
https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/
What is happening: Not able to install in windows.
How to install in windows ?
I was having trouble installing ktlint for Windows 10. What worked for me was going to the Releases page, downloading the ktlint file, renaming the ktlint file to ktlint.jar and adding it inside my Android project root folder (in reference to this GitHub issue) (Note: Java must be installed so that the file extension can be recognized), then running java -jar ktlint.jar --apply-to-idea-project (in the command line, from the Android project root directory). Then finally I was able to get it to work, resulting in the following text:
The following files are going to be updated:
.\.idea\codeStyles\codeStyleConfig.xml
.\.idea\codeStyles\Project.xml
.\.idea\inspectionProfiles\profiles_settings.xml
.\.idea\inspectionProfiles\ktlint.xml
.\.idea\workspace.xml
Do you wish to proceed? [y/n]
(in future, use -y flag if you wish to skip confirmation)
y
(updated)
Please restart your IDE
(if you experience any issues please report them at https://github.com/shyiko/ktlint)
Without updating the file to have the .jar extension and adding .jar to the filename command line parameter, I kept getting the following error:
Error: Unable to access jarfile ktlint
To run ktlint immediately, run java -jar ktlint.jar in the command line (in the directory where the ktlint.jar file resides).
You can install a git hook to automatically check files for style violations on commit by entering the following command in the Command Line (run "ktlint installGitPrePushHook" if you wish to run ktlint on push instead):
java -jar ktlint.jar installGitPreCommitHook
But this will only allow you to set hook for your current command line session. If you close out of Command Prompt, the settings will be reset. If you want to have the ktlinter run on every session for your project, you have to add the java -jar ktlint.jar command to your project's .git/hook/pre-commit file and paste the ktlint.jar file into the .git/hook folder as well.
Download the ktlint jar ffile from the lib and add it in your project
Run java -jar ktlint on the command line
From that point and then gradlew ktlintCheck should work
I am following the instructions here to build chromium project for android on ubuntu 14.04. I was able to successfully check out the code, now I'm trying to configure the build. I'm using GN to configure, so I run "gn args out/Default", however I get this error: gn.py: Could not find gn executable at: /home/moon/chromium/src/buildtools/linux64/gn
All I have in that above folder is sha1 files, I don't seem to have python files. However, I had not received any errors during checkout process. What am I doing wrong and how can I fix this?
Thanks a lot!
I had the same problem as you but I managed to build Chromium finally.
Most probably, you may not successfully install any necessary dependencies.
Since you are on Linux, run the following command under src:
$ ./build/install-build-deps.sh
After this you can rerun the command:
$ gn gen out/Default
After giving credit to Brett Wilson, run:
gclient runhooks
It worked for me.
I am currently attempting to build tess-two for an OCR android application via command line as instructed on https://github.com/rmtheis/tess-two. This is done on my macbook, OSX 10.9.4.
In order to build tess-two, this must be typed into command line:
$ 1git clone git://github.com/rmtheis/tess-two tess
$ cd tess
$ cd tess-two
$ ndk-build
$ android update project --path .
$ ant release
I encountered a problem as soon as I enter:
$ android update project --path .
This is the error displayed:
-bash: android: command not found
I have spend many hours trying to remedy this, and so far nothing fruitful has come of it. I appreciate any suggestions. Thanks.
This means the android command is not in your PATH. Try typing which android. It should give you the location if it is within your PATH.
Usually android can be found in your SDK directory under tools
You've got two options:
run the command with your_sdk_path/tools/android update project --paht
add android to your PATH with
export PATH=$PATH:/your_sdk_path/tools
You must have downloaded Android Development Toolkit bundle first. https://developer.android.com/sdk/index.html?hl=sk#mac-bundle
Then add /sdk/tools to your path.
I hope you know how to configure your path. If you are not sure please have a look at this : http://www.cyberciti.biz/faq/appleosx-bash-unix-change-set-path-environment-variable/
I'm following an android tutorial on ndk and I am trying to run the following command within cygwin
$make - v
but I get the following message:
bash: make: command not found
Can anyone help ?
Launch the setup. Search the packages for "make" and install them...
You should not use cygwin to run ndk-build in NDK version 6 and above. Use ndk-build.cmd from CMD prompt instead. Anyways, NDK contains its own rebuilt make executable on all platforms, which should be used with ndk build scripts.
I have been trying to get my head around using uiautomator and I understand creating the test cases. I tried the first two steps of building the JAR according the the Android developer guide for UI Testing (http://developer.android.com/tools/testing/testing_ui.html) and that worked fine, but I am unsure on how to follow the next steps and building the JAR file with ant. Please can anyone help me with this issue.
Here are the steps that I have done so far:
<android-sdk>/tools/android create uitest-project -n <name> -t 1 -p <path>
set ANDROID_HOME=<path_to_your_sdk>
This is the step that I am stuck on:
ant build
The error I get when I use the command prompt is:
'ant' is not recognized as an internal or external command, operable program or batch file.
In the terminal run
which ant
It seems you do not have ant installed. If no location like /usr/bin/ant shows up after you run the command above, use this to install it:
sudo apt-get install ant
Try again after. It should work.
If you're using ADT, I recommend downloading Apache ant and placing it within the sdk/tools/ant folder. Then change your PATH variable to direct to the ant bin folder.
you have this error because you wrote "ant build" from incorrect path.
I did (this command generate build.xml, local.properties, project.properties files):
<android-sdk>/tools/android create uitest-project -n <name> -t 1 -p <path>
I changed in build.xml first line like:
<project name="name" default="build">
after that I run ant from eclipse. Build was success.
Have you installed ant? If not then do it from this site: http://ant.apache.org/manual/install.html
If yes then follow these steps:
Navigate to your project directory and means (go to bin of your project)
Using command window execute the function: ant build
Ensure that your default JAVA_HOME points to JDK installation, not the JRE, and check if your compiler is in the PATH. Try to type “javac” in the command prompt. If javac is not found, then you should put your bin directory in the PATH.
For example, in Windows:
SET PATH=c:/jdk1.5.0_07/bin;%PATH%
This site might help further: http://looksok.wordpress.com/2014/02/08/uiautomator-in-eclipse/
If you have ADT with Eclipse then you can find ant in the plugins directory of Eclipse.