Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why am I getting an unavailable declaration using framework

Tags:

xcode

ios

swift

I'm making a swift .framework, but I'm running into what I believe is a build problem. So I've simplified everything to isolate my troubles. I've attached a screenshot of my newframework.framework project (top) and my example usage of the framework (bottom). The problem I'm having is that Whatever class is unavailable when I include newframework.framework. I can confirm that Whatever.swift is indeed included in target>>buildphases>>compile Sources

What could cause this not to work?

enter image description here

EDIT - Adding App Build phases screenshot

enter image description here

like image 491
nwales Avatar asked Jan 17 '26 20:01

nwales


1 Answers

Your problem, as we figured out in comments, was that you were building your framework for "Generic iOS Device" and building your app for the simulator. Xcode can't make the app build without matching architectures, so you need to choose one over the other or produce a framework that includes every architecture.

(This was posted to help people who come here from the future find the answer quickly. Hello, future people!)

like image 161
TwoStraws Avatar answered Jan 20 '26 13:01

TwoStraws



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!