installation question

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

installation question

Post by cusingerBUSCw5N » Fri Oct 19, 2012 2:12 pm

My app is finally done! :D For the big picture - I am hoping to have a free version available to members that can be downloaded off a secure website, with a paid version available through GooglePlay. So, I am experimenting with how to download an app from a website and install it.

Here are the nitty gritty details: I set up a key and created a standalone with a key. I put the standalone on my server and an html file with a link to it.

Then I learned that .apk files can't be read unless the server settings allow it. So I had the webmaster update the server settings.

I also changed my android device settings to allow installation outside of GooglePlay.

My android device can now find the file and goes to install it. Problem is - the installation fails.

I tried it with a plain stack - only one button and one field - it fails.

I have been looking for others with the problem and they talk about moving the file from one spot on the device to another... so I have two questions

1) Do I have to move the file to somewhere other than the downloads folder?

2) I can't really expect customers to do this...so is there an easier way to have people install the app?

Thanks

qberty1337
Posts: 35
Joined: Sun Sep 09, 2012 1:09 pm

Re: installation question

Post by qberty1337 » Sun Oct 21, 2012 3:21 pm

what do you mean the installation fails? Does it fail after you click the "Install" button? Or does it fail to copy to your device?

I've run into a similar kind of problem before. It had to do with my JDK setup. Make sure you have the LATEST JDK, JRE and Android SDK installed. As well as the latest LiveCode.

You need to sign your app with your own private key or else it won't work for other people. You'll need to make sure the key works. You should ALSO zip-align your APK's. You have more control when you sign and zipalign your APK yourself instead of making LiveCode do it. That way, you can properly isolate the problem you are having.

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: installation question

Post by cusingerBUSCw5N » Wed Oct 24, 2012 12:41 am

OK. My problem got worse.

I installed my app on Google Play. You can actually find it and get it. It downloads fine but at the beginning of the installation there is an error "Package file was not signed correctly."

I used my personal key and so I don't know what it wants that I haven't given it.

So now, you can't get my app on Google Play Store or on my website...:cry:

Regarding the last post, I don't know what "zipalign my APK" means...since I don't know what to zip...or what to align...oh dear. I also don't know how to make sure the key works...

Regarding JDK, I have jdk1.7.0_07 and jre7 Both were downloaded on 9/13/12

Regarding livecode, I have 5.5.1 installed in July 2012

So...when you try to download it from the website, it downloads, but during the installation it says "There is a problem parsing the package".

Oh dear....

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: installation question

Post by cusingerBUSCw5N » Wed Oct 24, 2012 1:47 am

There is some information on various forums that says that anything in the PlayStore has to use Google's key. I can find the code, but have no idea what to do with it because LIvecode wants you to upload a .keystore file, which I generated on my computer.

So...do you have to use Google's key for the PlayStore, and if so, how do you use it with Livecode?

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: installation question

Post by cusingerBUSCw5N » Wed Oct 24, 2012 3:49 am

I believe I have identified the problem.

I ran jarsigner to see if the key was good: (for anyone who needs to do this: using Run, type in cmd to get a c prompt. then do cd c:your_path_to_the_folder_of_your_apk\ and press enter. That changes the folder. Then type (and use the quotes because program files has a space in it) "c:\program files\java\jdk1.7.0_07\bin\jarsigner.exe" (assuming that is where your jarsigner.exe is) but do not press enter yet. then type -verify -verbose -certs name_of_your_apk_file.apk Now press enter.

My Results: Certpath not validated. Path does not chain with any of the trust anchors .

I'm not sure what that means and the only info I've found so far involves setting trust anchors on servers, not on standalone computers...BUT, I found this posting within Livecode

The jarsigner in jdk 7 has a problem leaving nulls in the certpath, so the apk is signed but with buried problems that only come to light during an install.
We downloaded JDK 6 and manually signed using jarsigner 1.6u32. and everything works correctly now.


So, I haven't done it yet, but I am going to try getting the earlier JDK 6 and seeing if it works. If anyone has any easier ideas, please let me know.

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: installation question

Post by cusingerBUSCw5N » Wed Oct 24, 2012 4:57 am

good news and bad news.

The good news is that I installed the earlier SDK and created a new key, loaded it in LiveCode's Standalone Applications, saved it in a new name and tested it and it came out clean!

So, I uploaded it to my server to install it. It downloaded fine, but when it tried to install, it, first it asked if it could override prior versions, and I said OK...then it said "Did not install."

That's it...no explanation...no details. Just "Did not Install."

So...what gives? :?

qberty1337
Posts: 35
Joined: Sun Sep 09, 2012 1:09 pm

Re: installation question

Post by qberty1337 » Wed Oct 24, 2012 5:36 am

Since you're using 5.5.1 which is the version that DOESN'T SUPPORT jellybean (for comparison purposes only). That version has an issue signing APKs. I've ran into your exact problem and I wanted to cry, here's how to fix it:

So since you will be using 1.6. DO NOT SIGN THE APK WITH LIVECODE. Simple version: When compiling, make sure your settings are set to "Don't use key". After that, Create your keystore using 10000 as an expiration date like normal, and sign it with jarsigner MANUALLY through CMD / Terminal. THEN you must ZIP-align or else google play will not take the APK properly.

Try installing it locally first to test. You really ought to update to 5.5.2 as it supports Jellybean and doesn't have a problem with JDK 1.7

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: installation question

Post by cusingerBUSCw5N » Wed Oct 24, 2012 1:56 pm

OK. Thanks for your input. I will upgrade to 5.5.2 (although I thought I had done it before and for some reason it didn't "stick").... and give it a shot with the JDK 1.7 again.

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: installation question

Post by cusingerBUSCw5N » Wed Oct 24, 2012 2:58 pm

Status: upgraded to 5.5.2. Had Livecode sign the key - using the newer SDK version 7 - Gave the app a new name. Result: "not installed" (It gave this message immediately rather than waiting until the end of the installation.)

Had Livecode sign the key using the OLDER SDK version 6 - Gave the app a new name. Result: "Not installed" (same fast message).

Next step - is to manually do it... and then I will scream...or cry... or gorge myself in food that I shouldn't eat.

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: installation question

Post by cusingerBUSCw5N » Wed Oct 24, 2012 3:22 pm

Deep breaths... I just tried manually signing the key. Bottom line - "Certificate chain not found for testthis.disasterapp (my app). (my app) must reference a valid Keystore key entry containing a private key and a corresponding public key certificate chain.

I think this is why I switched back to using SDK 6 because it didn't need this...BUT, if it won't install, I'm just going in circles.

So...do I need a private key and a public key and a certificate chain (whatever that is)................

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: installation question

Post by cusingerBUSCw5N » Wed Oct 24, 2012 3:46 pm

partial mistake but same problem. In my last post, I used the wrong alias. I forgot that even though I am changing file names, the key alias remains the same.

anyway, redid it, was able to sign!.....with the original problem (before I upgraded) "CertPath not validated: Path does not chain with any of the trust anchors"

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: installation question

Post by cusingerBUSCw5N » Wed Oct 24, 2012 4:09 pm

I saved my app under a new name, signed it using JDK 6, verified the signature and it PASSED! (as before)...

FTP'd it to my server, set up a link to it and downloaded it to my Android and it DOWNLOADED! (as before).... But it was very weird, because it downloaded very quickly and it is a 6MB app.

Clicked to install...and amazingly it installed (as never before)!!! Clicked to open it, and it is a black screen.

Went to see how it looked using test on Livecode (goes to the same android device) - and gets "Installation of app failed - install parse failed inconsistent certificates"

This is an exercise in making me crazy.

qberty1337
Posts: 35
Joined: Sun Sep 09, 2012 1:09 pm

Re: installation question

Post by qberty1337 » Thu Oct 25, 2012 1:15 am

cusingerBUSCw5N wrote: Went to see how it looked using test on Livecode (goes to the same android device) - and gets "Installation of app failed - install parse failed inconsistent certificates"

This is an exercise in making me crazy.
When testing your LiveCode app on your android device, make sure your using a development key (in LiveCode deployment settings). Uninstall the app with the same name but the manual key form your android device so that it doesn't get confused. Here's that scenario:

You are trying to install the LiveCode testing APK on a device with the SAME APK but has been signed with a different certificate (key). Android itself doesn't allow installation of APK's on top of previous APKs with the same name but different key.

That is why you must use the SAME key when signing an app for use with google play. If you lose that key for the app, then google play will no longer accept ANY apks you try to upload as an update for that particular app.

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: installation question

Post by cusingerBUSCw5N » Thu Oct 25, 2012 2:06 am

Thanks for the input. I think I've solved the black screen issue. For some reason, some IOS files were included in the copy files.

I don't know how they were added - since I haven't done any iOS stuff yet, but they seem to cause the blackout. The files are
mergmessage-1.0.1/ios/binaries/mergmessage.dylib
mergmessage-1.0.1/ios/binaries/mergemessage.lcext
mergmessage-1.0.1/ios/binaries/mergmessage-5_1.dylib
mergmessage-1.0.1/ios/binaries/.ds_store

Once I remove them, the android appears to be happy.

Post Reply