Tuesday, May 31, 2016

How to input ${sdk.dir} to build.xml | Apache Ant | Ubuntu

Assuming, $ANDROID_HOME (environmental variable ) refers to android sdk directory, you can inject the ANDROID_HOME  into the sdk.dir property using the following ant command.

$ ant debug -Dsdk.dir=$ANDROID_HOME

ANDROID_HOME must be an absolute path such as /home/username/something/android-sdk





If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

Mouse cursor not visible | Ubuntu


SOLUTION:
sudo modprobe -r psmouse
sudo modprobe psmouse









If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

android update project: command not found | Ubuntu


Context:
Running android update project

ERROR:
command not found

Solution:

  1. export ANDROID_HOME=/Applications/android-sdks
  2. Add Tools to PATH
    • export PATH=${PATH}:${ANDROID_HOME}/tools
  3. Add platform-tools to PATH
    • export PATH=${PATH}:${ANDROID_HOME}/platform-tools






If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

ERROR: subprocess.CalledProcessError: Command '['ant', 'debug']' returned non-zero exit status 1 | Ubuntu | Buildozer


Context:
Running buildozer android debug

ERROR:
subprocess.CalledProcessError: Command '['ant', 'debug']' returned non-zero exit status 1


SOLUTION:

  1. Go to ~/.buildozer/android/platform/android-sdk-24/tools/ant
  2. Run ant debug
  3. You will find issues.
  4. Sort them out.






If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

Monday, May 30, 2016

ERROR: Target id 'android-xx' is not valid. Use 'android list targets' to get the target ids | Buildozer | Ubuntu


ERROR:
Target id 'android-xx' is not valid. Use 'android list targets' to get the target ids.
...
...
...
File "/usr/lib/python2.7/subprocess.py", line 541, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ant', 'debug']' returned non-zero exit status 1

SOLUTION:

  1. Upgrade ant that is linked to Buildozer
  2. Install using sudo apt-get install ant.
  3. If ant is already installed and it is latest, just change the version in specification file of buildozer by following this link.




If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

ANT version change | Buildozer | Ubuntu



  1. Type which ant in terminal. 
  2. Mine resulted with /usr/bin/ant. If apache ant is not installed already, you might get an error.
  3. Uncomment #android.ant_path = line in buildozer.spec
  4. use android.ant_path = /usr/bin/ant 
  5. Now you can control the upgrades of ant and get it updated in buildozer automatically. Otherwise, there will be two instances (can be two different versions) in same machine.




If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

ERROR: ant/build.xml : Unable to resolve project target 'android-19 | Buildozer | Ubuntu | Android


I am trying to build apk using buildozer and below is the error I've encountered:

ant/build.xml :  Unable to resolve project target 'android-19
...
...
...
Traceback (most recent call last):
  File "build.py", line 517, in <module>
    make_package(args)
  File "build.py", line 365, in make_package
    subprocess.check_call([ANT, arg])
  File "/usr/lib/python2.7/subprocess.py", line 541, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ant', 'debug']' returned non-zero exit status 1

Solution:


  1. Open Android SDK Manager
  2. To launch it we need to cd to /home/username/.buildozer/android/platform/android-sdk-24/tools and execute./android. Do not use sudo ./android as it gives you permissions issue later.
  3. Deselect All and select API 19
  4. Install and close.



If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

Solution: # Aidl not found, please install it | Ubuntu | Buildozer

ERROR:

# Check that aidl can be executed
# build-tools folder not found /home/raviteja/.buildozer/android/platform/android-sdk-24/build-tools
# Search for Aidl
# Aidl not found, please install it.

SOLUTION:

  1. Above error says build-tools folder is not found. I checked in my /home/raviteja/.buildozer/android/platform/android-sdk-24/ and build tools folder is not available really.
  2. Launched Android SDK Manager to install the build tools. To launch it we need to cd to /home/raviteja/.buildozer/android/platform/android-sdk-24/tools and execute ./android. Do not use sudo ./android as it gives you permissions issue later.
  3. Make sure you check the following check box in Tools --> Options of Android SDK Manager and close it.
  4. enter image description here
  5. Check the Build tools option and install it (you might need to accept the license)







If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

Solution: E: Sub-process /usr/bin/dpkg returned an error code (1) | Ubuntu


  1. gksudo nautilus
  2. Navigate via nautilus to: /var/lib/dpkg/info
  3. Search for: package name .. "openjdk-9-jdk" in my case
  4. Delete them.
  5. close nautilus
  6. sudo apt-get update









If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged