APK builds and installs but won't run

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Tukcedo
Posts: 65
Joined: Fri Jun 27, 2014 9:43 pm

APK builds and installs but won't run

Post by Tukcedo » Tue Aug 12, 2014 9:33 pm

Hi there!

I've just started with LiveCode and am still getting familar with various aspects such as databases and mobile functions. To play with the latter I hooked up my Sony Z1 Compact. After some initial problems I finally got the stack to install on the Z1. However it won't run. I can see a screen flicker (presumably it starts up then dies immediately). I believe that the problem is somewhere in logcat, possibly this "No content provider". I've read about the /data/local directory but since the device isn't rooted (and I don't really want to either), I can't even see that directory. Any ideas? LCC 6.6.2

W/ActivityManager( 998): No content provider found for permission revoke: file:///data/local/tmp/file9wZZPU
Michel J.L. van der Kleij
Coding to help stray animals in the Philippines
Albert Foundation - http://albert.tukcedo.nl
Aklan Animal Rescue & Rehabilitation Center - http://aarrc.tukcedo.nl

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: APK builds and installs but won't run

Post by Simon » Tue Aug 12, 2014 10:14 pm

Hi Tukcedo,
Have you tried with just a "Hello world" example on the Z1?
Probably best to start there, then deal with added code.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

newtronsols
Posts: 192
Joined: Tue Mar 11, 2014 12:57 pm

Re: APK builds and installs but won't run

Post by newtronsols » Tue Aug 12, 2014 10:44 pm

A good demo to try is:

http://forums.livecode.com/viewtopic.ph ... id#p107177

Simply extract the mgscrollerazindexdemo.zip from the zip file, and test in LC via USB - it works straight away on my Android phone.

Tukcedo
Posts: 65
Joined: Fri Jun 27, 2014 9:43 pm

Re: APK builds and installs but won't run

Post by Tukcedo » Wed Aug 13, 2014 11:35 am

Good tip to try a simple Hello World: that worked. But now I'm left with: what part of the code that I added above the simple 1 button it doesn't like? I find this really puzzling to be honest. Where do I go from here?
Michel J.L. van der Kleij
Coding to help stray animals in the Philippines
Albert Foundation - http://albert.tukcedo.nl
Aklan Animal Rescue & Rehabilitation Center - http://aarrc.tukcedo.nl

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: APK builds and installs but won't run

Post by Mag » Wed Aug 13, 2014 12:46 pm

Maybe you could open Eclipse and see the log for that device to see if there is some useful info.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: APK builds and installs but won't run

Post by Simon » Wed Aug 13, 2014 6:32 pm

Hi Tukcedo,
Go through your code and make sure you haven't used any iOS only commands/functions. There are plenty of them.
Good to hear you can run apps on the Z1.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Tukcedo
Posts: 65
Joined: Fri Jun 27, 2014 9:43 pm

Re: APK builds and installs but won't run

Post by Tukcedo » Wed Aug 13, 2014 9:21 pm

This is the weird thing: it's just REALLY simple code. Most not even working yet (just started ...), so it's a bunch of (code-less) text entry fields, couple of buttons. Uses SQLite (which works fine in the IDE). If THIS doesn't even work I fear the worst for when I dig in. I'll try and expand the Hello World a little but I'm truly in the dark here :-(
Michel J.L. van der Kleij
Coding to help stray animals in the Philippines
Albert Foundation - http://albert.tukcedo.nl
Aklan Animal Rescue & Rehabilitation Center - http://aarrc.tukcedo.nl

sefrojones
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 447
Joined: Mon Jan 23, 2012 12:46 pm

Re: APK builds and installs but won't run

Post by sefrojones » Wed Aug 13, 2014 9:24 pm

Tukcedo wrote: Uses SQLite (which works fine in the IDE). If THIS doesn't even work I fear the worst for when I dig in. I'll try and expand the Hello World a little but I'm truly in the dark here :-(

Is SQLlite checked in your standalone setting? Also probably Allow external storage.

--Sefro

Tukcedo
Posts: 65
Joined: Fri Jun 27, 2014 9:43 pm

Re: APK builds and installs but won't run

Post by Tukcedo » Wed Aug 13, 2014 9:43 pm

Bingo! Added fields and buttons, everything still ran. However, then I checked "Standalone Application Settings" -> Android -> "Externals/SQLite" and it stopped working!

I haven't actually added any of the revXXXX database calls yet, but would these still work leaving that checkbox cleared?
Michel J.L. van der Kleij
Coding to help stray animals in the Philippines
Albert Foundation - http://albert.tukcedo.nl
Aklan Animal Rescue & Rehabilitation Center - http://aarrc.tukcedo.nl

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: APK builds and installs but won't run

Post by Simon » Wed Aug 13, 2014 9:47 pm

Hi Tukcedo,
I can assure you that SQLite and mySQL do work on mobile (iOS and Android).
Are you including a database with your stack or building it on the fly via liveCode?
specialFolderPath "documents" should be used in either case as a db included via the Copy Files will end up compressed in specialFolderPath "engine" and you don't want to decompress every time you use it, look it up in the dictionary.
but would these still work leaving that checkbox cleared?
Nope

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Tukcedo
Posts: 65
Joined: Fri Jun 27, 2014 9:43 pm

Re: APK builds and installs but won't run

Post by Tukcedo » Thu Aug 14, 2014 12:01 pm

Thanks Simon, that may be the problem then as I had them located in "Home"! Incidentally, you also answered a question I had about how to distribute a database along with the package. I'll give it another try later.
Michel J.L. van der Kleij
Coding to help stray animals in the Philippines
Albert Foundation - http://albert.tukcedo.nl
Aklan Animal Rescue & Rehabilitation Center - http://aarrc.tukcedo.nl

Tukcedo
Posts: 65
Joined: Fri Jun 27, 2014 9:43 pm

Re: APK builds and installs but won't run

Post by Tukcedo » Thu Aug 14, 2014 5:54 pm

Hmmm I changed the path to "documents" but as soon as I use the SQLite checkbutton it bombs out again. Did a filter on *.E and name of my Identifier and then I believe the below is the culprit:

Code: Select all

E/dalvikvm( 8134): dlopen("/data/app-lib/nl.tukcedo.war-2/librevdb.so") failed: dlopen failed: "/data/app-lib/nl.tukcedo.war-2/librevdb.so" is too small to be an ELF executable
Attachments
androiddbtest.png
Michel J.L. van der Kleij
Coding to help stray animals in the Philippines
Albert Foundation - http://albert.tukcedo.nl
Aklan Animal Rescue & Rehabilitation Center - http://aarrc.tukcedo.nl

sefrojones
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 447
Joined: Mon Jan 23, 2012 12:46 pm

Re: APK builds and installs but won't run

Post by sefrojones » Thu Aug 14, 2014 6:10 pm

Have you tried checking write external storage as well? I seem to remember needing that permission to get it working.....

Tukcedo
Posts: 65
Joined: Fri Jun 27, 2014 9:43 pm

Re: APK builds and installs but won't run

Post by Tukcedo » Thu Aug 14, 2014 9:41 pm

Tried that too just now, no luck ...
Michel J.L. van der Kleij
Coding to help stray animals in the Philippines
Albert Foundation - http://albert.tukcedo.nl
Aklan Animal Rescue & Rehabilitation Center - http://aarrc.tukcedo.nl

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: APK builds and installs but won't run

Post by MaxV » Sun Nov 02, 2014 12:32 am

The problem is in the APK file. The APK file is just a zip file, try to unzip it and you'll get the following folders:
  • assets (containing accessories file)
  • lib/armeabi/
  • META-INF
  • res
the lib/armeabi/ folder contains at least 3 files, but two are empty for a bug: libsqlite.so and librevdb.so.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Post Reply

Return to “Android Deployment”