codenameone / CodenameOne

Cross-platform framework for building truly native mobile apps with Java or Kotlin. Write Once Run Anywhere support for iOS, Android, Desktop & Web.
https://www.codenameone.com/
Other
1.7k stars 403 forks source link

RIM build with push support fails #829

Closed codenameone closed 9 years ago

codenameone commented 9 years ago

Original issue 829 created by codenameone on 2013-08-08T04:48:34.000Z:

Please clearly state whether the issue relates to a device/the simulator or the tools. Build server. If related to a device be sure to specify exactly which device with as much details as possible. Blackberry build

What steps will reproduce the problem?

  1. Set the property of rim.pushBpsURL==https://cp12173.pushapi.eval.blackberry.com
  2. And send RIM build 3.

What is the expected output? What do you see instead?

The build should be successful. Instead the build fails with error as in the attached file.

What version of the product are you using? On what operating system?

Latest version. On Mac. Please provide any additional information below.

codenameone commented 9 years ago

Comment #1 originally posted by codenameone on 2013-08-08T05:26:12.000Z:

Thanks, that's really odd. I must have broken it recently. It should be fixed on the build server now.

codenameone commented 9 years ago

Comment #2 originally posted by codenameone on 2013-08-08T07:06:24.000Z:

It is now giving another set of errors as in the attached error file.

codenameone commented 9 years ago

Comment #3 originally posted by codenameone on 2013-08-08T08:09:37.000Z:

Thanks, this should be fixed now too.

codenameone commented 9 years ago

Comment #4 originally posted by codenameone on 2013-08-08T08:34:27.000Z:

Ok, those errors are gone, however I am getting another error as given in the attached file.

codenameone commented 9 years ago

Comment #5 originally posted by codenameone on 2013-08-08T09:40:45.000Z:

That's a different issue altogether. Its probably been there for a while.

codenameone commented 9 years ago

Comment #6 originally posted by codenameone on 2013-08-08T09:40:57.000Z:

Fixed on the server.

codenameone commented 9 years ago

Comment #7 originally posted by codenameone on 2013-08-08T09:50:29.000Z:

Just tried a build again, but got the same error. Is it already deployed on server?

codenameone commented 9 years ago

Comment #8 originally posted by codenameone on 2013-08-08T10:16:58.000Z:

It is on the server but for some reason this isn't working. I think the only workaround is to build with the obfuscation switch set to false.

codenameone commented 9 years ago

Comment #9 originally posted by codenameone on 2013-08-08T10:34:44.000Z:

Hmm, when I set rim.obfuscation to false, and save, And then when I re-open the project and check the build hints it again becomes true.

codenameone commented 9 years ago

Comment #10 originally posted by codenameone on 2013-08-08T11:03:23.000Z:

ok, I made the property false in codename_settings.properties file and then sent a build. It seems to have progressed further and I got the email from RIM that my code was signed. However on the build server the build seems to be stuck in "building" state only.

codenameone commented 9 years ago

Comment #11 originally posted by codenameone on 2013-08-08T11:40:47.000Z:

Did you try canceling and sending again?

codenameone commented 9 years ago

Comment #12 originally posted by codenameone on 2013-08-08T12:14:08.000Z:

yes, did that. And again it has got stuck in building only since last 50 mins. (Btw I am get successful the signing email msgs from Blackberry).

codenameone commented 9 years ago

Comment #13 originally posted by codenameone on 2013-08-08T12:22:58.000Z:

I'm looking at the build servers for RIM right now and I can't see your build. Can you send one again? Might have been a hickup on App Engine.

codenameone commented 9 years ago

Comment #14 originally posted by codenameone on 2013-08-08T12:41:52.000Z:

I had cancelled that again. Just now sent one more RIM build request.

codenameone commented 9 years ago

Comment #15 originally posted by codenameone on 2013-08-08T13:02:01.000Z:

Did it pass? On the server it seems to have passed.

codenameone commented 9 years ago

Comment #16 originally posted by codenameone on 2013-08-08T13:04:15.000Z:

yes, this time it passed. Thanks

codenameone commented 9 years ago

Comment #17 originally posted by codenameone on 2013-08-08T15:17:22.000Z:

Even though the build passed and the app got installed in the device. But when I start the app, it causes an exception and crashes saying: Error starting S2PayApp5: Module 'S2PayApp5-1' has verification error 190 at offset 6c21"

How to debug this further?

codenameone commented 9 years ago

Comment #18 originally posted by codenameone on 2013-08-08T16:45:12.000Z:

I think this is related to the Codescan library. I don't think its working anymore for some reason. If you comment out the scan code does it work then?

codenameone commented 9 years ago

Comment #19 originally posted by codenameone on 2013-08-09T11:16:00.000Z:

I comment out codescan library and then built a new version. It is still giving following error and does not start.

"Error starting S2PayApp5: Module 'S2PayApp5-1' has verification error 190 at offset 6998 (codfile version 78)"

codenameone commented 9 years ago

Comment #20 originally posted by codenameone on 2013-08-09T11:34:00.000Z:

Odd. If you build with obfuscation (to strip out that code) would that work? If you build a hello world would that work?

codenameone commented 9 years ago

Comment #21 originally posted by codenameone on 2013-08-09T13:57:44.000Z:

ok, if I build a hello world app, then it works.

If I try to build my app with obfuscation, then the build fails with the attached error.

codenameone commented 9 years ago

Comment #22 originally posted by codenameone on 2013-08-09T13:58:11.000Z:

Here's the error.txt for previous comment.

codenameone commented 9 years ago

Comment #23 originally posted by codenameone on 2013-08-09T18:39:31.000Z:

This is weird. Can you look in the alt-lglg log after you get the verification error and see what is written there. It should usually provide more details about the failed class/screen.

codenameone commented 9 years ago

Comment #24 originally posted by codenameone on 2013-08-10T01:43:12.000Z:

Checked the alt lglg logs and it shows following: Linker error VM.VECPs=com.codename1.impl.blackberry.codescan VM:VECCs=CodeScannerImpl VM:VECMm=callDecode()

Even though I have commented the calls to CodeScanner in my app.

codenameone commented 9 years ago

Comment #25 originally posted by codenameone on 2013-08-10T04:31:52.000Z:

That probably means that for some reason its still included. Its the only portion of the code we have in binary form so the bug might be in there but we can't fix it. I have an idea for a workaround but it won't be trivial, I suggest you file a different issue to cover that.

codenameone commented 9 years ago

Comment #26 originally posted by codenameone on 2013-08-10T12:40:29.000Z:

Thanks Shai, a separate issue 831 is created for it.

codenameone commented 9 years ago

Comment #27 originally posted by codenameone on 2013-08-12T13:51:21.000Z:

ok, now I am able to run my app on the device, however the push registration fails with following error:

java.io.IOException: APN is not specified

I have specified the following rim related push properties in codename_settings.

rim.pushAppId rim.pushPort rim.pushBpsURL rim.ignor_legacy=true rim.includePush=true

codenameone commented 9 years ago

Comment #28 originally posted by codenameone on 2013-08-12T15:01:45.000Z:

Does networking work on this device? Do you configure APN manually in code?

codenameone commented 9 years ago

Comment #29 originally posted by codenameone on 2013-08-12T15:57:51.000Z:

Yes networking is working on this device and currently it is using WIFI.

I am not configuring APN manually in code.

codenameone commented 9 years ago

Comment #30 originally posted by codenameone on 2013-08-12T16:53:29.000Z:

Do you have a stack for that exception? Maybe from the alt-lglg

codenameone commented 9 years ago

Comment #31 originally posted by codenameone on 2013-08-13T08:21:31.000Z:

Here's the relevant stack trace from the alt-lglg:

a CN1 - [Thread-371310592] 0:1:3,732 - pushRegistrationError currentForm[{}] error[{}] errorCode[{}]null,java.io.IOException: APN is not specified.,1, - 8/13 13:38:45 d net.rim.blackberry.api.push - Ansc 8 - 8/13 13:38:45 d net.rim.blackberry.api.push - Bsto - 8/13 13:38:45 W net.rim.blackberry.api.push - Berr java.io.IOException: APN is not specified. - 8/13 13:38:45 a net.rim.tcp - open tcpsocket://cp12173.pushapi.eval.blackberry.com:443;interface=cellular

i net.rim.networkapi - FatF java.io.IOException: APN is not specified.

