Skip to content

Crash on [runtime executeModule:@"./"]; #923

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ObelixSoftware opened this issue May 18, 2018 · 5 comments
Closed

Crash on [runtime executeModule:@"./"]; #923

ObelixSoftware opened this issue May 18, 2018 · 5 comments
Assignees

Comments

@ObelixSoftware
Copy link

On IOS app when compiled and deployed over Test Flight from iTunes connect I get a crash on:

[runtime executeModule:@"./"];

It works fine if i run it directly from XCode or with a Adhoc certificate over Hockey App.

  • CLI: 4.0.0
  • Cross-platform modules: 4.0.0
  • Runtime(s):

iOS 4.0.1
Android 4.0.1

  • Plugin(s):

"dependencies": {
"lodash": "^4.17.5",
"nativescript-camera": "^4.0.0",
"nativescript-carousel": "^3.1.1",
"nativescript-chatview": "^1.0.3",
"nativescript-checkbox": "^3.0.3",
"nativescript-dom": "^2.0.0",
"nativescript-drop-down": "^3.2.1",
"nativescript-exit": "^1.0.1",
"nativescript-modal-datetimepicker": "^1.0.3",
"nativescript-plugin-firebase": "^5.3.1",
"nativescript-pro-ui": "^3.3.0",
"nativescript-slides": "^2.2.12",
"nativescript-theme-core": "~1.0.2",
"tns-core-modules": "^4.0.0"
},
"devDependencies": {
"babel-traverse": "6.26.0",
"babel-types": "6.26.0",
"babylon": "6.18.0",
"lazy": "1.0.11"
}

@tdermendjiev
Copy link
Contributor

Hello @ObelixSoftware
Would you please provide a crash log with the call stack? Thank you.

@tdermendjiev tdermendjiev self-assigned this Aug 13, 2018
@diggymo
Copy link

diggymo commented Sep 9, 2018

tha same issue for me.

the log is below.

my code is here

log▼

2018-09-09 20:36:01.633645+0900 dist[402:51811] ***** Fatal JavaScript exception - application has been terminated. *****
2018-09-09 20:36:01.634316+0900 dist[402:51811] Native stack trace:
2018-09-09 20:36:01.643431+0900 dist[402:51811] 1   0x100d8373c NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool, bool)
1   0x100d8373c NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool, bool)
2018-09-09 20:36:01.643645+0900 dist[402:51811] 2   0x100db4068 -[TNSRuntime executeModule:referredBy:]
2   0x100db4068 -[TNSRuntime executeModule:referredBy:]
2018-09-09 20:36:01.646966+0900 dist[402:51811] 3   0x10049a510 main
3   0x10049a510 main
2018-09-09 20:36:01.647073+0900 dist[402:51811] 4   0x180f41fc0 <redacted>
4   0x180f41fc0 <redacted>
2018-09-09 20:36:01.647773+0900 dist[402:51811] JavaScript stack trace:
2018-09-09 20:36:01.647847+0900 dist[402:51811] 1   @[native code]
2   promiseReactionJob@[native code]
2018-09-09 20:36:01.647876+0900 dist[402:51811] JavaScript error:
2018-09-09 20:36:01.648033+0900 dist[402:51811] [native code]: JS ERROR Error: Could not find module './'. Computed path '/var/containers/Bundle/Application/10631D5A-0C7B-4A20-8FD9-CB078E535860/dist.app/app'.

[native code]: JS ERROR Error: Could not find module './'. Computed path '/var/containers/Bundle/Application/10631D5A-0C7B-4A20-8FD9-CB078E535860/dist.app/app'.
2018-09-09 20:36:01.656212+0900 dist[402:51811] *** JavaScript call stack:
(

)
2018-09-09 20:36:01.656396+0900 dist[402:51811] *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: Error: Could not find module './'. Computed path '/var/containers/Bundle/Application/10631D5A-0C7B-4A20-8FD9-CB078E535860/dist.app/app'.
 at 
1   @[native code]
2   promiseReactionJob@[native code]
', reason: '(null)'
*** First throw call stack:
(0x1815ead8c 0x1807a45ec 0x100d83e60 0x100db4068 0x10049a510 0x180f41fc0)
libc++abi.dylib: terminating with uncaught exception of type NSException
warning: could not execute support code to read Objective-C class data in the process. This may reduce the quality of type information available.
(lldb) 

code▼

//
// Any changes in this file will be removed after you update your platform!
//

#include <Foundation/Foundation.h>
#include <JavaScriptCore/JavaScriptCore.h>
#include <NativeScript/NativeScript.h>
#include <TNSExceptionHandler.h>

#if DEBUG
#include <TNSDebugging.h>
#include <TKLiveSync.h>
#endif

int main(int argc, char *argv[]) {
  @autoreleasepool {
    TNSRuntime* runtime = [TNSRuntimeInstrumentation profile: @"main" withBlock: ^{
      __block NSString* applicationPath = [NSBundle mainBundle].bundlePath;

#if DEBUG
      [TNSRuntimeInstrumentation profile:@"Debug: Lifesync & Syslog" withBlock: ^{
        TNSInitializeLiveSync();
        if (getenv("TNSApplicationPath")) {
          applicationPath = @(getenv("TNSApplicationPath"));
        }
        [TNSRuntimeInstrumentation initWithApplicationPath:applicationPath];
        [TNSRuntimeInspector setLogsToSystemConsole:YES];
        return (id)nil;
      }];
#endif

      extern char startOfMetadataSection __asm("section$start$__DATA$__TNSMetadata");
      [TNSRuntime initializeMetadata:&startOfMetadataSection];
      TNSRuntime *runtime = [[TNSRuntime alloc] initWithApplicationPath:applicationPath];
      [runtime scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];
          
#if DEBUG
      [TNSRuntimeInstrumentation profile:@"Debug: Wait for JavaScript debugger" withBlock: ^{
        TNSEnableRemoteInspector(argc, argv, runtime);
        return (id)nil;
      }];
#endif

      TNSInstallExceptionHandler();
      return runtime;
    }];

    [runtime executeModule:@"./"];     // It's something wrong.

    return 0;
  }
}

@mbektchiev
Copy link
Contributor

@diggymo This error occurs when the app/app.js file is missing or has been renamed. I managed to run the application successfully and hope that you no longer face the issue. If you do experience any problems, please write back with instructions how to reproduce them.

@mbektchiev
Copy link
Contributor

Closing due to inactivity.

@SephReed
Copy link

SephReed commented Oct 2, 2019

You might want to see this issue if you're trying to run on iOS:

NativeScript/nativescript-cli#4846

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants