cannot find type 'ConfigurationIntent' in scope


In the OC project, iOS14 WidgetKit target was added, but consistent error
  1. Cannot find type "ConfigurationIntent" in scope,

  2. type 'Provider' does not conform to protocol 'IntentTimelineProvider'

What is strange is that after adding a new OC project, the compilation is successful,

Tool: Xcode12-beta & Simulator

How to get access to old projects?

Accepted Reply

I'm running into the same problem. I nailed it down to my bridging header and the references Objective-C class file, which is also included to the project. If I remove the bridging header, and the Objective-C file, the compile is successful, and the errors are gone.

Any more ideas are highly welcome, because converting this Objective-C class to Swift would be a nightmare.

Thanks
Markus

Replies

Hi I am experiencing the same problem. Can someone help me I tryed all the thing that you made but it doestn seem to fix anything. Help!

I meet the same problem, tried all the ways and make none sense. But if i change to legacy build mode in Xcode 12, it can build success.Now I can not uppdate to Xcode13.

Make sure that you didn't name your extension "Widget".

I have a staticConfiguration Widget I wanted to convert to IntentConfiguration. I'm having the same problem in xCode 13.3.1.

  1. Cannot find type "MyIntent" in scope,
  2. type 'MyProvider' does not conform to protocol 'IntentTimelineProvider'

"MyIntent" is found by the IntentHandler.swift class in the Intents Extension target I created but not the the Widget Extension target.

The .intentdefinition file is included in the Widget Extension and Intents Extension targets. I have tried including it in the main app target and it doesn't fix the problem.

I have followed the instructions in here: https://developer.apple.com/documentation/widgetkit/making-a-configurable-widget and here: https://developer.apple.com/videos/play/wwdc2020/10194/ a couple times each and always end up with the same error.

I do have an objective C bridge file for library source which is not related to the widget or intent functionality. Any ideas? solutions?

Claire