Comments (9)
Using the latest beta, in my case the app doesn't crash but it freezes when clicking on the Alert button. I am getting the following log:
2020-03-20 10:34:47.053793+0200 demovue[17827:1926802] Button touch target does not meet minimum size guidlines of (48, 48). Button: <MDCButton: 0x7faf06c329c0; baseClass = UIButton; frame = (10 460; 394 36); opaque = NO; layer = <MDCShapedShadowLayer: 0x60000276cf00>>, Touch Target: {394, 36}
2020-03-20 10:34:47.191630+0200 demovue[17827:1926802] CONSOLE LOG: onTap alert Button<alert>
2020-03-20 10:34:47.195892+0200 demovue[17827:1926802] CONSOLE LOG: showUIAlertController <MDCAlertControllerImpl: 0x7faf07853200> Page(38)
Other dialogs seem to work fine.
Are you getting some error log or a crash dump?
from ios.
Yes i am getting those logs too. For me on an ipjome 6 simulator running ios 12 it does a black screen right away. Buy i think it is the same for you. If it freezes i think it will eventually crash. I actually debugged this and got the breakpoint on the native call that was trying to acces the native property i am overriding. Let me know hiw i can help
from ios.
Can you try overriding the native property like this:
set preferredContentSize(x) {
let proto = MDCAlertControllerImpl.prototype;
Object.getOwnPropertyDescriptor(proto, "preferredContentSize").set.call(this, x);
}
I suspect that the issue might be related to the this.super
usage causing a StackOverflow.
from ios.
As we discussed on stack the override you mentionned did not work
from ios.
@darind any chance you could look at this? My material components can't work without this
from ios.
@farfromrefug, sorry for the late reply. Can you try to replicate this issue in a simple javascript snippet? For example when I tried extending the following class I was able to successfully marshal the value between js and native:
const MDCAlertControllerImpl = UIViewController.extend({
get preferredContentSize() {
const superResult = this.super.preferredContentSize;
return superResult;
},
set preferredContentSize(x) {
this.super.preferredContentSize = x;
}
});
I am then able to instantiate and use this class:
var instance = new MDCAlertControllerImpl();
instance.preferredContentSize = CGSizeMake(173, 245);
Foo.test(instance);
where I have defined the custom Foo
native class:
@interface Foo : NSObject
+(void)test:(UIViewController*)o;
@end
@implementation Foo
+(void)test:(UIViewController*)o {
CGSize sz = [o preferredContentSize];
NSLog(@"%fx%f", sz.width, sz.height);
}
@end
This prints the expected 173.000000x245.000000
message to the console.
from ios.
@darind thanks for your answer. Won't be able to do it in the next 3 weeks. When I ll come back I ll test it again but I think the demo vue of my nativescript-material-components shows it in the dialog section. If not it must have been fixed
from ios.
@darind @NathanWalker that bug is still present. Just tried it again and it is still crashing.
tested with 7.0.0-beta.3-v8-2020-07-01-222820-05
Again the demo-vue app crashes in the dialogs sample while clicking on the first button.
Can it be related to the super class MDCAlertController
?
from ios.
To add to this, with the migration to n 7 i made some more tests.
If i change that class to es6 with @NativeClass
i get a different error
====== Assertion failed ======
Native stack trace:
1 0x10f257ceb tns::Assert(bool, v8::Isolate*) + 119
2 0x10f1c7079 tns::ArgConverter::Invoke(v8::Local<v8::Context>, objc_class*, v8::Local<v8::Object>, tns::V8Args&, tns::MethodMeta const*, bool) + 95
3 0x10f21f83a 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 0x10f21f4a1 tns::MetadataBuilder::PropertySetterCallback(v8::FunctionCallbackInfo<v8::Value> const&) + 249
5 0x10f38f22c v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) + 620
6 0x10f38e6dc 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 0x10f38e084 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
8 0x10f73018f v8::internal::Object::SetPropertyWithAccessor(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::Maybe<v8::internal::ShouldThrow>) + 511
9 0x10f7353b6 v8::internal::Object::SetPropertyInternal(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::Maybe<v8::internal::ShouldThrow>, v8::internal::StoreOrigin, bool*) + 358
10 0x10f735196 v8::internal::Object::SetProperty(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::internal::StoreOrigin, v8::Maybe<v8::internal::ShouldThrow>) + 54
11 0x10f59601d 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
12 0x10f59b2dd v8::internal::Runtime_StoreIC_Miss(int, unsigned long*, v8::internal::Isolate*) + 413
13 0x10fc26c39 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit + 57
JavaScript stack trace:
at set (file:///app/bundle.js:2320:45)
at MDCAlertControllerImpl.viewDidLoad (file:///app/bundle.js:2491:34)
at showUIAlertController (file: app/src/dialogs.ios.ts:716:27
Which seems to come from that line https://github.com/NativeScript/ns-v8ios-runtime/blob/59ae25d79497a73b86b7a35ec4ad0b4f3507b4f2/NativeScript/runtime/ArgConverter.mm#L29 or maybe this one (the stack does not tell me really) https://github.com/NativeScript/ns-v8ios-runtime/blob/59ae25d79497a73b86b7a35ec4ad0b4f3507b4f2/NativeScript/runtime/ArgConverter.mm#L45
Also .extend
does work with the older runtime but es6 class transformer to es5 with @NativeClass
does not either
from ios.
Related Issues (20)
- mac m1 build linker failed arm64 HOT 1
- ListView make the app crash on release build
- Getting a syntax error for for ios code NS6 HOT 1
- Missing "Worker" Functionality in ios v8 HOT 1
- V8 base:OS:Abort on v 8.2.3
- Garbage pointer dereference using v 8.2.3 HOT 2
- "libXML2 not found" when building metadata generator HOT 3
- When trying to generate metadata, fatal error: 'clang/AST/DeclBase.h' file not found HOT 2
- Crash in tns::compareIdentifiers (EXC_BAD_ACCESS / KERN_INVALID_ADDRESS) in simulator
- Missing dSym for release 8.3 HOT 1
- Build error - Bitcode not enabled
- npm package increased from 87.6 MB to 290 MB since v7 and introduction of multi-architecture support HOT 1
- Metadata generator fails to generate proper types and does not add method to runtime
- Question on declarations generation HOT 4
- Xcode 14.3 HOT 3
- iOS Crash when trying to use Sqlite via workers on iOS platform 8.5.0+ HOT 2
- Cannot connect debugger to emulator with iOS13.7 HOT 2
- Build input file cannot be found: '.../Build/Products/Debug-iphonesimulator/metadata-arm64.bin'.
- Timezone changes are not correctly applied to NS runtime HOT 8
- IOS: calling exit(0) results in "Appname Crashed" error message HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ios.