build with kwik & corona cards

Hi,

I have created a book using corona/kwik and I have tried to run it on iOS using CoronaCards and followed steps given in http://docs.coronalabs.com/daily/coronacards/ios/index.html

I can open the book in Corona simulator just fine, but on iOS using CoronaCards I get the error bellow. Should I do something else with the build of the book or…? 

Thanks for the solution.

Error:

[AppDelegate view]: unrecognized selector sent to instance 0xad42d30

2014-08-11 18:37:02.281 DemoCorona[4592:60b] Generic error

NSInvalidArgumentException: -[AppDelegate view]: unrecognized selector sent to instance 0xad42d30

(

0   CoreFoundation                      0x033441e4 __exceptionPreprocess + 180

1   libobjc.A.dylib                      0x0026f8e5 objc_exception_throw + 44

2   CoreFoundation                      0x033e1243 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275

3   CoreFoundation                      0x0333450b ___forwarding___ + 1019

4   CoreFoundation                      0x033340ee _CF_forwarding_prep_0 + 14

5   DemoCorona                          0x00015fe9 _ZNK3Rtt12IPhoneDevice18BeginNotificationsENS_15MPlatformDevice10_EventTypeE + 777

6   DemoCorona                          0x0009ef8c _ZN3Rtt12LuaLibSystem13BeginListenerEP9lua_State + 140

7   DemoCorona                          0x00059502 luaD_precall + 802

8   DemoCorona                          0x0006c8a8 luaV_execute + 1736

9   DemoCorona                          0x00059957 luaD_call + 119

10  DemoCorona                          0x0005014b lua_call + 43

11  DemoCorona                          0x000605ec ll_require + 588

12  DemoCorona                          0x00059502 luaD_precall + 802

13  DemoCorona                          0x0006c8f7 luaV_execute + 1815

14  DemoCorona                          0x00059957 luaD_call + 119

15  DemoCorona                          0x0005014b lua_call + 43

16  DemoCorona                          0x000605ec ll_require + 588

17  DemoCorona                          0x00059502 luaD_precall + 802

18  DemoCorona                          0x0006c8f7 luaV_execute + 1815

19  DemoCorona                          0x00059957 luaD_call + 119

20  DemoCorona                          0x000502a1 f_call + 33

21  DemoCorona                          0x0006da32 luai_objcttry + 34

22  DemoCorona                          0x00059c98 luaD_pcall + 104

23  DemoCorona                          0x0005025e lua_pcall + 238

24  DemoCorona                          0x00090977 _ZN3Rtt10LuaContext6DoCallEP9lua_Stateii + 103

25  DemoCorona                          0x00090b45 _ZN3Rtt10LuaContext6DoFileEP9lua_StatePKcib + 101

26  DemoCorona                          0x00091619 _ZN3Rtt10LuaContext6DoFileEPKcbi + 41

27  DemoCorona                          0x000b0c64 _ZN3Rtt12LoadMainTaskclERNS_9SchedulerE + 324

28  DemoCorona                          0x000b36ae _ZN3Rtt9Scheduler3RunEv + 110

29  DemoCorona                          0x000b2f6f _ZN3Rtt7RuntimeclEv + 47

30  DemoCorona                          0x00004265 -[CoronaView runWithPath:parameters:orientation:] + 501

31  DemoCorona                          0x00004029 -[CoronaView run] + 57

32  DemoCorona                          0x00003416 -[ViewController viewDidLoad] + 726

33  UIKit                               0x01fa633d -[UIViewController loadViewIfRequired] + 696

34  UIKit                               0x01fa65d9 -[UIViewController view] + 35

35  UIKit                               0x01ec6267 -[UIWindow addRootViewControllerViewIfPossible] + 66

36  UIKit                               0x01ec65ef -[UIWindow _setHidden:forced:] + 312

37  UIKit                               0x01ec686b -[UIWindow _orderFrontWithoutMakingKey] + 49

38  UIKit                               0x01ed13c8 -[UIWindow makeKeyAndVisible] + 65

39  UIKit                               0x01e81bc0 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 2097

40  UIKit                               0x01e86667 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 824

41  UIKit                               0x01e9af92 -[UIApplication handleEvent:withNewEvent:] + 3517

42  UIKit                               0x01e9b555 -[UIApplication sendEvent:] + 85

43  UIKit                               0x01e88250 _UIApplicationHandleEvent + 683

44  GraphicsServices                    0x04341f02 _PurpleEventCallback + 776

45  GraphicsServices                    0x04341a0d PurpleEventCallback + 46

46  CoreFoundation                      0x032bfca5 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53

47  CoreFoundation                      0x032bf9db __CFRunLoopDoSource1 + 523

48  CoreFoundation                      0x032ea68c __CFRunLoopRun + 2156

49  CoreFoundation                      0x032e99d3 CFRunLoopRunSpecific + 467

50  CoreFoundation                      0x032e97eb CFRunLoopRunInMode + 123

51  UIKit                               0x01e85d9c -[UIApplication _run] + 840

52  UIKit                               0x01e87f9b UIApplicationMain + 1225

53  DemoCorona                          0x000038c7 main + 135

54  libdyld.dylib                       0x03973701 start + 1

)

Corona Cards is not a full implementation of Corona SDK.  Some things that Corona SDK does for customers are handled in native land with Corona Cards.  We don’t know what Kwik is doing under the hood and what features they are using that we may be expecting people to handle in native code. 

My advise is to get up with folks over at Kwik and see what API’s they might be using that are not part of the CoronaCards set.

Rob

