简体   繁体   中英

MyClass is unavailable: cannot find Swift declaration for this class

I am building a custom framework in swift.I have builded the framework for all the architecture. I am using Debug-Universal build in my sample app. Now when I run the app, It works fine in the simulator but while running on the device, I am getting the error Breeze is unavailable: cannot find Swift declaration for this class 在此处输入图片说明

When I am using Release-Universal it is giving No such Module BreezeSDK

在此处输入图片说明

Follow these steps after creating the universal binaries:

Before lipo , you are building .framework packages for the individual architectures.

For each package:

  1. Traverse to abc.framework/Modules/abc
  2. Copy files .swiftdoc
  3. Go into universal abc
  4. Traverse to abc.framework/Modules/abc
  5. Paste the files you copied in step 2

Repeat these steps for all architectures.

Finally your universal framework package path abc.framework/Modules/abc.swiftmodule/ should contain those files:

  • arm.swiftdoc
  • arm.swiftmodule
  • arm64.swiftdoc
  • arm64.swiftmodule
  • i386.swiftdoc
  • i386.swiftmodule
  • x86_64.swiftdoc
  • x86_64.swiftmodule

The Swift compiler needs swiftmodule map files for each architecture.

Follow these steps

  1. Download Bareeze SDK.
  2. Drag and add Breeze.xcodeproj to your project.
  3. Next, select your application project in the Project Navigator (blue project icon) to navigate to the target configuration window and select the application target under the "Targets" heading in the sidebar.
  4. In the tab bar at the top of that window, open the "General" panel.
  5. Click on the + button under the "Embedded Binaries" section.
  6. Select the top Breeze.framework

Hope this might solve the issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM