Giter Club home page Giter Club logo

ios's Introduction

Getting Started

To start diving into the v8 iOS runtime make sure you have Xcode and Homebrew installed, and then run the following

# Install CMake
brew install cmake

# To avoid errors, you might need to link cmake to: /usr/local/bin/cmake
# xcode doesn't read your profile during the build step, which causes it to ignore the PATH
sudo ln -s /usr/local/bin/cmake $(which cmake)

# Clone repo
git clone https://github.com/NativeScript/ios.git

# Initialize and clone the submodules
cd ios
git submodule update --init

# Ensure that you have the required llvm binaries for building the metadata generator
./download_llvm.sh

sudo gem install xcodeproj
sudo gem install cocoapods

# Open the runtime in Xcode
open v8ios.xcodeproj

Select the TestRunner target and an emulator and hit Run (the play button).

Screenshot 2020-09-09 at 18 25 43

This should take a while, but once built the emulator should start and show a black screen (this is normal). In this phase the app will run all the built-in tests, and report the results to the console:

Runtime initialization took 55ms
2020-09-09 18:30:37.797265+0200 TestRunner[14285:1238340] CONSOLE LOG: Application Start!
2020-09-09 18:30:38.288740+0200 TestRunner[14285:1238340] No implementation found for exposed method "nonExistingSelector"
2020-09-09 18:30:49.720055+0200 TestRunner[14285:1238340] CONSOLE LOG: SUCCESS: 684 specs, 0 failures, 0 skipped, 0 disabled in 11.81s.

If all tests pass, everything is good! At this point you can make changes to the runtime, add breakpoints and step through with the debugger. In the next section we'll see how to attach the runtime to an existing NativeScript application allowing us to debug runtime issues in actual apps.

Attaching the runtime to a NativeScript app

In the existing app, we need to prepare the Xcode project using ns prepare ios. This will create a folder named platforms/ios and in there a <appname>.xcworkspace (or .xcodeproject but note the following...).

IMPORTANT: You can only attach the runtime to a .xcworkspace project (not a .xcodeproj project). If your app's platforms/ios folder does not contain a .xcworkspace file yet, you can do the following:

Add a new file App_Resources/iOS/Podfile with the following contents:

pod 'IQKeyboardManager'

Now ns clean and prepare again with ns prepare ios. This will make sure when the iOS project is generated that you end up with a .xcworkspace file so attaching the v8 runtime source works properly.

You can now open the platforms/ios/{project-name}.xcworkspace file in Xcode and then drag the v8ios.xcodeproj from the root of this repo under the <appname> in the Xcode sidebar.

Screenshot 2020-09-09 at 18 46 18

Remove the NativeScript.xcframework and TKLiveSync.xcframework from the General tab, as we will no longer be using the framework from node_modules and instead will use the source directly:

Screenshot 2020-09-09 at 18 47 23

Hitting Run in Xcode should start the app in the simulator, and we can now add breakpoints to the runtime and step through it with the debugger. To apply changes to the javascript, make sure you run ns prepare ios to re-bundle it into the platforms/ios folder.

Only required when running on a physical device

Add the Nativescript.framework and TKLiveSync.framework from the v8ios workspace:

Screen Shot 2021-04-12 at 11 49 10 AM

Troubleshooting

If you encounter vague errors like this when building your app with the runtime included (This has been observed sometimes while Profiling apps in Xcode):

/path/to/ios/NativeScript/inspector/src/base/atomicops.h:311:11: No matching function for call to 'Relaxed_Load'

This is most likely related to Build Active Architecture Only setting in Xcode for various targets (your app and the included v8ios runtime). You should check to make sure your app Build Settings and the v8ios targets NativeScript and TKLiveSync Build Settings are set to YES for both Debug and Release. See this reference: QuickBlox/quickblox-ios-sdk#993 (comment)

Overview

POC showing the {N} iOS runtime running with the V8 engine.

Supported architectures:

  • x86_64
  • arm64

iOS deployment target:

  • 9.0

The --jitless mode in which V8 is running is explained in the following document

Updating/Building V8 engine source

In order to build the V8 engine for iOS and produce the static libraries used in the NativeScript iOS runtime follow these steps:

Prerequisites:

git clone https://github.com/NativeScript/ios.git
cd ios

You will need Google depot_tools

  • If you have not cloned the repo yet, clone the following and export a path setting so they can be referenced properly:
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

// copy/paste this command in current terminal window:
export PATH=`pwd`/depot_tools:"$PATH"
  1. Fetch the latest v8 source (or specific version):

If you have an existing v8 source fetched, delete the folder, and fetch it fresh each time updates are needed.

// IMPORTANT: Make sure you are inside the clone of this repo...
cd ios

// Fetch v8 source:
fetch v8

This will create a v8 repo folder automatically checking out the master branch.

Always check https://omahaproxy.appspot.com/ for the specific version you intend to build.

  1. Ensure you checkout the version you intend to build:
cd v8

// for example:
git checkout 9.2.230.18

gclient sync

This will checkout a specific tag and fetch additional dependencies for building the intended version.

  1. Apply patches from v8 updates to the iOS runtime:
npm run apply-patches

NOTE: Oftentimes the patches may not apply immediately and can run into issues like this:

error: patch failed: BUILD.gn:538
error: BUILD.gn: patch does not apply
error: patch failed: src/inspector/inspector_protocol_config.json:21
error: src/inspector/inspector_protocol_config.json: patch does not apply
~/Documents/ios/v8/build ~/Documents/ios/v8 ~/Documents/ios
error: patch failed: config/ios/ios_sdk.gni:32
error: config/ios/ios_sdk.gni: patch does not apply

You can look at each patch failure, for example BUILD.gn: patch does not apply, you can apply the patch manually instead. This can be done by opening the ./v8.patch file and applying each patch manually to the corresponding file.

  1. Build v8 source:
npm run build-v8-source

Troubleshooting build errors

  • Example failure 1:
@Mac ios % npm run build-v8-source

> @nativescript/[email protected] build-v8-source
> ./build_v8_source.sh

~/Documents/ios/v8 ~/Documents/ios
Building for out.gn/x64-release (simulator)
Done. Made 212 targets from 92 files in 4004ms
ninja: Entering directory `out.gn/x64-release'
ninja: error: unknown target 'v8_libsampler'

In this case, the v8_libsampler module no longer needs to be built specifically as a target, therefore the MODULES inside the build_v8_source.sh can be modified to remove the target of v8_libsampler and the build can be invoked again.

  • Example failure 2:
ERROR at //build/config/ios/ios_sdk.gni:181:33: Script returned non-zero exit code.
    ios_code_signing_identity = exec_script("find_signing_identity.py",

Automatic code signing identity selection was enabled but could not
find exactly one codesigning identity matching "Apple Development".

Check that the keychain is accessible and that there is exactly one
valid codesigning identity matching the pattern. Here is the parsed
output of `xcrun security find-identity -v -p codesigning`:

  1) 1ABE0***********************************: "Apple Development: Your Name (U4********)"
  2) CB529***********************************: "Apple Distribution: Your Org (29********)"
  3) BACD5***********************************: "Apple Development: Your Name (VV********)"
  4) 0D42D***********************************: "Apple Development: Your Team (D3********)"
  5) 055BA***********************************: "Apple Development: Your Name (GF********)"
  6) A5306***********************************: "Apple Development: Your Name (9V***********)"
    6 valid identities found

If this occurs you can manually modify v8/build/config/ios/ios_sdk.gni. A property named ios_code_signing_identity. You can set that explicitly to one of your code signing identities. You can use the command it suggests to list out your identities in full: xcrun security find-identity -v -p codesigning - Copy the id and paste it as the value of ios_code_signing_identity.

You will want to make ios_code_signing_identity_description an empty string so the final change should look something like this:

# Explicitly select the identity to use for codesigning. If defined, must
# be set to a non-empty string that will be passed to codesigning. Can be
# left unspecified if ios_code_signing_identity_description is used instead.
ios_code_signing_identity = "...your-id..."

# Pattern used to select the identity to use for codesigning. If defined,
# must be a substring of the description of exactly one of the identities by
# `security find-identity -v -p codesigning`.
ios_code_signing_identity_description = ""
  1. If building of the v8 source succeeds, Verify the build output.

The compiled fat static libraries will be placed inside the v8/dist folder.

Building a Distribution Package

  1. Bump the version in package.json

  2. Run: npm run update-version (This will update the runtime headers with version info)

  3. Build & pack: npm run build

This will create: dist/npm/nativescript-ios-{version}.tgz NPM package ready for publishing.

ios's People

Contributors

ammarahm-ed avatar archez avatar burgov avatar caitp avatar darind avatar delaneyb avatar dgmachado avatar djmaze avatar edusperoni avatar farfromrefug avatar logikgate avatar nathanaela avatar nathanwalker avatar ptomato avatar rigor789 avatar tdermendjiev avatar triniwiz avatar vmutafov avatar wsedlacek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ios's Issues

HMR does not work on simulator

Steps:

  1. tns platform add ios@alpha-v8
  2. tns run ios --emulator
  3. Make some change in the code

Expected output:
The change is reflected on the simulator

Actual output:
The change is not taken into account and the old code continues to run until the application is restarted

Object.prototype.toString.apply(value) is not returning the proper constructor name

  • Please note this is unconfirmed

One of my plugins broke and the reason the user figured out was that it wasn't returning the proper constructor name with a Object.prototype.toString.apply(value) so their fix was to use InstanceOf to do the tests. However, this did work in the JSC engine, so for compatibility we should double check that this is broken and/or the return value.

I just wanted to make sure to make note of it so it will show up for me to test / fix at a later time. 😀

App crashes after splash screen with this runtime

I just tried the latest 6.4.0-beta.1-v8-2020-01-14-161321-03 runtime with Grainfather app.
The app crashed after tapping allow for notifications.

Here are the logs

Successfully installed on device with identifier '18040df64fddf2ffcf35e1104ca1e67d3ec5d84f'.
Restarting application on device 18040df64fddf2ffcf35e1104ca1e67d3ec5d84f...
Initializing connection
Removing all cached process handles
Sending handshake request attempt #1 to server
Creating connection to com.apple.runningboard
Handshake succeeded
Identity resolved as application<gfconnect>
Unzipping LiveSync folder. This could take a while...
Unzipped 218 entries in 917.400956ms.
CONSOLE LOG: Loading inspector modules...
CONSOLE LOG: Finished loading inspector modules.
CouchbaseLite/2.5.3 (ObjC; iOS 13.2.2; iPhone) Build/6 Commit/a1510d91 LiteCore/2.5.3 (6)
CouchbaseLite Database WARNING: CBLDatabase.log.file.config is nil, meaning file logging is disabled. Log files required for product support are not being generated.
CONSOLE INFO: HMR: Hot Module Replacement Enabled. Waiting for signal.
6.13.0 - <AppMeasurement>[I-ACS023147] Google Analytics for Firebase has not been created. Please, configure Firebase by calling [FIRApp configure]
Adding securityd connection to pool, total now 1
6.13.0 - [Firebase/Analytics][I-ACS023007] Analytics v.60106000 started
6.13.0 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
CONSOLE LOG: utils.ios.getter() is deprecated; use the respective native property instead
CONSOLE LOG: firebase.init done
Retrieving resting unlock: 0
Registering for test daemon availability notify post.
notify_get_state check indicated test daemon not ready.
CONSOLE LOG: BEWARE: The Pushy plugin replace an already existing notification delegate. This means other (local) notification plugins may no longer work correctly!
CONSOLE LOG: Error in firebase.getRemoteConfig: Error: No initializer found that matches constructor invocation.
CONSOLE LOG: Error loading remote config
CONSOLE LOG: Error: No initializer found that matches constructor invocation.
CONSOLE LOG: applicationDidFinishLaunchingWithOptions
[gfconnect] Requesting authorization with options 7
Found 5 implemented methods in 1 delegates
Successfully run application gfconnect on device with ID 18040df64fddf2ffcf35e1104ca1e67d3ec5d84f.
Initializing connection
Removing all cached process handles
Sending handshake request attempt #1 to server
Creating connection to com.apple.runningboard
Handshake succeeded
Identity resolved as application<gfconnect>
CONSOLE LOG: Loading inspector modules...
CONSOLE LOG: Finished loading inspector modules.
NativeScript debugger has opened inspector socket on port 18183 for gfconnect.
Successfully synced application gfconnect on device 18040df64fddf2ffcf35e1104ca1e67d3ec5d84f.
CouchbaseLite/2.5.3 (ObjC; iOS 13.2.2; iPhone) Build/6 Commit/a1510d91 LiteCore/2.5.3 (6)
CouchbaseLite Database WARNING: CBLDatabase.log.file.config is nil, meaning file logging is disabled. Log files required for product support are not being generated.
CONSOLE INFO: HMR: Hot Module Replacement Enabled. Waiting for signal.
6.13.0 - <AppMeasurement>[I-ACS023147] Google Analytics for Firebase has not been created. Please, configure Firebase by calling [FIRApp configure]
Adding securityd connection to pool, total now 1
CONSOLE LOG: utils.ios.getter() is deprecated; use the respective native property instead
CONSOLE LOG: firebase.init done
Retrieving resting unlock: 0
Registering for test daemon availability notify post.
notify_get_state check indicated test daemon not ready.
CONSOLE LOG: BEWARE: The Pushy plugin replace an already existing notification delegate. This means other (local) notification plugins may no longer work correctly!
CONSOLE LOG: Error in firebase.getRemoteConfig: Error: No initializer found that matches constructor invocation.
CONSOLE LOG: Error loading remote config
CONSOLE LOG: Error: No initializer found that matches constructor invocation.
CONSOLE LOG: applicationDidFinishLaunchingWithOptions
[gfconnect] Requesting authorization with options 7
Found 5 implemented methods in 1 delegates
6.13.0 - [Firebase/Analytics][I-ACS023007] Analytics v.60106000 started
6.13.0 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
[gfconnect] Setting badge number to 0
[gfconnect] Removing all pending notification requests
[gfconnect] Setting badge number to 0
CONSOLE LOG: AppSync: Sync callback SKIPPING_BECAUSE_HMR_ENABLED
[gfconnect] Set badge number [ hasCompletionHandler: 0 hasError: 0 ]
[gfconnect] Set badge number [ hasCompletionHandler: 0 hasError: 0 ]

Crash when changing boolean value of native iOS View

====== Assertion failed ======
Native stack trace:
1          0x11008d19f tns::Assert(bool, v8::Isolate*) + 119
2          0x1100b2840 tns::Interop::SetFFIParams(v8::Local<v8::Context>, tns::TypeEncoding const*, tns::FFICall*, int, int, tns::V8Args&) + 110
3          0x1100b24a5 tns::Interop::CallFunctionInternal(tns::MethodCall&) + 421
4          0x10ffee4f0 tns::ArgConverter::Invoke(v8::Local<v8::Context>, objc_class*, v8::Local<v8::Object>, tns::V8Args&, tns::MethodMeta const*, bool) + 758
5          0x11004ee5a tns::MetadataBuilder::InvokeMethod(v8::Local<v8::Context>, tns::MethodMeta const*, v8::Local<v8::Object>, tns::V8Args&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool) + 76
6          0x11004eb03 tns::MetadataBuilder::PropertySetterCallback(v8::FunctionCallbackInfo<v8::Value> const&) + 249
7          0x1101da13c v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) + 620
8          0x1101d95ec v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) + 556
9          0x1101d8f94 v8::internal::Builtins::InvokeApiFunction(v8::internal::Isolate*, bool, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*, v8::internal::Handle<v8::internal::HeapObject>) + 692
10         0x11057b09f v8::internal::Object::SetPropertyWithAccessor(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::Maybe<v8::internal::ShouldThrow>) + 511
11         0x1105802c6 v8::internal::Object::SetPropertyInternal(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::Maybe<v8::internal::ShouldThrow>, v8::internal::StoreOrigin, bool*) + 358
12         0x1105800a6 v8::internal::Object::SetProperty(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::internal::StoreOrigin, v8::Maybe<v8::internal::ShouldThrow>) + 54
13         0x1103e0f2d v8::internal::StoreIC::Store(v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Name>, v8::internal::Handle<v8::internal::Object>, v8::internal::StoreOrigin) + 1053
14         0x1103e61ed v8::internal::Runtime_StoreIC_Miss(int, unsigned long*, v8::internal::Isolate*) + 413
15         0x110a71b39 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit + 57
JavaScript stack trace:
at set clockwise (file: node_modules/@nativescript/animated-circle/index.ios.js:103:0)
at setPropertyInternal (file: node_modules/@nativescript/angular/__ivy_ngcc__/fesm2015/nativescript-angular.js:2661:0)
at setProperty (file: node_modules/@nativescript/angular/__ivy_ngcc__/fesm2015/nativescript-angular.js:2631:0)
at setAttribute (file: node_modules/@nativescript/angular/__ivy_ngcc__/fesm2015/nativescript-angular.js:2814:0)
at setUpAttributes (file: node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:3394:0)
at ɵɵelementStart (file: node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:14781:0)
at ɵɵelement (file: node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:14851:0)
at HomeTabComponent_Template (file: src/app/modules/home-tab/home-tab.component.html:16:8)
at executeTemplate (file: node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:7449:0)
at renderView (file: node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:7258:0)

Crashes with the setter of the animated-circle plugin here

	/**
	 * The draw direction for the filled circle
	 */
	set clockwise(value: boolean) {
		this._ios.clockwise = value;
	}

Confirmed that switching to the tns-ios: 6.5.3 runtime and the app runs without crashing.

Support for NSError** parameters

According to the documentation, if we invoke a method that takes an NSError** parameter not provided by the user, the method should throw an exception:

try {
    NSFileManager.defaultManager.contentsOfDirectoryAtPathError("/not-existing-path");
} catch (e) {
    console.log(e); // NSError: "The folder '/not-existing-path' doesn't exist."
}

split is not a function

In my app i do something like this:

const deviceLang = Platform.device.language;
const dayjsLocale = deviceLang.split('-')[0].toLowerCase();

Now it crashes with the error:

deviceLang.split is not a function

Logging i see that typeof deviceLang is object

Allow passing TypedArray to NSArray

We cannot pass TypedArrays e.g Uint8Array to methods expecting NSArray

const encoded = new TextEncoder().encode('Osei');
const n = NSArray.arrayWithArray(encoded as any);
const isEqual = () => {
	return encoded[0] === n[0] &&
		encoded[1] === n[1] &&
		encoded[2] === n[2] &&
		encoded[3] === n[3]
}
console.log('isEqual', isEqual());

it will crash at creating the new array with the following
[NSDataAdapter count]: unrecognized selector sent to instance 0x60000005fa40

but in JSC it works fine

Crashes when using workers in N7

Hi,
We are upgrading an app to N7 that uses the speech recognition plugin for transcribing what someone says. At the same time we record the audio of the speech using a different system. In order to do this successfully on the previous version on Nativescript we put the speech recognition functions in a worker.

Everything works fine until you try and stop the recognition. The app then immediately crashes. We have plugged it in to xCode and the error that seems to consistently come back is 'Cannot create a handle without a HandleScope'.

Do you know anything about this please? Is N7 known to have issues with workers?

Thanks for the framework, and any help you can provide!

Support for method swizzling

It should be possible to replace the implementation of existing Objective-C classes with method swizzling.

Here's an example of swizzling class methods:

var nativeStaticMethod = TNSSwizzleKlass.staticMethod;
TNSSwizzleKlass.staticMethod = function (x) {
    return 2 * nativeStaticMethod.apply(this, arguments);
};

And the native class method should be replaced by the javascript implementation.

Another example with instance methods:

var nativeInstanceMethod = TNSSwizzleKlass.prototype.instanceMethod;
TNSSwizzleKlass.prototype.instanceMethod = function (x) {
    return 2 * nativeInstanceMethod.apply(this, arguments);
};

And with instance properties:

var nativeProperty = Object.getOwnPropertyDescriptor(TNSSwizzleKlass.prototype, "aProperty");
Object.defineProperty(TNSSwizzleKlass.prototype, 'aProperty', {
    get: function () {
        return 2 * nativeProperty.get.call(this);
    },
    set: function (x) {
        nativeProperty.set.call(this, 2 * x);
    }
});

Array marshalling fails the first time, but works every other time

Some of what I do requires the ability to marshal numeric arrays. For demonstration purposes here, I use a string as input instead.

const stringInput: string = `This is a string of significant length that will cause a marshalling failure. Unexpectedly, a chunk of the data is missing.`;
const inData: number[] = stringInput.split('').map((c: string) => c.charCodeAt(0));
const intRef: interop.Reference<number> = new interop.Reference(interop.types.uint8, interop.alloc(inData.length));
inData.forEach((n: number, i: number) => (intRef as { [index: number]: any })[i] = n);
const nsInputData: NSData = NSData.alloc().initWithBytesLength(intRef, inData.length);
const nsOutputData: NSData = nsInputData.copy();
const outRef: Uint8Array = new Uint8Array(interop.bufferFromData(nsOutputData));
const outData: number[] = outRef.reduce((out: number[], byte: number) => {
    out.push(byte || ' '.charCodeAt(0));
    return out;
}, []);
const stringOutput: string = outData.reduce((str: string, char: number) => str + String.fromCharCode(char), '');

console.log(`Marshalling success? ${stringInput === stringOutput}`);
if (stringInput !== stringOutput) {
    console.log(inData);
    console.log(stringInput);
    console.log(outData);
    console.log(stringOutput);
}

This source works without issue in the original tns-ios, but in the v8, it fails the first time (and only the first time, from what I can tell).

Marshalling success? false
[84, 104, 105, 115, 32, 105, 115, 32, 97, 32, 115, 116, 114, 105, 110, 103, 32, 111, 102, 32, 115, 105, 103, 110, 105, 102, 105, 99, 97, 110, 116, 32, 108, 101, 110, 103, 116, 104, 32, 116, 104, 97, 116, 32, 119, 105, 108, 108, 32, 99, 97, 117, 115, 101, 32, 97, 32, 109, 97, 114, 115, 104, 97, 108, 108, 105, 110, 103, 32, 102, 97, 105, 108, 117, 114, 101, 46, 32, 85, 110, 101, 120, 112, 101, 99, 116, 101, 100, 108, 121, 44, 32, 97, 32, 99, 104, 117, 110, 107, 32, 111, 102, 32, 116, 104, 101, 32, 100, 97, 116, 97, 32, 105, 115, 32, 109, 105, 115, 115, 105, 110, 103, 46]
This is a string of significant length that will cause a marshalling failure. Unexpectedly, a chunk of the data is missing.
[84, 104, 105, 115, 32, 105, 115, 32, 97, 32, 115, 116, 114, 105, 110, 103, 32, 111, 102, 32, 115, 105, 103, 110, 105, 102, 105, 99, 97, 110, 116, 32, 108, 101, 110, 103, 116, 104, 32, 116, 104, 97, 116, 32, 119, 105, 108, 108, 32, 99, 97, 117, 115, 101, 32, 97, 32, 109, 97, 114, 115, 104, 97, 108, 108, 105, 110, 103, 32, 102, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 112, 101, 99, 116, 101, 100, 108, 121, 44, 32, 97, 32, 99, 104, 117, 110, 107, 32, 111, 102, 32, 116, 104, 101, 32, 100, 97, 116, 97, 32, 105, 115, 32, 109, 105, 115, 115, 105, 110, 103, 46]
This is a string of significant length that will cause a marshalling f            pectedly, a chunk of the data is missing.

function callback method argument crash with nativescript-plugin-firebase

Native stack trace:
1          0x10f9f4d6b tns::Assert(bool, v8::Isolate*) + 119
2          0x10f9607f9 tns::ArgConverter::Invoke(v8::Local<v8::Context>, objc_class*, v8::Local<v8::Object>, tns::V8Args&, tns::MethodMeta const*, bool) + 95
3          0x10f9ba9c0 tns::MetadataBuilder::InvokeMethod(v8::Local<v8::Context>, tns::MethodMeta const*, v8::Local<v8::Object>, tns::V8Args&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool) + 76
4          0x10f9ba513 tns::MetadataBuilder::PropertyGetterCallback(v8::FunctionCallbackInfo<v8::Value> const&) + 245
5          0x10fb2b3dc v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) + 620
6          0x10fb2a88c v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) + 556
7          0x10fb2a23a v8::internal::Builtins::InvokeApiFunction(v8::internal::Isolate*, bool, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*, v8::internal::Handle<v8::internal::HeapObject>) + 762
8          0x10feb1c92 v8::internal::Object::GetPropertyWithAccessor(v8::internal::LookupIterator*) + 466
9          0x10feb13eb v8::internal::Object::GetProperty(v8::internal::LookupIterator*, bool) + 139
10         0x10fd28f05 v8::internal::LoadIC::Load(v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Name>, bool) + 1605
11         0x10fd3195e v8::internal::Runtime_LoadNoFeedbackIC_Miss(int, unsigned long*, v8::internal::Isolate*) + 286
12         0x1103b7619 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit + 57
JavaScript stack trace:
at <anonymous> (file: node_modules/nativescript-plugin-firebase/firebase.ios.js:837:0)
at push.../node_modules/nativescript-plugin-firebase/firebase.js.GIDSignInDelegateImpl.signInDidSignInForUserWithError (file: node_modules/nativescript-plugin-firebase/firebase.ios.js:2175:0)

repro:

Just login via google with firebase plugin.

This works fine with JavaScriptCore ios-runtime.

Stuck on 'Linking' phase in XCode build...

With tns-ios 6.5.0-beta.2-v8-2020-01-28-165547-02 against a large project we manage I experience XCode build getting stuck on the 'Linking' phase for infinite amount of time (45 minutes and counting on a build attempt). I don't see anything in the build log in particular that jumps out but perhaps you may know.

Here's the full build log:
https://drive.google.com/file/d/15qmE4jaJIIYyywtm4RNxWgNXeYfNTWSK/view?usp=sharing

I can provide entire project zipped up that you can try the build via Slack if you ping me. I can provide a google drive link to download.

Assertion failed: (wrapper != nullptr), function WriteValue

Navigating between pages, my app crashes with:

Assertion failed: (wrapper != nullptr), function WriteValue, file /Users/nsbuilduser/workspace/master-ios-v8-runtime/NativeScript/runtime/Interop.mm, line 251.

Cant really tell you where it happens in JS as i get no stack.
Screen Shot 2020-01-20 at 10 06 30

Sporadic crash on app exit - iOS 13.5.1

In a current app on TestFlight, some testers are encountering this occasionally when the app exits (full crashlog attached):

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Triggered by Thread:  0

Thread 0 name:
Thread 0 Crashed:
0   libsystem_kernel.dylib        	0x00000001a4456df0 __pthread_kill + 8
1   libsystem_pthread.dylib       	0x00000001a4376930 pthread_kill + 228 (pthread.c:1458)
2   libsystem_c.dylib             	0x00000001a4304c24 __abort + 116 (abort.c:147)
3   libsystem_c.dylib             	0x00000001a4304bb0 abort + 116 (abort.c:118)
4   libc++abi.dylib               	0x00000001a4429f40 abort_message + 132 (abort_message.cpp:76)
5   libc++abi.dylib               	0x00000001a441b8b0 demangling_terminate_handler() + 284 (cxa_default_handlers.cpp:60)
6   libobjc.A.dylib               	0x00000001a4384f1c _objc_terminate() + 148 (objc-exception.mm:704)
7   TNSCrashlyticsLogger          	0x0000000108849cb8 CLSTerminateHandler() + 348
8   libc++abi.dylib               	0x00000001a44293cc std::__terminate(void (*)()) + 20 (cxa_handlers.cpp:59)
9   libc++abi.dylib               	0x00000001a4429358 std::terminate() + 44 (cxa_handlers.cpp:88)
10  NativeScript                  	0x0000000105f0ed60 std::__1::shared_ptr<v8::Persistent<v8::Value, v8::NonCopyablePersistentTraits<v8::Value> > >::~shared_ptr() + 64
11  libsystem_c.dylib             	0x00000001a42e5164 __cxa_finalize_ranges + 416 (atexit.c:284)
12  libsystem_c.dylib             	0x00000001a42e54a0 exit + 28 (exit.c:81)
13  UIKitCore                     	0x00000001a87beb88 -[UIApplication _terminateWithStatus:] + 508 (UIApplication.m:6735)
14  UIKitCore                     	0x00000001a7f27718 -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 128 (_UISceneLifecycleMultiplexer.m:765)
15  UIKitCore                     	0x00000001a7f2737c -[_UISceneLifecycleMultiplexer forceExitWithTransitionContext:scene:] + 220 (_UISceneLifecycleMultiplexer.m:418)
16  UIKitCore                     	0x00000001a87b4ac4 -[UIApplication workspaceShouldExit:withTransitionContext:] + 216 (UIApplication.m:3725)
17  FrontBoardServices            	0x00000001a98cbcf8 -[FBSUIApplicationWorkspaceShim workspaceShouldExit:withTransitionContext:] + 88 (FBSUIApplicationWorkspace.m:144)
18  FrontBoardServices            	0x00000001a98f8d68 __83-[FBSWorkspaceScenesClient willTerminateWithTransitionContext:withAcknowledgement:]_block_invoke_2 + 80 (FBSWorkspaceScenesClient.m:281)
19  FrontBoardServices            	0x00000001a98ddebc -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 240 (FBSWorkspace.m:357)
20  FrontBoardServices            	0x00000001a98f8cf4 __83-[FBSWorkspaceScenesClient willTerminateWithTransitionContext:withAcknowledgement:]_block_invoke + 140 (FBSWorkspaceScenesClient.m:278)
21  libdispatch.dylib             	0x00000001a431033c _dispatch_client_callout + 20 (object.m:495)
22  libdispatch.dylib             	0x00000001a43130d4 _dispatch_block_invoke_direct + 264 (queue.c:466)
23  FrontBoardServices            	0x00000001a991f6c4 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 48 (FBSSerialQueue.m:173)
24  FrontBoardServices            	0x00000001a991f370 -[FBSSerialQueue _queue_performNextIfPossible] + 432 (FBSSerialQueue.m:216)
25  FrontBoardServices            	0x00000001a991f8dc -[FBSSerialQueue _performNextFromRunLoopSource] + 32 (FBSSerialQueue.m:247)
26  CoreFoundation                	0x00000001a45ebaf4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 (CFRunLoop.c:1922)
27  CoreFoundation                	0x00000001a45eba48 __CFRunLoopDoSource0 + 84 (CFRunLoop.c:1956)
28  CoreFoundation                	0x00000001a45eb198 __CFRunLoopDoSources0 + 196 (CFRunLoop.c:1992)
29  CoreFoundation                	0x00000001a45e5f38 __CFRunLoopRun + 796 (CFRunLoop.c:2882)
30  CoreFoundation                	0x00000001a45e58f4 CFRunLoopRunSpecific + 480 (CFRunLoop.c:3192)
31  GraphicsServices              	0x00000001ae9fc604 GSEventRunModal + 164 (GSEvent.c:2246)
32  UIKitCore                     	0x00000001a87b9358 UIApplicationMain + 
1944 (UIApplication.m:4823)
33  NativeScript                  	0x0000000106054044 ffi_call_SYSV + 68


crashlog.txt

View.measure throws error due to difference in _privateFlags handling from JavaScriptCore ios-runtime

From core modules view.ios.js:

View.prototype.measure = function (widthMeasureSpec, heightMeasureSpec) {
        var measureSpecsChanged = this._setCurrentMeasureSpecs(widthMeasureSpec, heightMeasureSpec);
        var forceLayout = (this._privateFlags & PFLAG_FORCE_LAYOUT) === PFLAG_FORCE_LAYOUT;
        if (forceLayout || measureSpecsChanged) {
            this._privateFlags &= ~PFLAG_MEASURED_DIMENSION_SET;
            this.onMeasure(widthMeasureSpec, heightMeasureSpec);
            this._privateFlags |= PFLAG_LAYOUT_REQUIRED;
            if ((this._privateFlags & PFLAG_MEASURED_DIMENSION_SET) !== PFLAG_MEASURED_DIMENSION_SET) {
                throw new Error("onMeasure() did not set the measured dimension by calling setMeasuredDimension() " + this);
            }
        }
    };

The throw new Error will occur with latest v8 runtime whereas with JSC runtime never occurs. I suspect this has something to do with _privateFlags handling? Perhaps JSC runtime is assisting with something here which is not yet present in v8 runtime?

Repro: I will demonstrate in a project (not sure exactly what conditions give rise to it) but can say that with JSC runtime the throw never occurs under same circumstances.

Cannot read property 'toLowerCase' of undefined in a RadListView

Here's the log

CONSOLE ERROR: {
"context": "__onDiscardedError",
"keys": "stackTrace"
}
CONSOLE ERROR: Error Domain=undefined@undefined:undefined Code=-6661 "(null)" UserInfo={msg=TypeError: Cannot read property 'toLowerCase' of undefined, stackTrace=        (file:///node_modules/nativescript-ui-listview/ui-listview.js:1680:0)
at (file:///node_modules/nativescript-ui-listview/ui-listview.js:627:0)
at (file:///app/shared/helpers/converters.js:57:10)
at (file:///node_modules/@nativescript/core/ui/core/view/view.js:167:0)
at (file:///node_modules/@nativescript/core/ui/core/view/view.js:68:0)
at (file:///node_modules/@nativescript/core/ui/core/view/view-helper/view-helper-common.js:99:0)
at (file:///node_modules/@nativescript/core/ui/core/view/view-common.js:860:0)
at (file:///node_modules/@nativescript/core/ui/layouts/grid-layout/grid-layout.js:167:0)
at (file:///node_modules/@nativescript/core/ui/core/view/view.js:76:0)
at (file:///node_modules/@nativescript/core/ui/core/view/view-helper/view-helper-common.js:99:0)
at (file:///node_modules/@nativescript/core/ui/core/view/view-common.js:860:0)
at (file:///node_modules/@nativescript/core/ui/layouts/grid-layout/grid-layout.js:167:0)
at (file:///node_modules/@nativescript/core/ui/core/view/view.js:76:0)
at (file:///node_modules/@nativescript/core/ui/core/view/view-helper/view-helper-common.js:99:0)
at (file:///node_modules/@nativescript/core/ui/core/view/view-common.js:860:0)
at (file:///node_modules/@nativescript/core/ui/layouts/grid-layout/grid-layout.js:167:0)
at (file:///node_modules/@nativescript/core/ui/core/view/view.js:76:0)
at (file:///node_modules/@nativescript/core/ui/core/view/view-helper/view-helper-common.js:99:0)
at (file:///node_modules/@nativescript/core/ui/core/view/view-common.js:860:0)
at (file:///node_modules/@nativescript/core/ui/layouts/grid-layout/grid-layout.js:167:0)
at (file:///node_modules/@nativescript/core/ui/core/view/view.js:76:0)
at (file:///node_modules/@nativescript/core/ui/core/view/view-helper/view-helper-common.js:99:0)
at (file:///node_modules/@nativescript/core/ui/core/view/view-common.js:860:0)
a<\M-b\M^@\M-&>
NativeScript discarding uncaught JS exception!
CONSOLE ERROR: {
"context": "__onDiscardedError",
"keys": "stackTrace"
}
CONSOLE ERROR: Error Domain=undefined@undefined:undefined Code=-6661 "(null)" UserInfo={msg=TypeError: Cannot read property 'toLowerCase' of undefined, stackTrace=        (file:///node_modules/nativescript-ui-listview/ui-listview.js:1680:0)
at (file:///node_modules/nativescript-ui-listview/ui-listview.js:627:0)
}
NativeScript discarding uncaught JS exception!
*** Assertion failure in -[TKCollectionView _createPreparedCellForItemAtIndexPath:withLayoutAttributes:applyAttributes:isFocused:notify:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKitCore/UIKit-3900.12.16/UICollectionView.m:2270

This page has a RadListView that has grouping enabled. It also has 4 item templates with unique keys.
RadListView without grouping is working fine.

Random Crashes with ns7 core modules

We're also experiencing pretty random but often crash from time to time on iOS devices with latest NS 7 core modules and the project built with Xcode 12:

====== Assertion failed ======
Native stack trace:
1          0x1019f4f3c tns::Assert(bool, v8::Isolate*) + 128
2          0x10196178c tns::ArgConverter::Invoke(v8::Local<v8::Context>, objc_class*, v8::Local<v8::Object>, tns::V8Args&, tns::MethodMeta const*, bool) + 100
3          0x1019ba984 tns::MetadataBuilder::InvokeMethod(v8::Local<v8::Context>, tns::MethodMeta const*, v8::Local<v8::Object>, tns::V8Args&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool) + 88
4          0x1019ba210 tns::MetadataBuilder::MethodCallback(v8::FunctionCallbackInfo<v8::Value> const&) + 220
5          0x101b23e10 v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) + 536
6          0x101b233dc v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) + 516
7          0x101b22b7c v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) + 224
8          0x1022b4d8c Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit + 108
9          0x10224d6b4 Builtins_InterpreterEntryTrampoline + 244
10         0x10224d6b4 Builtins_InterpreterEntryTrampoline + 244
11         0x10224d6b4 Builtins_InterpreterEntryTrampoline + 244
12         0x10224d6b4 Builtins_InterpreterEntryTrampoline + 244
13         0x10224d6b4 Builtins_InterpreterEntryTrampoline + 244
14         0x10224d6b4 Builtins_InterpreterEntryTrampoline + 244
15         0x10224d6b4 Builtins_InterpreterEntryTrampoline + 244
16         0x10224d6b4 Builtins_InterpreterEntryTrampoline + 244
17         0x10224d6b4 Builtins_InterpreterEntryTrampoline + 244
18         0x10224d6b4 Builtins_InterpreterEntryTrampoline + 244
19         0x102246504 Builtins_ArgumentsAdaptorTrampoline + 228
20         0x10224d6b4 Builtins_InterpreterEntryTrampoline + 244
21         0x10224d6b4 Builtins_InterpreterEntryTrampoline + 244
22         0x10224d6b4 Builtins_InterpreterEntryTrampoline + 244
23         0x10224d6b4 Builtins_InterpreterEntryTrampoline + 244
24         0x10224af64 Builtins_JSEntryTrampoline + 164
25         0x10224ac08 Builtins_JSEntry + 168
26         0x122ac4000 26  ???                                 0x0000000122ac4000 0x0 + 4876681216
JavaScript stack trace:
at _removeViewFromNativeVisualTree (file: app/packages/core/ui/core/view/index.ios.ts:787:29)
at _tearDownUI (file: app/packages/core/ui/core/view-base/index.ts:871:15)
at <anonymous> (file: app/packages/core/ui/core/view-base/index.ts:865:9)
at eachChildView (file: app/packages/core/ui/layouts/layout-base-common.ts:125:18)
at eachChild (file: app/packages/core/ui/core/view/view-common.ts:867:7)
at _tearDownUI (file: app/packages/core/ui/core/view-base/index.ts:864:7)
at <anonymous> (file: app/packages/core/ui/core/view-base/index.ts:865:9)
at eachChildView (file: app/packages/core/ui/layouts/layout-base-common.ts:125:18)
at eachChild (file: app/packages/core/ui/core/view/view-common.ts:867:7)
at _tearDownUI (file: app/packages/core/ui/core/view-base/index.ts:864:7)

Originally posted by @romandragan in NativeScript/NativeScript#8867 (comment)

EXEC_BAD_ACCESS while dynamically adding view

i am facing that error
Screen Shot 2020-01-22 at 16 22 49
Now this is within my app but i managed to reproduce it within one of my plugins nativescript-material-components
You can find it here

  • fork
  • npm run build.plugin
  • add the v8 to the demo-vue
  • run the demo
  • go in the first example "buttons"
  • click on the save button in the actionbar => crash(wont happen with current runtime)

iosColors.addObject is not a function

2020-01-20 14:40:04.511370+0530 GFConnectNS[59188:4094569] CONSOLE ERROR: {
  "context": "__onDiscardedError",
  "keys": "stackTrace"
}
2020-01-20 14:40:04.512174+0530 GFConnectNS[59188:4094569] CONSOLE ERROR: Error Domain=undefined@undefined:undefined Code=-6661 "(null)" UserInfo={msg=TypeError: iosColors.addObject is not a function, stackTrace=	(file:///app/vendor.js:32966:19)
	at drawGradient(file:///app/vendor.js:32965:25)
	at createBackgroundUIColor(file:///app/vendor.js:32445:13)
	at (file:///app/vendor.js:25210:30)
	at (file:///app/vendor.js:20517:18)
	at (file:///app/vendor.js:20508:14)
	at (file:///app/vendor.js:20054:15)
	at (file:///app/vendor.js:19787:34)
	at (file:///app/vendor.js:27851:43)
	at (file:///app/vendor.js:20505:18)
	at (file:///app/vendor.js:20054:15)
	at (file:///app/vendor.js:19787:34)
	at (file:///app/vendor.js:30513:28)
	at (file:///app/vendor.js:20505:18)
	at (file:///app/vendor.js:20054:15)
	at layoutView(file:///app/vendor.js:20185:41)
	at (file:///app/vendor.js:30404:24)
}

I noticed this from xcode logs

App crash after start

Hello,

I am trying 6.5.0-beta.2-v8-2020-01-29-122856-01 version for my APP. I am getting following problem

Screen Shot 2020-01-29 at 6 48 59 PM

  "dependencies": {
    "@angular/animations": "~8.2.0",
    "@angular/common": "~8.2.0",
    "@angular/compiler": "~8.2.0",
    "@angular/core": "~8.2.0",
    "@angular/forms": "~8.2.0",
    "@angular/platform-browser": "~8.2.0",
    "@angular/platform-browser-dynamic": "~8.2.0",
    "@angular/router": "~8.2.0",
    "@ngneat/transloco": "^2.12.4",
    "@nota/nativescript-webview-ext": "^6.2.1",
    "@nstudio/nativescript-cardview": "^1.0.0",
    "moment": "^2.24.0",
    "nativescript-angular": "^8.20.4",
    "nativescript-audio": "^5.0.5",
    "nativescript-braintree": "^2.0.7",
    "nativescript-carousel": "^6.1.1",
    "nativescript-cfalert-dialog": "^1.0.15",
    "nativescript-clipboard": "~1.2.0",
    "nativescript-image-cache-it": "^5.0.0-alpha.3",
    "nativescript-md5": "^1.0.1",
    "nativescript-pdf-view": "^2.1.0",
    "nativescript-plugin-firebase": "^10.3.3",
    "nativescript-secure-storage": "^2.6.0",
    "nativescript-simple-libsodium": "^1.0.6",
    "nativescript-social-share": "^1.6.0",
    "nativescript-sqlite": "^2.3.3",
    "nativescript-theme-core": "1.0.6",
    "nativescript-toasty": "^2.0.1",
    "nativescript-ui-calendar": "^6.0.0",
    "nativescript-ui-listview": "^8.0.1",
    "nativescript-videoplayer": "^4.2.1",
    "reflect-metadata": "~0.1.13",
    "rxjs": "^6.4.0",
    "tns-core-modules": "^6.3.2",
    "zone.js": "^0.9.1"

Exceptions is thrown and debugger disconnects when make GET request with image

  1. git clone [email protected]:NativeScript/chrome-devtools-test-app.git
  2. Add ios v8 runtime
  3. Run tns debug ios
  4. Open the URL un Chrome
  5. Navigate to Network requests and tap on GET with image response

Actual:

***** Fatal JavaScript exception - application has been terminated. *****
NativeScript encountered a fatal error: Uncaught TypeError: resource_data.data.base64EncodedStringWithOptions is not a function
at
(file:///node_modules/tns-core-modules/debugger/webinspector-network.js:147:0)
(CoreFoundation) *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: Uncaught TypeError: resource_data.data.base64EncodedStringWithOptions is not a function
at
(file:///node_modules/tns-core-modules/debugger/webinspector-network.js:147:0)
', reason: '(null)'
*** First throw call stack:
(
0   CoreFoundation                      0x0000000105f9629b __exceptionPreprocess + 331
1   libobjc.A.dylib                     0x0000000105532735 objc_exception_throw + 48
2   NativeScript                        0x00000001030c4a34 _ZN3tns21NativeScriptException15OnUncaughtErrorEN2v85LocalINS1_7MessageEEENS2_INS1_5ValueEEE + 722
3   NativeScript                        0x000000010348ec45 _ZN2v88internal14MessageHandler25ReportMessageNoExceptionsEPNS0_7IsolateEPKNS0_15MessageLocationENS0_6HandleINS0_6ObjectEEENS_5LocalINS_5ValueEEE + 373
4   NativeScript                        0x000000010348ea89 _ZN2v88internal14MessageHandler13ReportMessageEPNS0_7IsolateEPKNS0_15MessageLocationENS0_6HandleINS0_15JSMessageObjectEEE + 889
5   NativeScript  <…>
Backend socket closed!
Frontend socket closed!

Expected: Successfully made GET request (also shown in Network Chrome tab)

crash when fetching v8

fetch v8
Running: gclient root
Warning: Running gclient on Python 3.
If you encounter any issues, please file a bug on crbug.com under the Infra>SDK component.
Running: gclient config --spec 'solutions = [
{
"name": "v8",
"url": "https://chromium.googlesource.com/v8/v8.git",
"deps_file": "DEPS",
"managed": False,
"custom_deps": {},
},
]
'
Warning: Running gclient on Python 3.
If you encounter any issues, please file a bug on crbug.com under the Infra>SDK component.
Running: gclient sync --with_branch_heads
Warning: Running gclient on Python 3.
If you encounter any issues, please file a bug on crbug.com under the Infra>SDK component.

________ running 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://chromium.googlesource.com/v8/v8.git /Users/darrylbarnes/ns-v8ios-runtime/_gclient_v8_rdbnefku' in '/Users/../ns-v8ios-runtime'
Cloning into '/Users/../ns-v8ios-runtime/_gclient_v8_rdbnefku'...
remote: Sending approximately 329.31 MiB ...
remote: Counting objects: 7667, done
remote: Finding sources: 100% (7/7)
remote: Total 763243 (delta 647095), reused 763239 (delta 647095)
Receiving objects: 100% (763243/763243), 329.31 MiB | 29.39 MiB/s, done.
Resolving deltas: 100% (647095/647095), done.

[0:01:10] Still working on:
[0:01:10] v8
1>Syncing projects: 0% ( 0/ 2)
[0:01:13] Still working on:
[0:01:13] v8
Syncing projects: 100% (29/29), done.
Running hooks: 16% ( 4/25) clang_format_mac
________ running 'download_from_google_storage --no_resume --platform=darwin --no_auth --bucket chromium-clang-format -s v8/buildtools/mac/clang-format.sha1' in '/Users/darrylbarnes/ns-v8ios-runtime'
Failed to fetch file gs://chromium-clang-format/62bde1baa7196ad9df969fc1f06b66360b1a927b for v8/buildtools/mac/clang-format. [Err: Traceback (most recent call last):
File "/Users/darrylbarnes/ns-v8ios-runtime/depot_tools/gsutil.py", line 190, in
sys.exit(main())
File "/Users/darrylbarnes/ns-v8ios-runtime/depot_tools/gsutil.py", line 186, in main
clean=args.clean)
File "/Users/darrylbarnes/ns-v8ios-runtime/depot_tools/gsutil.py", line 134, in run_gsutil
gsutil_bin = ensure_gsutil(force_version, target, clean)
File "/Users/darrylbarnes/ns-v8ios-runtime/depot_tools/gsutil.py", line 113, in ensure_gsutil
target_zip_filename = download_gsutil(version, instance_dir)
File "/Users/darrylbarnes/ns-v8ios-runtime/depot_tools/gsutil.py", line 70, in download_gsutil
u = urllib.urlopen(url)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 429, in open
response = self._open(req, data)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 447, in _open
'_open', req)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 407, in _call_chain
result = func(*args)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1241, in https_open
context=self._context)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1198, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)>
]
0> Failed to fetch file gs://chromium-clang-format/62bde1baa7196ad9df969fc1f06b66360b1a927b for v8/buildtools/mac/clang-format, skipping. [Err: Traceback (most recent call last):
File "/Users/darrylbarnes/ns-v8ios-runtime/depot_tools/gsutil.py", line 190, in
sys.exit(main())
File "/Users/darrylbarnes/ns-v8ios-runtime/depot_tools/gsutil.py", line 186, in main
clean=args.clean)
File "/Users/darrylbarnes/ns-v8ios-runtime/depot_tools/gsutil.py", line 134, in run_gsutil
gsutil_bin = ensure_gsutil(force_version, target, clean)
File "/Users/darrylbarnes/ns-v8ios-runtime/depot_tools/gsutil.py", line 113, in ensure_gsutil
target_zip_filename = download_gsutil(version, instance_dir)
File "/Users/darrylbarnes/ns-v8ios-runtime/depot_tools/gsutil.py", line 70, in download_gsutil
u = urllib.urlopen(url)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 429, in open
response = self._open(req, data)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 447, in _open
'_open', req)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 407, in _call_chain
result = func(*args)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1241, in https_open
context=self._context)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1198, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)>
]
Downloading 1 files took 0.715730 second(s)
Error: Command 'download_from_google_storage --no_resume --platform=darwin --no_auth --bucket chromium-clang-format -s v8/buildtools/mac/clang-format.sha1' returned non-zero exit status 1 in /Users/../ns-v8ios-runtime
Subprocess failed with return code 2.

Problem with DKImagePickerController

I am trying to implement DKImagePickerController library in one of my project. I have added in my app's Podfile like this:
pod 'DKImagePickerController'
It was working until 6.5.0-beta.2-v8-2020-02-05-153040-01 but in latest version getting crash.

let picker = DKImagePickerController.new();
picker.assetType = DKImagePickerControllerAssetType.AllPhotos;
picker.singleSelect = true;

picker.didSelectAssets = ((res) => {
console.dir(res);
})

Screen Shot 2020-02-13 at 6 26 20 PM

Cannot instantiate extended native classes using the "new" keyword

Extend a native class:

var ButtonEditorHelper = /** @class */ (function (_super) {
    __extends(ButtonEditorHelper, _super);
    function ButtonEditorHelper() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    return ButtonEditorHelper;
}(NSObject));

and try to create an instance of it using the "new" keyword:

var helper = new ButtonEditorHelper();

Currently the only supported way to instantiate this class is using the following:

var helper = ButtonEditorHelper.alloc().init();

[BUG] - Problem on modal - Error: Attempted to assign to readonly property.

Hi guys,
because I need to enable Bitcode I've adopted new runtime and I succeeded to enable it.
With new runtime I have some crashes and issues.

If I open a modal I have this log and modals do not open:

CONSOLE ERROR: ERROR Error: Uncaught (in promise): Error: Attempted to assign to readonly property.
Error: Attempted to assign to readonly property.
at GridLayout.push.../node_modules/@nativescript/core/ui/core/view/view.js.View._showNativeModalView (file: node_modules/@nativescript/core/ui/core/view/view.ios.js:370:0)
at ProxyViewContainer.push.../node_modules/@nativescript/core/ui/core/view/view-common.js.ViewCommon.showModal (file: node_modules/@nativescript/core/ui/core/view/view-common.js:283:0)
at file: node_modules/@nativescript/angular/directives/dialogs.js:99:0
at ZoneDelegate.push.../node_modules/@nativescript/angular/zone-js/dist/zone-nativescript.js.ZoneDelegate.invoke (file: node_modules/@nativescript/angular/zone-js/dist/zone-nativescript.js:388:0)
at Object.onInvoke (file: node_modules/@angular/core/fesm5/core.js:26256:0)
at ZoneDelegate.push.../node_modules/@nativescript/angular/zone-js/dist/zone-nativescript.js.ZoneDelegate.invoke (file: node_modules/@nativescript/angular/zone-js/dist/zone-nativescript.js:387:0)
at Zone.push.../node_modules/@nativescript/angular/zone-js/dist/zone-nativescript.js.Zone.run (file: node_modules/@nativescript/angular/zone-js/dist/zone-nativescript.js:138:0)
at file: node_modules/@nativescript/angular/zone-js/dist/zone-nativescript.js:883:0
at ZoneDele<…>

Problem is on these line:

controller.animated = animated;

Thanks for your help and support.

Appears to be an issue with some classes on iOS 10

Basically, the first time the UILayoutGuide.alloc().init() is everything is created correctly, and the object works as expected.
The second time thru the routine, the UILayoutGuide.alloc() works; but the prototype chain is now missing the majority of the functions one of which is the init function, so then the application crashes with init not being a function.

  • Appears to be directly related to the .init() call
  • Can duplicate on a iOS 10 Emulator w/ XCode 12
  • See NativeScript/NativeScript#8954 for PR used to fix the issue.

Prototype Chain on first alloc() (120 items):

-> bottomAnchor
-> centerXAnchor
-> centerYAnchor
-> hasAmbiguousLayout
-> heightAnchor
-> identifier
-> layoutFrame
-> leadingAnchor
-> leftAnchor
-> owningView
-> rightAnchor
-> topAnchor
-> trailingAnchor
-> widthAnchor
-> constraintsAffectingLayoutForAxis
-> encodeWithCoder
-> initWithCoder
-> toString
-> accessibilityActivationPoint
-> accessibilityCustomActions
-> accessibilityCustomRotors
-> accessibilityElements
-> accessibilityElementsHidden
-> accessibilityFrame
-> accessibilityHint
-> accessibilityLabel
-> accessibilityLanguage
-> accessibilityNavigationStyle
-> accessibilityPath
-> accessibilityTraits
-> accessibilityValue
-> accessibilityViewIsModal
-> autoContentAccessingProxy
-> classForCoder
-> classForKeyedArchiver
-> isAccessibilityElement
-> observationInfo
-> shouldGroupAccessibilityChildren
-> accessibilityActivate
-> accessibilityAssistiveTechnologyFocusedIdentifiers
-> accessibilityDecrement
-> accessibilityElementAtIndex
-> accessibilityElementCount
-> accessibilityElementDidBecomeFocused
-> accessibilityElementDidLoseFocus
-> accessibilityElementIsFocused
-> accessibilityIncrement
-> accessibilityPerformEscape
-> accessibilityPerformMagicTap
-> accessibilityScroll
-> addObserverForKeyPathOptionsContext
-> awakeAfterUsingCoder
-> awakeFromNib
-> copy
-> dealloc
-> dictionaryWithValuesForKeys
-> didChangeValueForKey
-> didChangeValueForKeyWithSetMutationUsingObjects
-> didChangeValuesAtIndexesForKey
-> doesNotRecognizeSelector
-> finalize
-> forwardInvocation
-> forwardingTargetForSelector
-> indexOfAccessibilityElement
-> init
-> methodForSelector
-> methodSignatureForSelector
-> mutableArrayValueForKey
-> mutableArrayValueForKeyPath
-> mutableCopy
-> mutableOrderedSetValueForKey
-> mutableOrderedSetValueForKeyPath
-> mutableSetValueForKey
-> mutableSetValueForKeyPath
-> observeValueForKeyPathOfObjectChangeContext
-> performSelectorInBackgroundWithObject
-> performSelectorOnMainThreadWithObjectWaitUntilDone
-> performSelectorOnMainThreadWithObjectWaitUntilDoneModes
-> performSelectorOnThreadWithObjectWaitUntilDone
-> performSelectorOnThreadWithObjectWaitUntilDoneModes
-> performSelectorWithObjectAfterDelay
-> performSelectorWithObjectAfterDelayInModes
-> prepareForInterfaceBuilder
-> removeObserverForKeyPath
-> removeObserverForKeyPathContext
-> replacementObjectForCoder
-> replacementObjectForKeyedArchiver
-> setNilValueForKey
-> setValueForKey
-> setValueForKeyPath
-> setValueForUndefinedKey
-> setValuesForKeysWithDictionary
-> validateValueForKeyError
-> validateValueForKeyPathError
-> valueForKey
-> valueForKeyPath
-> valueForUndefinedKey
-> willChangeValueForKey
-> willChangeValueForKeyWithSetMutationUsingObjects
-> willChangeValuesAtIndexesForKey
-> autorelease
-> class
-> conformsToProtocol
-> isEqual
-> isKindOfClass
-> isMemberOfClass
-> performSelector
-> performSelectorWithObject
-> performSelectorWithObjectWithObject
-> release
-> respondsToSelector
-> retain
-> retainCount
-> self
-> debugDescription
-> description
-> hash
-> isProxy
-> superclass
-> zone

Prototype Chain on second alloc() (40 items):

-> bottomAnchor
-> centerXAnchor
-> centerYAnchor
-> hasAmbiguousLayout
-> heightAnchor
-> identifier
-> layoutFrame
-> leadingAnchor
-> leftAnchor
-> owningView
-> rightAnchor
-> topAnchor
-> trailingAnchor
-> widthAnchor
-> constraintsAffectingLayoutForAxis
-> encodeWithCoder
-> initWithCoder
-> toString
-> length
-> autorelease
-> class
-> conformsToProtocol
-> isEqual
-> isKindOfClass
-> isMemberOfClass
-> performSelector
-> performSelectorWithObject
-> performSelectorWithObjectWithObject
-> release
-> respondsToSelector
-> retain
-> retainCount
-> self
-> debugDescription
-> description
-> hash
-> isProxy
-> superclass
-> zone

crash on NSData.getBytes

I get a crash on that line

====== Assertion failed ======
Native stack trace:
1          0x10726cc0b tns::Assert(bool, v8::Isolate*) + 119
2          0x10728fba8 tns::Interop::WriteValue(v8::Local<v8::Context>, tns::TypeEncoding const*, void*, v8::Local<v8::Value>) + 2552
3          0x10728f18a tns::Interop::SetFFIParams(v8::Local<v8::Context>, tns::TypeEncoding const*, tns::FFICall*, int, int, tns::V8Args&) + 110
4          0x10728ee13 tns::Interop::CallFunctionInternal(tns::MethodCall&) + 385
5          0x1071d88df tns::ArgConverter::Invoke(v8::Local<v8::Context>, objc_class*, v8::Local<v8::Object>, tns::V8Args&, tns::MethodMeta const*, bool) + 741
6          0x10723273e tns::MetadataBuilder::InvokeMethod(v8::Local<v8::Context>, tns::MethodMeta const*, v8::Local<v8::Object>, tns::V8Args&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool) + 76
7          0x10723201f tns::MetadataBuilder::MethodCallback(v8::FunctionCallbackInfo<v8::Value> const&) + 219
8          0x1073a25ac v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) + 620
9          0x1073a1a5c v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) + 556
10         0x1073a10a3 v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) + 259
11         0x107bdee19 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit + 57
JavaScript stack trace:
at module.exports.push.../../nativescript-carto/plugin/utils/index.js.NTDirAssetPackageImpl.loadAsset (file:///app/bundle.js:3264:18)
at module.exports.push.../../nativescript-carto/plugin/vectortiles/index.js.MBVectorTileDecoder.createNative (file:///app/bundle.js:4295:50)
at module.exports.push.../../nativescript-carto/plugin/index.common.js.BaseNative.getNative (file:///app/bundle.js:1047:32)
at module.exports.push.../../nativescript-carto/plugin/vectortiles/index.js.MBVectorTileDecoder.setStyleParameter (file:///app/bundle.js:4319:14)
at module.exports.push.../node_modules/string-replace-loader/index.js?!../node_modules/string-replace-loader/index.js?!../node_modules/ts-loader/index.js?!./components/Map.ts?vue&type=script&lang=ts&.Map.updateLanguage (file:///app/bundle.js:10640:17)
at module.exports.push.../node_modules/string-replace-loader/index.js?!../node_modules/string-replace-loader/index.js?!../node_modules/ts-loader/index.js?!./components/Map.ts?vue&type=script&lang=ts&.Map.setCurrentLaye<…>

Right now might not be easy to create a simple example. Let me know if the stack is not enough

[BUG] Problem with class names and NIBs

I'm using a POD that has Swift code and XIBs for controllers. This is the pod that I'm using:

pod 'iOSPhotoEditor', :git => 'https://github.com/PeterStaev/photo-editor.git', :commit => '5f90ae8f937e1bf4ef3c46d0fda5fef715c7a5de'

When running with JSC (iOS runtime 6.5.2) When I do:

console.log(PhotoEditorViewController);

I get

function iOSPhotoEditor.PhotoEditorViewController() {
[native code]
}

Which is correct and name so when I try to load the controller with the NIB it works. Here is the code that creates the view controller with the NIB:

const bundle = NSBundle.bundleForClass(PhotoEditorViewController.class());
const viewController = PhotoEditorViewController.alloc().initWithNibNameBundle("PhotoEditorViewController", bundle);

With the v8 runtime seems all the classes are renamed. When I try the same log with the new runtime i get:

function _TtC14iOSPhotoEditor25PhotoEditorViewController() { [native code] }

Since the class is renamed the creation of the viewcontroller fails, as the XIB isn't named accordingly. The exact error is:

CONSOLE ERROR: Error: Could not load NIB in bundle: 'NSBundle </Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework> (loaded)' with name 'PhotoEditorViewController'

iOS app crash after permission request when I use a worker

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

Describe the bug
Error is:

EXC_BAD_ACCESS (code=1, address=0x107f35918)

iOS app crash after accepting any permissions, only happens with the worker I've got defined. Could be due to worker termination or mis-handling but any help is appreciated.

Crash Report: permissionreprod 25-09-2020, 16-53.txt

To Reproduce
See Repo: https://github.com/jamescodesthings/permission-reprod

Expected behavior
Nae crash.

Additional context
Ripped this out of a bigger, inherited application I'm updating to ns7. This was the smallest reproduction I could work out.

./build_all.sh stops at CXX obj/v8_libplatform/default-platform.o

./build_v8.sh
~/ns-v8ios-runtime/v8 ~/ns-v8ios-runtime
Building for out.gn/x64-release
Done. Made 188 targets from 84 files in 4572ms
ninja: Entering directory `out.gn/x64-release'
[16/1764] CXX clang_x64/obj/torque_base/types.o
FAILED: clang_x64/obj/torque_base/types.o
../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF clang_x64/obj/torque_base/types.o.d -DOFFICIAL_BUILD -D_LIBCPP_HAS_NO_ALIGNED_ALLOCATION -DCR_XCODE_VERSION=1150 -DCR_CLANG_REVISION="n356902-4e813bbd-1" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=0 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DV8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=64 -DENABLE_GDB_JIT_INTERFACE -DENABLE_MINOR_MC -DENABLE_HANDLE_ZAPPING -DV8_CONCURRENT_MARKING -DV8_ARRAY_BUFFER_EXTENSION -DV8_ENABLE_LAZY_SOURCE_POSITIONS -DV8_SHARED_RO_HEAP -DV8_WIN64_UNWINDING_INFO -DV8_ENABLE_REGEXP_INTERPRETER_THREADED_DISPATCH -DV8_SNAPSHOT_COMPRESSION -DV8_DEPRECATION_WARNINGS -DV8_IMMINENT_DEPRECATION_WARNINGS -DV8_TARGET_ARCH_X64 -DV8_HAVE_TARGET_OS -DV8_TARGET_OS_IOS -DDISABLE_UNTRUSTED_CODE_MITIGATIONS -DV8_DEPRECATION_WARNINGS -DV8_IMMINENT_DEPRECATION_WARNINGS -I../.. -Iclang_x64/gen -I../.. -I../../include -Iclang_x64/gen -fno-strict-aliasing -fstack-protector -fcolor-diagnostics -fmerge-all-constants -arch x86_64 -no-canonical-prefixes -Wall -Werror -Wextra -Wimplicit-fallthrough -Wunreachable-code -Wthread-safety -Wextra-semi -Wunguarded-availability -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-unneeded-internal-declaration -Wno-undefined-var-template -Wno-ignored-pragma-optimize -Wno-implicit-int-float-conversion -Wno-final-dtor-non-final-class -Wno-builtin-assume-aligned-alignment -Wno-deprecated-copy -Wno-non-c-typedef-for-linkage -Wno-max-tokens -fno-omit-frame-pointer -g0 -isysroot ../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.10.0 -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wno-error -Wmissing-field-initializers -Wunreachable-code -Wshorten-64-to-32 -O3 -Wexit-time-destructors -std=c++14 -fno-trigraphs -Wno-trigraphs -stdlib=libc++ -fvisibility-inlines-hidden -fexceptions -frtti -c ../../src/torque/types.cc -o clang_x64/obj/torque_base/types.o
/bin/sh: ../../third_party/llvm-build/Release+Asserts/bin/clang++: No such file or directory
[21/1764] CXX obj/v8_libplatform/default-platform.o
ninja: build stopped: subcommand failed.

Crash with nativescript-swipe-layout

With nativescript-swipe-layout I am getting following errors:

***** Fatal JavaScript exception - application has been terminated. *****
NativeScript encountered a fatal error: Uncaught Error: -[UIView transform3D]: unrecognized selector sent to instance 0x1040abb70
at
push.../node_modules/@nativescript/core/ui/core/view/view.js.View.updateNativeTransform(file: node_modules/@nativescript/core/ui/core/view/view.ios.js:292:0)
at push.../node_modules/@nativescript/core/ui/core/view/view.js.View.<computed>(file: node_modules/@nativescript/core/ui/core/view/view.ios.js:505:0)
at set(file: node_modules/@nativescript/core/ui/core/properties/properties.js:696:0)
at push.../node_modules/@nativescript/core/ui/animation/animation.js.AnimationDelegateImpl.animationDidStart(file: node_modules/@nativescript/core/ui/animation/animation.ios.js:64:0)
*** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: Uncaught Error: -[UIView transform3D]: unrecognized selector sent to instance 0x1040abb70
at
push.../node_modules/@nativescript/core/ui/core/view/view.js.View.updateNativeTransform(file: node_modules/@nativescript/core/ui/core/view/view.ios.js:292:0)
at push.../node_modules/@nativescript/core/ui/core/view/view.js.View.<computed>(file: node_modules/@nativescript/core/ui/core/view/view.ios.js:505:0)
at set(file: node_modules/@nativescript/core/ui/core/properties/properties.js:696:0)
at push.../node_modules/@nativescript/core/ui/animation/animation.js.AnimationDelegateImpl.animationDidStart(file: node_modules/@nativescript/core/ui/animation/animation.ios.js:64:0)
', reason: '(null)'
*** First throw call stack:
(0x2179ce180 0x216ba69f8 0x101a05788 0x101d9d1a8 0x101d9cffc 0x101cc0da4 0x101bfef80 0x101bfe588 0x101a7aba4 0x101912984 0x101a4d618 0x101a501b4 0x21bf1d370 0x21740c7d4 0x2173ba008 0x21795fb20 0x21795aa58 0x217959fb4 0x219b5b79c 0x243701c38 0x101a50044 0x101a4ce7c 0x1019c9204 0x1019700b0 0x101a00518 0x1019fabe4 0x100ba2768 0x21741d8e0)

