|
FORUMS PROFESSIONNELS WINDEV, WEBDEV et WINDEV Mobile |
| | | | | |
| Android-WDM17 - I am in Keytool / Jarsigner / MapControl Hell |
| Débuté par guest, 02 jan. 2013 09:32 - 2 réponses |
| |
| | | |
|
| |
| Posté le 02 janvier 2013 - 09:32 |
Greetings All,
For the past three days I have been on an Odyssey learning about keystores and signing apps in an attempt to get my Map Control to work. Apparently it does not work unless you sign your app AND you provide a valid key that corresponds to the SHA1 print and your Package.
I am using the Keytool that comes with Eclipse Juno in the ADT Android SDK Bundle.
I am able to create a keystore (.jks) file. But when I reference it during the Android deployment I get the following error:
Failure creating the Android application named . Reason: Failure signing the generated Android archive. An error was returned by the tool for archive signature. Possible solutions: - Check the parameters specified in the command line of the tool for archive signature. - Check whether the passwords specified for the key file and for the key are correct. - Generate a new key file (delete the existing key file). (See the error below to define the correction to perform). Command Line: "C:\Program Files\Java\jdk1.7.0_01\in\jarsigner.exe" -keystore "C:\Documents and Settings\Administrator\.android\interrasys-keystore\interrasys3.keystore.jks" -storepass xxxxxxxx -keypass xxxxxxxx -digestalg SHA1 -sigalg SHA1withDSA "MapControlTest.apk" interrasys3 Error returned: jarsigner error: java.security.SignatureException: private key algorithm is not compatible with signature algorithm I found what I think is the solution to the problem at this website:
http://www.basic4ppc.com/forum/bugs-wishlist/20383-code-signing-failure-sha1dsa.html
So I changed the commands associated with the deployment from this:
-keystore "C:\Documents and Settings\Administrator\.android\interrasys-keystore\interrasys3.keystore.jks" -storepass xxxxxxxx -keypass xxxxxxxx -digestalg SHA1 -sigalg SHA1withDSA "MapControlTest.apk" interrasys3
To this:
-keystore "C:\Documents and Settings\Administrator\.android\interrasys-keystore\interrasys3.keystore.jks" -storepass xxxxxxxx -keypass xxxxxxxx -digestalg SHA1 -sigalg SHA1withRSA "MapControlTest.apk" interrasys3 Essentially SHA1withDSA becomes SHA1withRSA.
After that change, I was able to deploy my app without an error.
I also went to https://code.google.com/apis/console/… and created a new Android Google key
It 'appears' that WinDev Mobile's thinks that you need to provide an MD5 print and it displays your MD5 pring from your signing key in the window when you click 'Get a Key' during the deployment process.
It then provides a link (an old link) to get http://code.google.com/android/maps-api-signup.html
But then you get re-directed to: https://developers.google.com/maps/documentation/android/
Here I created a new key using my SHA1 print (which is what it seems that they require now along with ';' and the name of my package as:
20:8X:09:71:8X:7C:42:X8:X3:30:X6:43:41:X4:3X:21:2X:5X:AX:X6;com.flytetymelimo.vaa_airport_coordinator_ii
And then then I get my new key as: XIzaXyXq0XXXqdbaXX4gG-98_ciphzXXXXmn8XX
I use that key for the deployment of my Android map that has a Map Control.
My project has code to add two markers. I 'see' the markers, but I only see a grid with the word 'Google' in the lower left corner. I also see a zoom control.
Question, please...
Does this all seem to make sense? Or am I going about this all wrong?
If I saw an error while loading the Map Control then I would know that my key is wrong, right?
If I could not deploy the app then I would know that my SHA1 print was wrong, right?
By the way...PC-SOFT should change something the following in the Android deployment process. On the page entitled, 'Signature of the application', I think it where it says 'Name of private key:' it should show as 'Alias:'. Because that is what I am using in this field. If I was wrong on that I would think that I would not be able to deploy my app with these credentials.
I am still stuck, so if someone can provide some pointers I would really, really appreciate it.
Thanks and Happy New Year!!
Paul |
| |
| |
| | | |
|
| | |
| |
| Posté le 02 janvier 2013 - 09:33 |
All,
I am trying to experiment with some different jarsigner parameters...
When I change them it creates the .apk file but it will not deploy. I am getting a message stating:
"The 'com.flytetymelimo.vaa_airport_coordinator_ii' application is already found on the device with a different signature. Do you want to uninstall it and retry the setup?"
This is an odd message because I have already deleted the app from the device and rebooted the device.
Again, thanks for any pointers.
This can't be as hard as I am making it. 
Best,
Paul |
| |
| |
| | | |
|
| | |
| |
| Posté le 03 janvier 2013 - 07:50 |
Greetings All,
I just thought I would document the solution for getting the Map Control to work.
First of all the solution comes from Arie Mars (Thank you!!).
Apparently the Map Control only works with Google Maps API Version 1 (V1).
It 'appears' that WinDev Mobile's thinks that you need to provide an MD5 print and it displays your MD5 print from your signing key in the window when you click 'Get a Key' during the deployment process.
It then provides a link (an old link) to:
http://code.google.com/android/maps-api-signup.html
But then you get re-directed to:
https://developers.google.com/maps/documentation/android/
That's a PROBLEM because you are re-directed to get a Google Maps API V2 key that is NEVER going to work!!
As far as I can tell you can create all of the V2 version keys you want. But they won't work with the WDM17 Map Control.
Arie Mars pointed this out along with the link to the correct page to get the Google Maps V1 API Key. Here it is:
https://developers.google.com/maps/documentation/android/v1/maps-api-signup…
Here is some sample code that I am still working on. I currently have it running the in initialization code of the Map Control (MAP_FT_MAP):
gsTestmode = "True" // Delete all the markers from the control MapDeleteAll() // Returns the point of the map corresponding to the current position of the user MyPosition is géoPosition IF gsAirport = "JFK" THEN MyPosition..Latitude = grVAA_JFK_LAT MyPosition..Longitude = grVAA_JFK_LONG ELSE IF gsAirport = "EWR" THEN MyPosition..Latitude = grVAA_EWR_LAT MyPosition..Longitude = grVAA_EWR_LONG END MyMarker is Marker MyMarker..Position = MyPosition MyMarker..Name = "Me" MapAddMarker(MAP_FT_Map,MyPosition) CarPosition is géoPosition IF gsTestmode = "True" THEN CarPosition..Latitude = 40.64375 CarPosition..Longitude = -73.78403 ELSE CarPosition..Latitude = grCar_lat CarPosition..Longitude = grCar_long END CarMarker is Marker CarMarker..Position = CarPosition //CarMarker..Image = "1234.png" CarMarker..Name = gsCarNo CarMarker..Description = "CAR 1234" MapAddMarker(MAP_FT_Map,CarMarker) MAP_FT_Map..Zoom = 19 MapDisplayPosition(MAP_FT_Map, MyPosition) //PROCEDURE ProcMarkerClick(MyMa rk is Marker) //ToastDisplay(StringBuild("Position: %1 N, %2 E ", MAP_FT_Map..MyPosition..Latitude, MAP_FT_Map..MyPosition..Longitude)) I am still having trouble with managing the following attributes for marker objects (none of them seem to work): CarMarker..Image = "1234.png" CarMarker..Name = gsCarNo CarMarker..Description = "CAR 1234" Anyway, the good news is that I am back in business and I now have a high level of confidence that the app will be ready for production on 1/10/13 (Thanks to Arie and Derek).
Paul |
| |
| |
| | | |
|
| | | | |
| | |
| | |
| |
|
|
|