GithubHelp home page GithubHelp logo

Comments (15)

tito avatar tito commented on July 20, 2024

Hi,

Did you do: export PATH=$PATH:/home/USER/android-sdk-linux/tools/ (by
replacing USER with your username) The FULL path is necessary.
The "No such file or directory" indicate that it "android" command is
not in your path, so double-check.

You need to stick to android-8 or -14, that the only one tested with the
project, read the documentation for more information.

Mathieu

On 21/04/2012 07:33, socratesx wrote:

I try for many days to build a simple android package using kivy and python for android. Unfortunately, I've spent many hours trying to solve all the issues but I still cannot do it. I hope you guys help me out because you are my last hope before throwing my laptop off the window...

I have succeeded to build the distribution directory using only the kivy module.So the output folder /dist/default has all the necessary files (I hope) in order to build my apk. The command that I use to build the apk, according to the example in the docs is the following:

sudo ./build.py --dir ~/mount_point/kivy --name "Myapp" --package org.mytest.myapp --version 1.0 installd

What I get is:

An error occured while calling ~/android-sdk-linux/tools/android update Your PATH must include android tools.

I have already inserted in the bashrc the appropriate exports. So if i run the following:

~/android-sdk-linux/tools/android update

I get:

Error: Missing object name for verb 'update'. [Continues with usage details...]

I tried to remove from build.py the try except statement around the subprocess.call(...) and I ran gain the command. I got this :

Traceback (most recent call last):
File "./build.py", line 345, in
make_package(args)
File "./build.py", line 252, in make_package
subprocess.call([ANDROID, 'update', 'project', '-p', '.', '-t', android_api])
File "/usr/lib/python2.7/subprocess.py", line 493, in call
return Popen(_popenargs, *_kwargs).wait()
File "/usr/lib/python2.7/subprocess.py", line 679, in init
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1239, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

I replaced all subprocess.call() commands with os.popen() with the same arguments and it seems that I got a little further. However now when I run the build command I get the following error:

...
...
...
BUILD FAILED
/home/socratesx/android-sdk-linux/tools/ant/build.xml:1194: The following error occurred while executing this line:
/home/socratesx/android-sdk-linux/tools/ant/build.xml:1240: File /home/socratesx/python-for-android/dist/default/bin/Myapp-1.0-debug.apk does not exist.

I forgot to mention that I replaced also the android_api variable with the number 2 instead of 8.


Reply to this email directly or view it on GitHub:
#33

from python-for-android.

socratesx avatar socratesx commented on July 20, 2024

I have these exports in my .bashrc. You think they are wrong?

export PATH=${PATH}:~/android-sdk-linux/tools

export PATH=${PATH}:~/android-sdk-linux/platform-tools

As for the android-8 or android-14, If I run
android list targets I see only the following:


id: 1 or "android-15"
Name: Android 4.0.3
Type: Platform
API level: 15
Revision: 3
Skins: WXGA720, WVGA800 (default), WSVGA, WQVGA432, WXGA800, QVGA, WQVGA400, HVGA, WVGA854

ABIs : armeabi-v7a

id: 2 or "Google Inc.:Google APIs:15"
Name: Google APIs
Type: Add-On
Vendor: Google Inc.
Revision: 2
Description: Android + Google APIs
Based on Android 4.0.3 (API level 15)
Libraries:
* com.google.android.media.effects (effects.jar)
Collection of video effects
* com.android.future.usb.accessory (usb.jar)
API for USB Accessories
* com.google.android.maps (maps.jar)
API for Google Maps
Skins: WVGA854, WQVGA400, WSVGA, WXGA720, HVGA, WQVGA432, QVGA, WVGA800 (default), WXGA800
ABIs : armeabi-v7a

Only two ids, and that's why I selected 2. Furthermore I tried to update manually the android by typing the same command that I see in the build.py:

android update project -p . -t android-8
Error: Target id 'android-8' is not valid. Use 'android list targets' to get the target ids.

I got the same error with both android8 and 14 , but not with 2.

from python-for-android.

tito avatar tito commented on July 20, 2024

Replace ~ with the FULL path /home/USERNAME as i said before.
Then, you are misunderstanding the API level from android.

Android API number refer to the number next to android-APINUMBER. It's
not the id 1 or 2 in your targets list. So yes, stick on 8 or 14 as
written on the docs.

And then, you need to install the support for 8 or 14. Just launch
"android", and select "Android 2.2 (API 8)" or "Android 3.3 (API 14)",
and click to "Install".

I'll try to include screenshots in the documentation.

Mathieu

On 21/04/2012 11:12, socratesx wrote:

I have these exports in my .bashrc. You think they are wrong?

export PATH=${PATH}:~/android-sdk-linux/tools

export PATH=${PATH}:~/android-sdk-linux/platform-tools

As for the android-8 or android-14, If I run
android list targets I see only the following:


id: 1 or "android-15"
Name: Android 4.0.3
Type: Platform
API level: 15
Revision: 3
Skins: WXGA720, WVGA800 (default), WSVGA, WQVGA432, WXGA800, QVGA, WQVGA400, HVGA, WVGA854

ABIs : armeabi-v7a

