Please help me. I have some Angular experience, but new to mobile dev. I really like this developing once and deploy to everywhere idea, so I picked up angular+nativescript.
So I followed the Groceries tutorial and was able to run it under android emulator directly (tns run android) or via Sidekick. And I can deploy to my iPhone via Sidekick and run it without issue too. Then I created an empty app using template **tns-template-tab-navigation-ng**, and still can run it in above 3 ways: 1) Run it in android emulator directly: tns run android 2) Build it in sidekick and deploy to android emulator and run it. 3) Build it in sidekick and deploy to my actual iPhone or iPad and run it successfully. Now I have actually created a real app using the same template **tns-template-tab-navigation-ng** , but I can only do 1) and 2). App runs in Android emulator exactly as I want. But I have problem doing 3). I can still build in Sidekick, and install the app to iPhone/iPad. But when tap the app on the iphone/ipad, the app tries to start then crash, every single time. Here is the error I got in device console:
Unzipping LiveSync folder. This could take a while…
Unzipped 165 entries in 1258.557916ms.
tns_modules folder not livesynced. Using tns_modules from the already deployed bundle…
Retrieving resting unlock: 0
CONSOLE LOG file:///app/tns_modules/@angular/core/bundles/core.umd.js:3130:24: Angular is running in the development mode. Call enableProdMode() to enable the production mode.
-[TNSArrayAdapter isEqualToString:]: unrecognized selector sent to instance 0x10c2421f0
0 initWithTitleImageTag@[native code]
*** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[TNSArrayAdapter isEqualToString:]: unrecognized selector sent to instance 0x10c2421f0’
*** First throw call stack:
(0x182ceed8c 0x181ea85ec 0x182cfc098 0x182cf45c8 0x182bda41c 0x18c947dd4 0x18c947c34 0x101940044 0x10193b954 0x10193b420 0x1010411ac 0x101604f2c 0x10160da74 0x10160da84
So why is this error “unrecognized selector sent to instance”? I really don’t have any iOS specific code in the project. There are a few places like ios.position=“right” etc, and I have commented them out, still the same error.
Kinda stuck now. I don’t have access to macOS, so I cannot try to run it in macOS emulator. I have to run it in a real ios device through Sidekick.
Your help is really appreciated!