codenameone commented 9 years ago

Comment #32 originally posted by codenameone on 2013-08-13T09:39:00.000Z:

I have no idea? Can you disable/enable APN in the settings? Make sure its configured correctly? The IOException is without a stack trace so its effectively useless and the tcp networking done internally seems to connect to cellular while our networking tries to use your wifi connection.

codenameone commented 9 years ago

Comment #33 originally posted by codenameone on 2013-08-13T10:34:30.000Z:

ok, I tried to enable APN settings and after that I am getting following error:

i net.rim.networkapi - FatF java.lang.IllegalStateException: no application instance - 8/13 15:44:03 i net.rim.networkapi - Fatf 1 - 8/13 15:44:02 a net.rim.tcp - open tcpsocket://cp12173.pushapi.eval.blackberry.com:443;interface=cellular

Does that gives any hint what could be the issue?

codenameone commented 9 years ago

Comment #34 originally posted by codenameone on 2013-08-13T13:22:55.000Z:

ok, I enabled Blackberry Internet Service (BIS) also on my phone. After that I guess it is going a bit further, but gave following error and log is attached in the file.

codenameone commented 9 years ago

Comment #35 originally posted by codenameone on 2013-08-13T16:21:43.000Z:

I'm still stumped by this? Do you have other applications that use push on this device? Does e.g. does whatsup work with push on blackberry? Can you try it?

codenameone commented 9 years ago

Comment #36 originally posted by codenameone on 2013-08-13T18:57:15.000Z:

I installed whatsapp on this blackberry device and it is working with push and getting all the msgs.

I have pasted the alt-lglg logs in case anything there helps:

BlackBerry Event Log (cpt)

HwID: 0x8c000f03

DPIN: 0x274529cd

PVer: 5.2.0.104

AVer: 5.0.0.1036

a System - JVM:INFOp=274529cd,a='5.0.0.1036',o='5.2.0.104',h=8c000f03

codenameone commented 9 years ago

Comment #37 originally posted by codenameone on 2013-08-14T05:32:52.000Z:

They seem to be using their own push servers and not RIM's push servers. Are you using the URL information and device side port you got from RIM? Can you think of an application that uses the RIM public push servers?

codenameone commented 9 years ago

Comment #38 originally posted by codenameone on 2013-08-14T06:48:31.000Z:

Yes, I am using the blackberry push evaluation URL and device side port which I got from RIM.

Don't know off hand, but I will search for another app which might be using the RIM public push servers.

NVSoft

http://www.nvsoft.com

DISCLAIMER: This e-mail and any attachment(s) is for authorized use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to the legal privilege of the sender of this email. If you have received this message in error, please notify the originator immediately and destroy the material in its entirety, whether electronic or hard copy. If you are not the intended recipient, you are notified that you are strictly prohibited from retaining, using, copying, alerting or disclosing the content of this message. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Net Vigil Software Private Limited. The recipient should check this email and any attachments for the presence of viruses. Net Vigil Software Private Limited accepts no liability for any damage caused by any virus transmitted by this email. Thank you for your co-operation.

codenameone commented 9 years ago

Comment #39 originally posted by codenameone on 2013-08-15T17:02:44.000Z:

Unfortunately I am not able to find any app on blackberry world store which may be using public push server. Can you send me any of your sample app with your rim key which I can try? As I am using the correct values of my rim push evaluation setup. Don't know how to otherwise debug this further without knowing what is happening underneath the push registration code.

codenameone commented 9 years ago

Comment #40 originally posted by codenameone on 2013-08-15T18:23:02.000Z:

More unfortunate is the fact that we can't get it to work either because we aren't paying the blackberry subscription costs for our operator. So we can't test it either. Blessing was able to test it though and I implemented the logic, its working for him so maybe you guys can workout a test case exchange program?

codenameone commented 9 years ago

Comment #41 originally posted by codenameone on 2013-09-11T05:28:19.000Z:

Hi Shai,

I am trying to debug the blackberry push issue by doing a local build, however I am running into an issue where it is failing due to the following error:

Application is not instanceof PushApplication. It couldn't be started.

I checked the blackberry push sample app and it seems, our app needs to implement the PushApplication interface. Is it possible, for you to share a sample AppStub which is generated by the build server for push based RIM app.

