question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Manually adding Xcode library crashes build

See original GitHub issue

I don’t know how I got my demo app working before, but it must’ve been pure luck. I revisited the app today. No changes had been made to the code since last Friday. While attempting to build it for iOS, the compiler crashed with a log file full of Swift errors. I have no idea why.

Here are the steps to recreate my issue.

If I remove libWatermelonDB.a from the project, the app will build in Xcode. If I remove/re-add the .xcodeproj file and the library. BOOM! Crashes again. It’s definitely not my app causing problems. It’s the WatermelonDB project.

I’ve tried multiple times linking/unlinking the library both through Xcode and using react-native link/unlink. I get the same result every time.

I’ve attached the project. Just unzip it, install node modules and pod files as usual. I hope someone can decipher what the hell the problem is. Thanks.

homee_wdb-feature-demo.zip

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
alexandrumiccommented, Jun 15, 2020

Hello. @radex I had a similar issue today. No changes since last Friday, and today when trying to build the app I encountered all kinds of native errors.

I have Xcode 11.5 (latest) and tried to manually link again the library, removed the files and added them again, re-installing the library (but now I have v0.15.1 instead of 0.16.0 as before - I think latest release has changed - but the issue is the same).

Here is the log from react-native run-ios:

❌  /Users/alexandrumic/Documents/Alex/Projects/equinet/equinet-mobile/node_modules/@nozbe/watermelondb/native/ios/../../../../../ios/Pods/Headers/Public/abseil/absl/time/time.h:77:10: 'chrono' file not found

#include <chrono>  // NOLINT(build/c++11)
         ^



❌  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:16:10: could not build module 'Darwin'

#include <sys/types.h>
        ^



❌  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/usr/include/dispatch/dispatch.h:25:10: could not build module 'Darwin'

#include <Availability.h>
        ^



❌  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/usr/include/os/object.h:25:10: could not build module 'Darwin'

#include <Availability.h>
        ^



❌  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:10: could not build module 'CoreFoundation'

#include <CoreFoundation/CoreFoundation.h>
        ^



❌  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/usr/include/objc/objc.h:31:10: could not build module 'Darwin'

#include <sys/types.h>      // for __DARWIN_NULL
         ^



❌  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/Security.framework/Headers/SecBase.h:27:10: could not build module 'Darwin'

#include <TargetConditionals.h>
         ^



❌  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/CoreServices.framework/Headers/UTCoreTypes.h:19:10: could not build module 'CoreFoundation'

#include <CoreFoundation/CoreFoundation.h>
         ^



❌  /Users/alexandrumic/Documents/Alex/Projects/equinet/equinet-mobile/node_modules/@nozbe/watermelondb/native/ios/WatermelonDB/SupportingFiles/../FMDB/src/fmdb/FMDB.h:1:9: could not build module 'Foundation'

#import <Foundation/Foundation.h>
        ^



❌  error: failed to emit precompiled header '/Users/alexandrumic/Library/Developer/Xcode/DerivedData/Equinet-fplpsagbqcpeuddadhyzlwchftma/Build/Intermediates.noindex/PrecompiledHeaders/Bridging-swift_Z979SN04K4SV-clang_8AH9QGFMG752.pch' for bridging header /Users/alexandrumic/Documents/Alex/Projects/equinet/equinet-mobile/node_modules/@nozbe/watermelondb/native/ios/WatermelonDB/SupportingFiles/Bridging.h

Hope this helps 🤞

1reaction
mjstellycommented, Jun 11, 2020

At my next opportunity, I’ll get you more detail. For now, watermelon is not stable enough nor has the proper JSI for us to proceed with implementation.

You have a good start, but are in dire need of a retooling for ESnext and ReactNative > 0.60. Good luck.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Crash on launch when adding a Swift package with a binary ...
I have compiled Google's WebRTC library and bundled up everything into xcframework in order to distribute as a binary framework in Swift package...
Read more >
iOS app with framework crashed on device, dyld: Library not ...
Go to "Build Phases", then "Link Binary with Libraries", and ensure that your framework is included with optional selected. enter image ...
Read more >
iOS -App Crash on Launch dyld: Library not loaded, Reason
Hi Amar,. This error is likely happening because the framework contains builds meant for the iOS simulator. Since you can't upload to the...
Read more >
Test your Crashlytics implementation - Firebase - Google
Add code to your app that you can use to force a test crash. · Build and run your app in Xcode. ·...
Read more >
Troubleshooting on iOS devices - Unity - Manual
EXC_BAD_ACCESS starts occurring when an external library is linked to the Unity iOS application. · In Xcode, select View > Navigators > Show...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found