Search code examples
nativescriptangular2-nativescriptnativescript-angularnativescript-plugin

Cant run app Nativescript on iOS but runs on android


Cant run app Nativescript on iOS but runs on android My code works ok android with no problems but in iOS i get those erros below. and i have no ideia why, what im missing ???? Its a plugin? Module? Any help would be good cuz im lost here. thanks when i run tns run ios --env.aot --env.uglify.

the erros i get when running the app :

***** Fatal JavaScript exception - application has been terminated. *****
Native stack trace:
1   0x10fe3991f NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
2   0x10fe71b60 NativeScript::FFICallback<NativeScript::ObjCMethodCallback>::ffiClosureCallback(ffi_cif*, void*, void**, void*)
3   0x110812dd6 ffi_closure_unix64_inner
4   0x1108137fa ffi_closure_unix64
5   0x114515d22 -[CALayer layoutSublayers]
6   0x11451a9fc CA::Layer::layout_if_needed(CA::Transaction*)
7   0x114526d58 CA::Layer::layout_and_display_if_needed(CA::Transaction*)
8   0x11449624a CA::Context::commit_transaction(CA::Transaction*)
9   0x1144cd606 CA::Transaction::commit()
10  0x116f942c3 __34-[UIApplication _firstCommitBlock]_block_invoke_2
11  0x115a97cbc __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__
12  0x115a97480 __CFRunLoopDoBlocks
13  0x115a91d04 __CFRunLoopRun
14  0x115a914d2 CFRunLoopRunSpecific
15  0x11b8af2fe GSEventRunModal
16  0x116f7afc2 UIApplicationMain
17  0x11081363d ffi_call_unix64
18  0x12db4cf70
JavaScript stack trace:
1   @file:///node_modules/tns-core-modules/ui/content-view/content-view.js:44:0
2   _eachLayoutView@file:///node_modules/tns-core-modules/ui/core/view/view-common.js:1015:0
3   @file:///node_modules/tns-core-modules/ui/proxy-view-container/proxy-view-container.js:45:0
4   eachChildView@file:///node_modules/tns-core-modules/ui/layouts/layout-base-common.js:125:0
5   _eachLayoutView@file:///node_modules/tns-core-modules/ui/proxy-view-container/proxy-view-container.js:43:0
6   get@file:///node_modules/tns-core-modules/ui/content-view/content-view.js:38:0
7   onMeasure@file:///node_modules/tns-core-modules/ui/page/page.js:272:0
8   measure@file:///node_modules/tns-core-modules/ui/core/view/view.js:55:0
9   measureChild@file:///node_modules/tns-core-modules/ui/core/view/view-common.js:954:0
10  i@file:///node_modules/tns-core-modules/ui/core/view/view.js:636:0
11  viewDidLayoutSubviews@file:///node_modules/tns-core-modules/ui/page/page.js:192:0
12  UIApplicationMain@[native code]
13  S@file:///node_modules/tns-core-modules/application/application.js:277:0
14  run@file:///node_modules/tns-core-modules/application/application.js:305:0
15  bootstrapNativeScriptApp@file:///node_modules/nativescript-angular/platform-common.js:205:0
16  bootstrapApp@file:///node_modules/nativescript-angular/platform-common.js:106:0
17  bootstrapModuleFactory@file:///node_modules/nativescript-angular/platform-common.js:77:0
18  @file:///app/bundle.js:72:449
19  ./main.ts@file:///app/bundle.js:72:477
20  k@file:///src/webpack/bootstrap:750:0
21  n@file:///src/webpack/bootstrap:43:0
22  r@file:///src/webpack/bootstrap:30:0
23  anonymous@file:///src/$_lazy_route_resource lazy namespace object:2:0
24  evaluate@[nat<…>
JavaScript error:
file:///node_modules/tns-core-modules/ui/content-view/content-view.js:44:0 JS ERROR Error: More than one layout child inside a 
1   UIApplicationMain@[native code]
2   S@file:///node_modules/tns-core-modules/application/application.js:277:0
3   run@file:///node_modules/tns-core-modules/application/application.js:305:0
4   bootstrapNativeScriptApp@file:///node_modules/nativescript-angular/platform-common.js:205:0
5   bootstrapApp@file:///node_modules/nativescript-angular/platform-common.js:106:0
6   bootstrapModuleFactory@file:///node_modules/nativescript-angular/platform-common.js:77:0
7   @file:///app/bundle.js:72:449
8   ./main.ts@file:///app/bundle.js:72:477
9   k@file:///src/webpack/bootstrap:750:0
10  n@file:///src/webpack/bootstrap:43:0
11  r@file:///src/webpack/bootstrap:30:0
12  anonymous@file:///src/$_lazy_route_resource lazy namespace object:2:0
13  evaluate@[native code]
14  moduleEvaluation@:1:11
15  promiseReactionJob@:1:11

Solution

  • Well in ios u cant have free templates floating arround everything was too be inside a LayoutContainer

    Android (Works) iOS (Don't Work)

    <GridLayout>
     (... Content)
    </GridLayout>
    
    <GridLayout>
     (... More Content)
    </GridLayout>
    

    Android (Works) iOS (Works)

    <GridLayout> // MAIN CHILD
    
     (... Content)
    
      <GridLayout>
       (... More Content)
      </GridLayout>
    
    </GridLayout>