You could package it up and send it in as a Bug Report.  I’m going to ask engineering to see if they recognize the error and see if they can point us in a direction. 

Rob

Odisej - as a quick initial check - have you been able to run a simple sample app in CoronaCards and have it working fine?

Yes, we were able to run flappybat app in coronacards.

Odisej - Since we cannot directly support Kwik, we have not tested a Kwik-made app in CoronaCards. What probably needs to be done is some investigation of the features you are using and which may be using an API that is not supported in CoronaCards. Have you tried stripping out a few of the main things to see if that allows it to work?

Odisej - to be clear we are not saying this will not work. We are saying that it’s just a matter of narrowing things down slightly to figure out which one is the offending API. It may not be much work - just some experimenting back and forth by stripping out sections of the app in Kwik.

Conceptually it should work - but clearly Kwik is using some API that is causing problems in CoronaCards. This of course assumes that it is otherwise set up correctly.

That’s why I would suggest the following:

  1. Do a *very* simple Kwik app and see if that runs on CC

  2. Then add high level functionality (nothing fancy) a step at a time and see where it stops working

That should fairly quicky lead to some sense of what is causing the issue.

so, we tried with very basic build - one page, no animation no interaction but we still get the same error.

we are using latest corona sdk and corona cards.

David/Rob,

Let me politely disagree with your comments about “__Since we cannot directly support Kwik, we have not tested a Kwik-made app in CoronaCards.”, especially because I have seen it already in other forums.

 

An app made with Kwik is not different than an app made “manually” by a developer so, I honestly do not understand how you are not even able to take a look at the main.lua file. Would you check that if the user haven’t mentioned “Kwik made app”?

 

Anyways, I opened the basic project (it is super basic in fact, just 1 page with images positioned) sent by OUR customer. I am not familiar with Corona Cards, as I told you before so, maybe what I say here is not 100% accurate, especially not having further details from their Documentation page on what can or cannot be done. The only thing I found in the main.lua:

  • Kwik adds code to control the Back button on Android (lines 34 till 54 - well documented in the code), which uses CL native.* api - you may try to remove it to see if your project will work.

 

Again, a quick look - less than a minute, and your team would catch that!

 

I cannot change your opinion/policy/whatever but, I thought it would be interesting to share my views here. I really don’t think it is fair to a Corona customer (after all Kwik users are Corona customers) to get a reply back saying you are not even opening their projects.

 

Regards,

Alex

Alex,

Our response to this had nothing to do with this being a Kwik app. We are pretty consistent in the forums about not being able to open everyone’s project and giving customized support. If we did that, there would be little time for anything else.

Our response here was to request that the customer narrow down the issue as much as possible. And that is what we always request of people - to narrow things down to where we can give actual help in the forum or be able to identify a possible bug or other issue.

If in this case it was only a minute of time, it could have equally been 30 minutes of delving through code to figure something out. There is no way of knowing ahead of time. And doing that for everyone that has an issue on our forum would be prohibitive.

So that is where we are coming from.

David, 

Giving lots of support myself, I really understand how painful it can be (specially in your case, being MUCH bigger than Kwiksher). The reason I wrote the text above is because Rob asked a small project to be sent for the Bug Report team.

Cheers!

So, here is update on this problem…

 

Thank you Alex for your input, hopefully we will reach the solution soon, we are still not giving up on this issue. 

 

We removed lines from main.lua , 34 to 54 which were meant for Android, we also removed android part from build.settings, but still found no luck, even if we tried our simple one image demo build with no interaction and animation :( 

 

Flappybat demo for corona cards (we can open flappybat) is using storyboard but our build is made using composer - is corona cards ok with composer?

Odisej - I’ll see if someone can take a look at this sometime today or tomorrow. Again, the problem is that we have no idea how long this is going to take and we can’t do this individualized support.

Do you have a sense of what are the APIs that are being called in a very simple Kwik project?

Thank you David. I am sending a simple build made with kwik on your email - I hope you will be able to solve the problem.

Odisej - the last part of my message was also a question: when you create a simple Kwik project, have you seen which APIs are being called by quick in the resulting Lua file? Any chance you have a list of those?

Here is a list of APIs that are not supported in CoronaCards:

http://docs.coronalabs.com/coronacards/index.html#sdkenterprise-compatibility

Alex - from a quick pass, does a standard Kwik project call any of these APIs?

Odisej,

You don’t need the media api for playing audio. Media will be required for recording audio in your app, which does not seem to be the case here.

David, this is what Kwik may be using, depending of the project. For example:

  • projects with Ads will use the ads api;

  • projects with in-app purchase will use the store api;

  • same for the native (projects taking screenshots of canvas pages, rate app, fonts use the native.systemFont, textInput uses keyboard, map view, video and web view, showAlerts, cancelAlert/requestExit on Android projects) and media (for projects with video and recording audio) apis (I sent this info to Odisej a few days ago):

Thanks guys - although the question is not so much which APIs could be used under other circumstances. Rather, if any of the “missing” APIs are being used by default in a simple Kwik project. Is that the case by any chance?

If it isn’t that, perhaps it might be something around memory management, or events?

Corona Cards is not a full implementation of Corona SDK.  Some things that Corona SDK does for customers are handled in native land with Corona Cards.  We don’t know what Kwik is doing under the hood and what features they are using that we may be expecting people to handle in native code. 

My advise is to get up with folks over at Kwik and see what API’s they might be using that are not part of the CoronaCards set.

Rob

You could package it up and send it in as a Bug Report.  I’m going to ask engineering to see if they recognize the error and see if they can point us in a direction. 

Rob