codenameone commented 9 years ago

Comment #42 originally posted by codenameone on 2013-09-13T15:55:06.000Z:

As far as I can tell we just add the net.rim.blackberry.api.push.PushApplication interface to the main generated class then just implement the methods of that interface: public void onMessage(net.rim.device.api.io.http.PushInputStream stream, javax.microedition.io.StreamConnection sc) { com.codename1.impl.blackberry.BlackBerryOS5Implementation.onMessage(stream, sc); } public void onStatusChange(net.rim.blackberry.api.push.PushApplicationStatus pas) { com.codename1.impl.blackberry.BlackBerryOS5Implementation.onStatusChange(pas); }

codenameone commented 9 years ago

Comment #43 originally posted by codenameone on 2013-09-14T19:46:51.000Z:

Hi Shai,

I tried with the Blackberry Sample push application on the same device and used it to register for push to Sample push initiator which RIm has provided. With that sample application the push is working fine on this device. So it means the device configuration and the push evaluation details for my registration is fine.

However when I try to use the codenameone built application(using build server), it is giving the following error during registration:

W net.rim.blackberry.api.push - Berr net.rim.device.cldc.io.ippp.SocketBaseIOException: Connection reset by peer

Anything else we can try out?

codenameone commented 9 years ago

Comment #44 originally posted by codenameone on 2013-09-15T04:56:15.000Z:

Do you have more of that stack? Does it lead to our code at some point?

codenameone commented 9 years ago

Comment #45 originally posted by codenameone on 2013-09-15T08:12:18.000Z:

I have attached the full stack trace. Can't figure out where the exception is coming from.

codenameone commented 9 years ago

Comment #46 originally posted by codenameone on 2013-09-17T05:08:33.000Z:

It looks that someone is catching that exception and not invoking printStackTrace. I googled a bit and this seems to be related to that exception: http://forum.astrasync.com/Default.aspx?g=posts&m=6856

Hopefully it helps.

codenameone commented 9 years ago

Comment #47 originally posted by codenameone on 2013-09-17T14:17:30.000Z:

Hi Shai,

When testing with the blackberry push sample demo app, I was using the BB_PUSH_URL which was starting with "https". It was working with it. However it seems to be causing the socket error in our code. I changed it to "http" and tried it again, now it is not giving the socket error. However it is not calling the registeredForPush() callback on my main application class.

I don't see any code in the blackberry port that might be calling it either? Is it part of the Stub that gets generated on the server side?

In any case, even with my app built using the server, the callback "registeredForPush()" is not getting called. Can you please check that?

Thanks, Nirmal

PS. I have attached logs which happens after calling registerForPush

codenameone commented 9 years ago

Comment #48 originally posted by codenameone on 2013-09-18T04:55:22.000Z:

That seems to be missing. I'll add it to the BB 5 port right now.

codenameone commented 9 years ago

Comment #49 originally posted by codenameone on 2013-09-18T19:27:48.000Z:

Hi Shai, Is this on build server also?

Somehow when I run my app now, it does cause any push request logs or Connection requests to the blackberry pusheval API

codenameone commented 9 years ago

Comment #50 originally posted by codenameone on 2013-09-19T10:53:54.000Z:

Hi Shai,

I have made one change to the BlackberryOS5Implementation in the registerPush() method: Index: Ports/BlackBerryOS_5/src/com/codename1/impl/blackberry/BlackBerryOS5Implementation.java

--- Ports/BlackBerryOS_5/src/com/codename1/impl/blackberry/BlackBerryOS5Implementation.java (revision 1474)
+++ Ports/BlackBerryOS_5/src/com/codename1/impl/blackberry/BlackBerryOS5Implementation.java (working copy)
@@ -721,6 +721,7 @@
         byte pasStatus = pushApplicationStatus.getStatus();
         if( pasStatus == PushApplicationStatus.STATUS_ACTIVE ) {
             // we already registered, update the statuses
+       onStatusChange(pushApplicationStatus);
             return;
         } else if( pasStatus == PushApplicationStatus.STATUS_PENDING ) {

As shown above for the plus line. May be this is needed, in case due to some reason the app was registered but local client app callback was not done.

After that it is able to register for push and getting a cn1 push id.

Thanks,
Nirmal