id: 2 or "Google Inc.:Google APIs:15"
Name: Google APIs
Type: Add-On
Vendor: Google Inc.
Revision: 2
Description: Android + Google APIs
Based on Android 4.0.3 (API level 15)
Libraries:
* com.google.android.media.effects (effects.jar)
Collection of video effects
* com.android.future.usb.accessory (usb.jar)
API for USB Accessories
* com.google.android.maps (maps.jar)
API for Google Maps
Skins: WVGA854, WQVGA400, WSVGA, WXGA720, HVGA, WQVGA432, QVGA, WVGA800 (default), WXGA800
ABIs : armeabi-v7a

Only two ids, and that's why I selected 2. Furthermore I tried to update manually the android by typing the same command that I see in the build.py:

android update project -p . -t android-8
Error: Target id 'android-8' is not valid. Use 'android list targets' to get the target ids.

I got the same error with both android8 and 14 , but not with 2.


Reply to this email directly or view it on GitHub:
#33 (comment)

from python-for-android.

socratesx avatar socratesx commented on July 20, 2024

From the SDK manager I have only installed android 4.0.3 (API 15). I will download also the ones you said and I will report later for the result. Thanx!

from python-for-android.

rubik avatar rubik commented on July 20, 2024

As for now API 15 won't work, as said in issue #9. So just download 14 and it should run smoothly.

from python-for-android.

socratesx avatar socratesx commented on July 20, 2024

I downloaded API 14 but unfortunately it doesn't work...

When I run the command

sudo ./build.py --dir mount_point/kivy --package org.testapp.myapp --name "myapp" --version 1.0 debug installd

I get:

Traceback (most recent call last):
File "./build.py", line 339, in
make_package(args)
File "./build.py", line 248, in make_package
subprocess.call([ANDROID, 'update', 'project', '-p', '.', '-t', android_api])
File "/usr/lib/python2.7/subprocess.py", line 493, in call
return Popen(_popenargs, *_kwargs).wait()
File "/usr/lib/python2.7/subprocess.py", line 679, in init
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1239, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

I have removed the try,except statement for troubleshooting purposes. I also tried to run the update command manually.

android update project -p . -t android-14

This is what I get:

Updated project.properties

Updated local.properties

build.xml: Failed to find version-tag string. File must be updated.
In order to not erase potential customizations, the file will not be automatically regenerated.
If no changes have been made to the file, delete it manually and run the command again.
If you have made customizations to the build process, the file must be manually updated.
It is recommended to:
* Copy current file to a safe location.
* Delete original file.
* Run command again to generate a new file.
* Port customizations to the new file, by looking at the new rules file
located at /tools/ant/build.xml
* Update file to contain
version-tag: custom

to prevent file from being rewritten automatically by the SDK tools.

Updated file ./proguard-project.txt

These are also my exports in .bashrc file:
export ANDROIDSDK=/home/socratesx/android-sdk-linux
export ANDROIDNDK=/home/socratesx/android-ndk-r7
export ANDROIDNDKVER=r7
export ANDROIDAPI=14
export PATH=${PATH}:/home/socratesx/android-sdk-linux/tools

export PATH=${PATH}:/home/socratesx/android-sdk-linux/platform-tools

from python-for-android.

rubik avatar rubik commented on July 20, 2024

Have you rebuilt the distribution after having downloaded API 14 and set it in the env variable?

from python-for-android.

socratesx avatar socratesx commented on July 20, 2024

No. I will do it now and let you know.

from python-for-android.

socratesx avatar socratesx commented on July 20, 2024

The result is the same after rebuilding distribution. Maybe I have to remove api 15 from the sdk manager and keep only 14 or it doesn't matter.

from python-for-android.

socratesx avatar socratesx commented on July 20, 2024

Ok I did it but I had to change the build.py a little bit.

So I replaced the subprocess.call() commands (for android update and ant calling) with os.popen() with the same arguments.

The ant call had a problem though and so I called it manually by typing ant installd. After that the app installed in my device.

from python-for-android.

tito avatar tito commented on July 20, 2024

That's weird. I don't understand why subprocess.call would act differently than os.popen()... because subprocess use os.popen...
Do you have space if you path or something? An unicode character?

from python-for-android.

tito avatar tito commented on July 20, 2024

No more update, closing

from python-for-android.

nmz787 avatar nmz787 commented on July 20, 2024

Has this fix been integrated? I think I am seeing this issue here. Will check more and look into code if I find nothing else.

from python-for-android.

inclement avatar inclement commented on July 20, 2024

@nmz787 This issue is extremely old, python-for-android has been almost completely rewritten since then. If you have a problem, post on the kivy mailing list or open a new issue with the full details.

from python-for-android.

strongheart avatar strongheart commented on July 20, 2024

I had an failure notice similar to the original one ...

/home/socratesx/android-sdk-linux/tools/ant/build.xml:1240: File /home/socratesx/python-for-android/dist/default/bin/Myapp-1.0-debug.apk does not exist.
but accidentally found 'myapp.apk' in the dists folder :

.buildozer/android/platform/build/dists

It just never got moved to /bin

from python-for-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.