Notalib / nativescript-webview-ext

Nativescript plugin with extended WebView functionality
Apache License 2.0
76 stars 37 forks source link

Crashes on IOS 13 #53

Open JungMinHur opened 4 years ago

JungMinHur commented 4 years ago

Which platform(s) does your issue occur on?

Please, provide the following version numbers that your issue occurs with:

Please, tell us how to recreate the issue in as much detail as possible.

Describe the steps to reproduce it.

Loading and firing functions like window.nsWebViewBridge.emit causes kill() returned unexpected error 1 in ios

Is there any code involved?

m-abs commented 4 years ago

@ddfreiling Could you have a look at this?

m-abs commented 4 years ago

Hi @JungMinHur,

Thank you for reporting this issue.

I don't have access to an iOS device at the moment (I'm on my x-mas vacation), so I can't reproduce it right now.

I noticed your dependency lists tns-core-module@^6.0.0 not 6.2.0, are you sure you're running the 6.2.0-version of NativeScript in the project?

NS 6.3.0 was just released, could you try updating and see, if the problem still exists?

kdagithub commented 4 years ago

Hi @m-abs , Thanks for this great plugin. It worked great until version tns-ios:6.2.0.

After the update to version tns-ios: 6.3.0 my app crashes at startup. I think the error message: "kill() returned unexpected error 1" is related to a webkit bug. Also see StackOverflow-Related-Issue.

Nevertheless, the update from tns-ios: 6.2.0 -> 6.3.0 results in the following error:

`CONSOLE WARN file:///node_modules\@nativescript\core\application\application.js:312:0: Error: Error: Building UI from XML. @app-root.xml:5:1

Building UI from XML. @views/main/main-page.xml:33:17 Metadata for "NotaWebViewExt." found but symbol not available at runtime. Fatal JavaScript exception - application has been terminated. `

I found some related issue here: https://github.com/NativeScript/ios-runtime/issues/1061

It seems to be a problem with the EXTERNAL_SYMBOL_FILE (functions are missing at runtime because the linker by default strips any unused C++ symbols.)

Do you have any idea how this can be fixed? If you need any further information, please do not hesitate to ask.

My project settings are: { "nativescript": { "tns-ios": { "version": "6.3.0" }, "tns-android": { "version": "6.3.1" } }, "dependencies": { "@nota/nativescript-webview-ext": "^6.2.1", "nativescript-directions": "^1.3.1", "nativescript-email": "^1.5.5", "nativescript-iqkeyboardmanager": "^1.5.1", "nativescript-phone": "^1.4.1", "nativescript-secure-storage": "^2.6.0", "nativescript-theme-core": "~1.0.6", "nativescript-ui-listview": "^8.0.1", "tns-core-modules": "^6.3.2" },

Tested on an iPhone6S with iOS: 13.3

m-abs commented 4 years ago

@JungMinHur

kill() returned unexpected error 1

We can reproduce this error/warning, but it doesn't seem to break our own app.

@kdagithub

We can't reproduce that error on our systems.

It might be caused by an older version of xcode, do you have the latest version installed?

kdagithub commented 4 years ago

@m-abs Currently i am using the cloud build service along with NativeScript-Sidekick. I prepared a sample project to reproduce the error. webviewtest.zip

with tns-ios: 6.2.0 no error occurs at startup with tns-ios: 6.3.0 the app crashes: crash_tns-ios_6_3_0.txt

Is it possible that the error only occurs when the project is a JavaScript NativeScript-Core Application?

If the error is not reproducible on your side with a local build i would file a bug report for the NativeScript-Sidekick Team (https://github.com/NativeScript/sidekick-feedback)

Thank you very much for your help.

m-abs commented 4 years ago

I think it is caused by the way we bundle the native-classes. We've never tested it with sidekick builds.

We're working on switching to XCFramework for the iOS classes, in the hope that it solves the problem.

m-abs commented 4 years ago

@kdagithub Could you try 6.3.0-alpha.0?

We've gone back to pre-building the iOS natives, it will lock on XCode version but should work better. XCFramework support is broken in nativescript.

kdagithub commented 4 years ago

@m-abs I tested Version 6.3.0-alpha.0 on tns-ios: 6.3.0 but the App-crash is still present. Error: ReferenceError: Metadata for "NotaWebViewExt." found but symbol not available at runtime.

Using Version 6.3.0-alpha.0 with tns-ios: 6.2.0 works.

Do you think that this is related to the WebKit 13.2 (https://github.com/NativeScript/ios-runtime/pull/1220) update in tns-ios: 6.3.0?

m-abs commented 4 years ago

@kdagithub I doubt it. We don't have the same issue when we build locally.

m-abs commented 4 years ago

@kdagithub could you try the latest alpha? 6.3.0-alpha.1

kdagithub commented 4 years ago

@m-abs Still the same error using the cloud-build: Metadata for "NotaWebViewExt." found but symbol not available at runtime.

Configuration: "nativescript": { "tns-ios": { "version": "6.3.0" }, "tns-android": { "version": "6.3.1" } }, "dependencies": { "@nota/nativescript-webview-ext": "^6.3.0-alpha.1", "nativescript-directions": "^1.3.1", "nativescript-email": "^1.5.5", "nativescript-iqkeyboardmanager": "^1.5.1", "nativescript-phone": "^1.4.1", "nativescript-secure-storage": "^2.6.0", "nativescript-theme-core": "~1.0.6", "nativescript-ui-listview": "^7.1.0", "tns-core-modules": "~6.3.0" }

ricky-bos commented 4 years ago

I am using ios version 13.3 and nativescript-vue, but on ios the is not showing up. Working finde on android.

NathanaelA commented 4 years ago

@m-abs - Metadata for "NotaWebViewExt." found but symbol not available at runtime. that error would in my experience only occur in release versions.

The easiest way to fix it is typically in create a build.xcconfig in your <plugin>/platform/ios folder and add to it:

OTHER_LDFLAGS = $(inherited) -Wl,-exported_symbol,NotaWebViewExt
simityx commented 4 years ago

@m-abs - Metadata for "NotaWebViewExt." found but symbol not available at runtime. that error would in my experience only occur in release versions.

The easiest way to fix it is typically in create a build.xcconfig in your <plugin>/platform/ios folder and add to it:

OTHER_LDFLAGS = $(inherited) -Wl,-exported_symbol,NotaWebViewExt

Hi, I try your way to put build.xcconfig in nativescript-webview-ext⁩/⁨platforms⁩/⁨ios⁩/, but it come out an error when I build the app with command tns build ios --bundle --release. My tns-ios version is 6.5.0 and nativescript-webview-ext version is 6.5.2.

Undefined symbols for architecture x86_64:
  "NotaWebViewExt", referenced from:
     -exported_symbol[s_list] command line option
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
note: Using new build system
note: Planning build
note: Constructing build description
m-abs commented 4 years ago

Hi @NathanaelA,

Thank you for your suggestion.

Unfortunately I get the same error as @simitdev5

NotaWebViewExt is bundled with the plugin as a XCFramework, if that makes any difference.

NathanaelA commented 4 years ago

@m-abs - Not sure, I haven't really played with XCFramework's so it is possible that the exported symbol command doesn't work as expected with them. I just know in the past that particular command solves release runtime building with that error message.

m-abs commented 3 years ago

Is this still an issue?