Demo: https://play.nativescript.org/?template=play-ng&id=vCppC6&v=4

slow JS / C++ bridge

I decided run some tests comparing perfs of the actual runtime vs v8 runtime.
One thing which worries me quite a bit is the "bridge time".
I have made a test to run this function on an array of 100000 points.
On the current runtime it takes around 60ms. With the v8 runtime it takes around 300ms.
That means a 5x slower runtime in a sense :s
The test was made on simulator.

Dont know if anything can be done about this. Would love to get your view on this

Function names are not printed when use console.trace()

  1. Run tns create AppJS --js
  2. Add console.trace();
  3. Run tns debug ios and open the URL in Chrome

Actual:

at <anonymous> (file:///app/bundle.js:286:17)
at <anonymous> (file:///app/vendor.js:3620:32)
at <anonymous> (file:///app/vendor.js:3640:18)
at <anonymous> (file:///app/vendor.js:15540:19)

Here's how it looks in android:

main-view-model.js:40 Trace
at viewModel.onTap (file:///data/data/org.nativescript.AppDebugJS/files/app/bundle.js:294:17)
at push.../node_modules/@nativescript/core/data/observable/observable.js.Observable.notify (file:///data/data/org.nativescript.AppDebugJS/files/app/vendor.js:3537:32)
at push.../node_modules/@nativescript/core/data/observable/observable.js.Observable._emit (file:///data/data/org.nativescript.AppDebugJS/files/app/vendor.js:3557:18)
at ClickListenerImpl.onClick (file:///data/data/org.nativescript.AppDebugJS/files/app/vendor.js:14715:23)

crash

here is a crash i get while starting another app of mine.

Using 6.5.0-beta.2-v8-2020-02-24-132159-02

here is the related code:

initNativeView() {
        super.initNativeView();
        this._observer = ObserverClass.alloc();
        this._observer['_owner'] = new WeakRef(this);
        this.nativeViewProtected.addObserverForKeyPathOptionsContext(this._observer, 'contentSize', NSKeyValueObservingOptions.New, null);
    }

Happens on the addObserverForKeyPathOptionsContext line.

====== Assertion failed ======
Native stack trace:
1          0x10a08f29b tns::Assert(bool, v8::Isolate*) + 119
2          0x10a0b2c94 tns::Interop::WriteValue(v8::Local<v8::Context>, tns::TypeEncoding const*, void*, v8::Local<v8::Value>) + 5188
3          0x10a0b1728 tns::Interop::SetFFIParams(v8::Local<v8::Context>, tns::TypeEncoding const*, tns::FFICall*, int, int, tns::V8Args&) + 110
4          0x10a0b13ac tns::Interop::CallFunctionInternal(tns::MethodCall&) + 312
5          0x109ffc57f tns::ArgConverter::Invoke(v8::Local<v8::Context>, objc_class*, v8::Local<v8::Object>, tns::V8Args&, tns::MethodMeta const*, bool) + 741
6          0x10a05588e tns::MetadataBuilder::InvokeMethod(v8::Local<v8::Context>, tns::MethodMeta const*, v8::Local<v8::Object>, tns::V8Args&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool) + 76
7          0x10a05516f tns::MetadataBuilder::MethodCallback(v8::FunctionCallbackInfo<v8::Value> const&) + 219
8          0x10a1c25ac v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) + 620
9          0x10a1c1a5c v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) + 556
10         0x10a1c10d3 v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) + 259
11         0x10aa40819 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit + 57
12         0x10a9d9339 Builtins_InterpreterEntryTrampoline + 185
JavaScript stack trace:
at push.../node_modules/.pnpm/registry.npmjs.org/nativescript-material-button/3.1.10/node_modules/nativescript-material-button/button.js.Button.initNativeView (file:///app/vendor.js:77376:34)
at push.../node_modules/.pnpm/registry.npmjs.org/@nativescript/core/6.4.2/node_modules/@nativescript/core/ui/core/view-base/view-base.js.ViewBase.setNativeView (file:///app/vendor.js:18485:18)
at push.../node_modules/.pnpm/registry.npmjs.org/@nativescript/core/6.4.2/node_modules/@nativescript/core/ui/core/view-base/view-base.js.ViewBase._setupUI (file:///app/vendor.js:18464:14)
at <anonymous> (file:///app/vendor.js:18471:19)
at push.../node_modules/.pnpm/registry.npmjs.org/@nativescript/core/6.4.2/node_modules/@nativescript/core/ui/layouts/layout-base-common.js.LayoutBaseCommon.eachChildView (file:///app/vendor.js:28263:26)
at push.../node_modules/.pnpm/registry.npmjs.org/@nativescript/core/6.4.2/node_modules/@nativescript/core/ui/core/view/view-common.js.ViewCommon.eachChild (file:///app/vendor.js:19649:14)
at <…>

Let me if i can give more data

Webview not visualised correctly

  1. Git clone https://github.com/NativeScript/NativeScript.git
  2. Navigate to NativeScript/e2e/ui-tests-app
  3. rm -rf node_modules
  4. rm -rf platforms
  5. rm -rf package-lock.json
  6. Open package.json and edit this fields to next version:
    • "tns-platform-declarations": "next"
    • "tns-core-modules": "next"
    • "@nativescript/core": "next"
  7. Add new iosV8 tns platform add ios@alpha-v8
  8. Run the app tns run ios
  9. In the application click webview
    10 . Click query or webtest
    Actual:
    The HTML queries or webtest are not visualised correctly. For example:
    this is in the standart ios version
    image
    this is in the iosV8
    image
    Also all queries are not visualised correctly for example
    standart ios
    image
    iosV8
    image

Svelte native project does not work

Steps to reproduce:

1. npx degit halfnelson/svelte-native-template my-mobile-app
2. cd my-mobile-app
3. tns platform add ios@alpha-v8
4. tns run ios

The logo shows up and then the app closes.

Workers do not have an active RunLoop

Background workers do not have an active CFRunLoop and they cannot execute any methods that depend on it (such as timers and network calls)

Steps to reproduce:

  1. Create a new worker:
var worker = new Worker("./myworker.js");
worker.postMessage("some message");
  1. Start a new timer inside myworker.js:
require("tns-core-modules/globals");
onmessage = msg => {
    console.log("message received");
    setTimeout(() => console.log("inside callback"), 2000);
};

Expected result:

  • 2 seconds after the worker is started, the inside callback message appears

Actual result:

  • the message never appears

Failed Assertion in GetWrappedPointer and WriteValue

Hi I am updating an old (not mine) plugin for the use with NativeScript 7.

Therefore I have added https://github.com/jibon57/nativescript-simple-libsodium/tree/master/src to a new plugin workspace from https://github.com/NativeScript/plugin-seed and fixed most of the issues I found with the help of the official NativeScript blog posts and various youtube videos from you guys. Thanks for these!

But currently I am stuck at failed assertions and I am wondering what causes the issue here.
It appears to be related to the parameter types of the objectivec functions declared in platform/ios/include/sodium/*.h and typingz/objc!sodium.d.ts but I cant put a finger on it.

If you want to reproduce the issue. You can download the zip file. scope.zip

‘Npm install’ the workspace in scope and ‘npm start’ to build the plugin and then start the angular ios demo and click on ‘Password Hash’ or ‘Crypto Auth’ to reproduce the first issue or click on ‘Box Easy’ to get the second stacktrace.

RunningBoardServices) [com.apple.runningboard:connection] Identity resolved as application<org.nativescript.plugindemoangular>
CONSOLE LOG: Angular is running in development mode. Call enableProdMode() to enable production mode.
CONSOLE LOG: passwordHash
====== Assertion failed ======
Native stack trace:
1          0x1075c4ceb tns::Assert(bool, v8::Isolate*) + 119
2          0x107592746 tns::Reference::GetWrappedPointer(v8::Local<v8::Context>, v8::Local<v8::Value>, tns::TypeEncoding const*) + 148
3          0x1075e7c5a tns::Interop::WriteValue(v8::Local<v8::Context>, tns::TypeEncoding const*, void*, v8::Local<v8::Value>) + 4734
4          0x1075e69b6 tns::Interop::SetFFIParams(v8::Local<v8::Context>, tns::TypeEncoding const*, tns::FFICall*, int, int, tns::V8Args&) + 110
5          0x1075e662f tns::Interop::CallFunctionInternal(tns::MethodCall&) + 415
6          0x107588189 tns::MetadataBuilder::CFunctionCallback(v8::FunctionCallbackInfo<v8::Value> const&) + 225
7          0x1076fc22c v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) + 620
8          0x1076fb6dc v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) + 556
9          0x1076fad63 v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) + 259
10         0x107f93d19 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit + 57
JavaScript stack trace:
at passwordHash (file: src/Users/nsuser/Desktop/ns-angularv10/scope/dist/packages/simple-libsodium/index.js:333:0)
at passwordHash (file: src/Users/nsuser/Desktop/ns-angularv10/scope/tools/demo/simple-libsodium/index.ts:105:33)
at SimpleLibsodiumComponent_Template_Button_tap_9_listener (file: src/plugin-demos/simple-libsodium.component.html:10:18)
at executeListenerWithErrorHandling (file: src/Users/nsuser/Desktop/ns-angularv10/scope/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:14309:0)
at wrapListenerIn_markDirtyAndPreventDefault (file: src/Users/nsuser/Desktop/ns-angularv10/scope/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:14344:0)
at <anonymous> (file: src/Users/nsuser/Desktop/ns-angularv10/scope/node_modules/@nativescript/angular/__ivy_ngcc__/fesm2015/nativescript-angular.js:2849:0)
at push.../../../node_modules/@nativescript/angular/node_modules/@nativescript/zone-js/zone-nativescript.js.ZoneDelegate.invoke (file: src/Users/nsuser/Desktop/ns-angularv10/scope/node_modules/@nativescript/angular/node_modules/@nativescript/zone-js/zone-nativescript.js:388:0)
at onInvoke (file: src/Users/nsuser/Desktop/ns-angularv10/scope/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:27431:0)
at push.../../../node_modules/@nativescript/angular/node_modules/@nativescript/zone-js/zone-nativescript.js.ZoneDelegate.invoke (file: src/Users/nsuser/Desktop/ns-angularv10/scope/node_modules/@nativescript/angular/node_modules/@nativescript/zone-js/zone-nativescript.js:387:0)
at push.../../../node_modules/@nativescript/angular/node_modules/@nativescript/zone-js/zone-nativescript.js.Zone.run (file: src/Users/nsuser/Desktop/ns-angularv10/scope/node_modules/@nativescript/angular/node_modules/@nativescript/zone-js/zone-nativescript.js:138:0)
RunningBoardServices) [com.apple.runningboard:connection] Identity resolved as application<org.nativescript.plugindemoangular>
CONSOLE LOG: Angular is running in development mode. Call enableProdMode() to enable production mode.
CONSOLE LOG: boxEasy
====== Assertion failed ======
Native stack trace:
1          0x10b944ceb tns::Assert(bool, v8::Isolate*) + 119
2          0x10b967e55 tns::Interop::WriteValue(v8::Local<v8::Context>, tns::TypeEncoding const*, void*, v8::Local<v8::Value>) + 5241
3          0x10b9669b6 tns::Interop::SetFFIParams(v8::Local<v8::Context>, tns::TypeEncoding const*, tns::FFICall*, int, int, tns::V8Args&) + 110
4          0x10b96662f tns::Interop::CallFunctionInternal(tns::MethodCall&) + 415
5          0x10b908189 tns::MetadataBuilder::CFunctionCallback(v8::FunctionCallbackInfo<v8::Value> const&) + 225
6          0x10ba7c22c v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) + 620
7          0x10ba7b6dc v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) + 556
8          0x10ba7ad63 v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) + 259
9          0x10c313d19 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit + 57
10         0x10c2acd42 Builtins_InterpreterEntryTrampoline + 194
11         0x10c2a6cd9 Builtins_ArgumentsAdaptorTrampoline + 185
JavaScript stack trace:
at boxEasy (file: src/Users/sebastian.hansbauer/Desktop/ns-angularv10/scope/dist/packages/simple-libsodium/index.js:290:0)
at boxEasy (file: src/Users/sebastian.hansbauer/Desktop/ns-angularv10/scope/tools/demo/simple-libsodium/index.ts:89:33)
at SimpleLibsodiumComponent_Template_Button_tap_8_listener (file: src/plugin-demos/simple-libsodium.component.html:9:18)
at executeListenerWithErrorHandling (file: src/Users/sebastian.hansbauer/Desktop/ns-angularv10/scope/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:14309:0)
at wrapListenerIn_markDirtyAndPreventDefault (file: src/Users/sebastian.hansbauer/Desktop/ns-angularv10/scope/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:14344:0)
at <anonymous> (file: src/Users/sebastian.hansbauer/Desktop/ns-angularv10/scope/node_modules/@nativescript/angular/__ivy_ngcc__/fesm2015/nativescript-angular.js:2849:0)
at push.../../../node_modules/@nativescript/angular/node_modules/@nativescript/zone-js/zone-nativescript.js.ZoneDelegate.invoke (file: src/Users/sebastian.hansbauer/Desktop/ns-angularv10/scope/node_modules/@nativescript/angular/node_modules/@nativescript/zone-js/zone-nativescript.js:388:0)
at onInvoke (file: src/Users/sebastian.hansbauer/Desktop/ns-angularv10/scope/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:27431:0)
at push.../../../node_modules/@nativescript/angular/node_modules/@nativescript/zone-js/zone-nativescript.js.ZoneDelegate.invoke (file: src/Users/sebastian.hansbauer/Desktop/ns-angularv10/scope/node_modules/@nativescript/angular/node_modules/@nativescript/zone-js/zone-nativescript.js:387:0)
at push.../../../node_modules/@nativescript/angular/node_modules/@nativescript/zone-js/zone-nativescript.js.Zone.run (file: src/Users/sebastian.hansbauer/Desktop/ns-angularv10/scope/node_modules/@nativescript/angular/node_modules/@nativescript/zone-js/zone-nativescript.js:138:0)

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.