Symbol not found: (_objc_claimAutoreleasedReturnValue)

When I run app, it works on iOS16+ device. But when I run on iOS15 device just working on debug mode, if I run release or profile modeI got runtime error:

Log: (lldb) dyld[4928]: Symbol not found: (_objc_claimAutoreleasedReturnValue) Referenced from: '/private/var/containers/Bundle/Application/C724D7C6-82FA-4AF3-AE83-EC035B4429A5/Runner.app/Frameworks/geolocator_apple.framework/geolocator_apple' Expected in: '/usr/lib/libobjc.A.dylib'

  • thread #1, stop reason = signal SIGABRT frame #0: 0x0000000106cbb2cc dyld`__abort_with_payload + 8

dyld`__abort_with_payload: -> 0x106cbb2cc <+8>: b.lo 0x106cbb2e8 ; <+36> 0x106cbb2d0 <+12>: stp x29, x30, [sp, #-0x10]! 0x106cbb2d4 <+16>: mov x29, sp 0x106cbb2d8 <+20>: bl 0x106c8164c ; cerror_nocancel Target 0: (Runner) stopped.

Flutter doctor : Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.29.2, on macOS 15.2 24C101 darwin-arm64, locale en-VN) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 16.2) [✓] Chrome - develop for the web [✓] Android Studio (version 2024.2) [✓] VS Code (version 1.97.2)

Answered by DTS Engineer in 831250022

Most problems like this are caused by mismatched deployment targets. The objc_claimAutoreleasedReturnValue routine was introduced in iOS 16 and the compiler knows not to use it if you’re building for an older system. However, if you take a library that was build for iOS 16 or later and embed it within an app whose deployment target is iOS 15 or earlier, you run into exactly this problem.

Looking at your error I see this:

Log: (lldb) dyld[4928]: Symbol not found: (_objc_claimAutoreleasedReturnValue) 
Referenced from: '…/Runner.app/Frameworks/geolocator_apple.framework/geolocator_apple' 
Expected in: '/usr/lib/libobjc.A.dylib'

What is the deployment target for this geolocator_apple framework?

To see the deployment target for a Mach-O file, run vtool. See An Apple Library Primer for more about this and links to documentation.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Most problems like this are caused by mismatched deployment targets. The objc_claimAutoreleasedReturnValue routine was introduced in iOS 16 and the compiler knows not to use it if you’re building for an older system. However, if you take a library that was build for iOS 16 or later and embed it within an app whose deployment target is iOS 15 or earlier, you run into exactly this problem.

Looking at your error I see this:

Log: (lldb) dyld[4928]: Symbol not found: (_objc_claimAutoreleasedReturnValue) 
Referenced from: '…/Runner.app/Frameworks/geolocator_apple.framework/geolocator_apple' 
Expected in: '/usr/lib/libobjc.A.dylib'

What is the deployment target for this geolocator_apple framework?

To see the deployment target for a Mach-O file, run vtool. See An Apple Library Primer for more about this and links to documentation.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Symbol not found: (_objc_claimAutoreleasedReturnValue)
 
 
Q