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

Use of unresolved identifier swift_allocObject #44

Closed
AnthonyOliveri opened this issue Apr 30, 2019 · 5 comments
Closed

Use of unresolved identifier swift_allocObject #44

AnthonyOliveri opened this issue Apr 30, 2019 · 5 comments

Comments

@AnthonyOliveri
Copy link

I installed Runtime 2.1.0 using Cocoapods. When I opened Xcode and ran a clean build, I got the following build error in Runtime's Factory.swift:
Use of unresolved identifier 'swift_allocObject.

Here are the details on my environment:

  • Xcode 10.2 (10E125)
  • Command Line Tools: Xcode 10.2
  • Swift version: Apple Swift version 5.0 (swiftlang-1001.0.69.5 clang-1001.0.46.3)
  • Cocoapods: 1.5.3 (also tried 1.6.1 with the same results)
  • Runtime version: 2.1.0 (also tried 2.0.0 with the same results)

Here are the troubleshooting steps I've tried so far:

  • Removed the post_install from my Podfile, and ran pod install again after deleting the Pods/ directory and Podfile.lock
  • Tried different versions of Runtime, and 2 versions of Cocoapods (described above)
  • Deleted DerivedData

Screenshot for more context:
Runtime-build-error

@wickwirew
Copy link
Owner

wickwirew commented Apr 30, 2019

Adding the CRuntime bridging header broke it. Trying to fix it but having a little trouble. My cocoapods experience is pretty minimal.

@AnthonyOliveri
Copy link
Author

Ah, ok. I manually added the missing const void * _Nullable swift_allocObject function to the CRuntime.h file, and that got the build working as a temporary fix.

I saw your cocoapods branch on the CRuntime repo. Any luck?

@AnthonyOliveri
Copy link
Author

Actually, I think the fix is really simple. I cloned the Runtime and CRuntime repos locally, then imported those local pods into my app, rather than using the Cocoapods master repo. The build succeeded when I did that (although there was a warning about not being able to process CRuntime/module.modulemap).

I checked cocoapods.org; it looks like it only has 2.0.1 as the latest version for CRuntime. I think all you need to do is a pod trunk push to get the latest version (2.1.2) on Cocoapods.

@wickwirew
Copy link
Owner

wickwirew commented May 1, 2019

I noticed I forgot to do that yesterday and pushed it, but when I tested it out it was still broken for me, so I deleted the trunk. Turns out the project I was using to test out Cocoapods has something else wrong with it. I created a new iOS project and confirmed it works. Guess I shouldn't have used a 2 year old unmaintained project to test it 😅

Anyways, pushed it again. Thanks for looking into that!

@AnthonyOliveri
Copy link
Author

Ahh, I gotcha. I just did a pod install, built my app, and it seems to be working just fine now. Thanks for the quick turnaround!

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

No branches or pull requests

2 participants