Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

iOS: Xcode 15 runtime error: dyld[2683]: Symbol not found: _OBJC_CLASS_$_NSObject #38

Closed
idy opened this issue Aug 29, 2023 · 9 comments · Fixed by #40
Closed

iOS: Xcode 15 runtime error: dyld[2683]: Symbol not found: _OBJC_CLASS_$_NSObject #38

idy opened this issue Aug 29, 2023 · 9 comments · Fixed by #40

Comments

@idy
Copy link

idy commented Aug 29, 2023

Steps to reproduce:

  1. create an empty fultter iOS project
  2. add flutter_keychain as dependency
  3. use Xcode to run

It will build successful but report an runtime error: dyld[2683]: Symbol not found: _OBJC_CLASS_$_NSObject.

@idy
Copy link
Author

idy commented Aug 29, 2023

After some research, I have identified the issue. It seems that there is a problem when attempting to catch an exception of an NSObject within a try-catch block, specifically with the new linker in Xcode 15.

+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
@try {
FlutterMethodChannel* channel = [FlutterMethodChannel
methodChannelWithName:CHANNEL_NAME
binaryMessenger:[registrar messenger]];
FlutterKeychainPlugin* instance = [[FlutterKeychainPlugin alloc] init];
[registrar addMethodCallDelegate:instance channel:channel];
}
@catch (NSException *exception) {
NSLog(@"%@", exception.reason);
}
@catch (NSObject *object){
NSLog(@"%@", object);
}
}

It seems to be related to the thread discussed in this post: https://developer.apple.com/forums/thread/735610.

When removing the catch clause(L57-L59) for the NSObject, the runtime error mentioned above does not occur.

@jeroentrappers
Copy link
Owner

This seems to be a linker issue. With xcode 14.3.1 I don't seem to be seeing the issue.

@idy
Copy link
Author

idy commented Sep 9, 2023

yep, I have already post it on apple developer forum. I hope Apple can fix this issue in the official release of Xcode 15. Otherwise, we will have to submit workaround code for it.

@AlexandreFQM
Copy link

Problem still occurring in Xcode 15 latest release

@fsayfitdinov
Copy link

Has anyone found temporary workarounds?

@idy
Copy link
Author

idy commented Sep 19, 2023

https://github.com/idy/flutter_keychain

Temporary workaround.

@XavierChanth
Copy link

@jeroentrappers when can we expect a published fix for this issue?
#40 has been open for a week now.

@ashu0806
Copy link

ashu0806 commented Oct 1, 2023

With the latest release of Xcode 15 , it's still causing the issue while creating the build , can anyone have a temporary solution for this?

@axroromonov44
Copy link

ty guys , it works

After some research, I have identified the issue. It seems that there is a problem when attempting to catch an exception of an NSObject within a try-catch block, specifically with the new linker in Xcode 15.

+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
@try {
FlutterMethodChannel* channel = [FlutterMethodChannel
methodChannelWithName:CHANNEL_NAME
binaryMessenger:[registrar messenger]];
FlutterKeychainPlugin* instance = [[FlutterKeychainPlugin alloc] init];
[registrar addMethodCallDelegate:instance channel:channel];
}
@catch (NSException *exception) {
NSLog(@"%@", exception.reason);
}
@catch (NSObject *object){
NSLog(@"%@", object);
}
}

It seems to be related to the thread discussed in this post: https://developer.apple.com/forums/thread/735610.

When removing the catch clause(L57-L59) for the NSObject, the runtime error mentioned above does not occur.

ty guys , it works

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

Successfully merging a pull request may close this issue.

7 participants