how to figure out why one apk test works and the other not

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

how to figure out why one apk test works and the other not

Post by sphere » Thu Dec 04, 2014 10:04 pm

Helleo,
with an app original written in lc7.0.0 i get an INSTALL_FAILED_INVALID_APK. and with another just simple test, with a few button it works.
I'm testing directly on Galaxy Ace (as my Galaxy Sii has Cyanogenmod on it and the usb connection fails only power works).

So on this Galaxy Ace with original samsung software on it i can test right away.

How can i figure out why the one i want to work don't work?
It's nothing special in it. It just plays a few aiff audio files. SO in development it works ok.

The fault message is not of much help, so why is it invalid. As it has al the Standalone settings completely the same, set on froyo 2.2, tried also 2.3.3 and 2.3.6.
Thanks for any help.

SPhere

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

Re: how to figure out why one apk test works and the other n

Post by sefrojones » Thu Dec 04, 2014 11:20 pm

It doesn't look like aiff is a valid format for android, maybe that is the issue?

http://developer.android.com/guide/appe ... rmats.html

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: how to figure out why one apk test works and the other n

Post by sphere » Fri Dec 05, 2014 10:55 am

Hi Sefrojones,

why did i not think of that....

Probably because Livecode won't play mp3, and in windows only lets your hear Psssssssssssssssssssssssssssssssssssssssssss.
So that's why i encoded them to aiff.

Ok so i will try to change it to mp3 or other compatible soundformat for android.

Maybe it would be convenient for Livecode to support mp3 as well? Why is it not supported?
Now one would write an app and has to use the format supported by LC to test if it works, and then rewrite the lines to the format supported by the device.
And also re-encode the soundfiles to an other format. (ps its a bit extra work but we can overcome it, we're spoiled anyway :D )

Thanks!

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: how to figure out why one apk test works and the other n

Post by sphere » Fri Dec 05, 2014 2:52 pm

Ah yes, of course playing around in the IDE is not the same as on the Phone.

It's al written here http://lessons.runrev.com/s/lessons/m/4069/l/48552

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

Re: how to figure out why one apk test works and the other n

Post by sefrojones » Fri Dec 05, 2014 6:59 pm

I have all but stopped using the "play audioclip" command, and switched to player objects for desktop/ide and mobileplaysoundonchannel for mobile. Glad you got it all sorted. :D

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: how to figure out why one apk test works and the other n

Post by sphere » Sat Dec 06, 2014 8:28 pm

HI,

after changing the script to the correct commands for playing an adudio file on android, i still get install fails no valid APK.....
even changed the aiff to wav to get played on android.

Now i thought there must be something somewhere, so i removed first the added audio(wav) files and then all scripts one by one except for the mouse command at the beginning and end of a button script.
Then i removed all buttons and label one by one, testing each and every apk. until an empty stack and still the same fault.


Now my question is, does the bug remain in a stack which was written on LC 7.0.0 stable and re-opened in lc7.0.1 rc 3 ???
Meaning you gotta start all over again? (of course i can copy the scripts to notepad++ and then to the new stack)

Because when a new stack is created in lc 7.0.1 rc 3 the apk does get installed.

Can anyone confirm please, cause it really seems like it.

THanks !

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7258
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: how to figure out why one apk test works and the other n

Post by jacque » Sun Dec 07, 2014 5:25 pm

Do you delete the original apk from the device before installing the updated one? You cannot overwrite an existing app with another that has the same build number. Another way to do it is to change the build number before compiling the new version.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: how to figure out why one apk test works and the other n

Post by sphere » Sun Dec 07, 2014 8:19 pm

Hello jacque,

Yes i deleted every time in the emulator before testing again.
i'm 100% sure that the bug remains in a file which is made with LC7.0.0 stable.
I removed all pieces of code one by one, then all buttons and all fields and everytime tested it if it runs. So even with an empty stack i got the invalid apk error.

So i copied all scripts to notepad++ and then to a new stack in LC7.0.1rc3, created all buttons and fields again. added the to becopied files in the stand alone settings.
Did it also one by one to if there was any part or so which could probably cause an error. Totally no errors.
And now it installs. (i still hear no sound but that's for later).
It even works on my Galaxy SII.

So there must be something in the old stack file what keeps causing this fail to install on Android.

So my advice to anyone is not to use an "old" stack from lc7.0.0 stable if you want to deploy to Android.

Cheers!
Sphere

Post Reply

Return to “Android Deployment”