Attempting to use the forward class 'ModulesProvider' as superclass of 'ExpoModulesProvider'
kesha-antonov opened this issue ยท 14 comments
Summary
Hi,
I use #import "ProjectName-Swift.h"
in AppDelegate.mm
to use custom swift class in that file.
On build I see this error:
If I remove ExpoModulesProvider.swift
file - project builds. But I can't access expo-keep-awake native module
Managed or bare workflow? If you have ios/
or android/
directories in your project, the answer is bare!
bare
What platform(s) does this occur on?
iOS
SDK Version (managed workflow only)
45.0.4
Environment
expo-env-info 1.0.3 environment info:
System:
OS: macOS 12.4
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.14.0 - ~/.nvm/versions/node/v16.14.0/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 8.5.3 - ~/.nvm/versions/node/v16.14.0/bin/npm
Watchman: 2022.05.16.00 - /opt/homebrew/bin/watchman
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK:
API Levels: 30, 31, 32
Build Tools: 30.0.2, 30.0.3, 31.0.0, 32.0.0, 32.1.0
System Images: android-30 | Intel x86 Atom_64, android-31 | Intel x86 Atom_64, android-32 | Google APIs ARM 64 v8a
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8512546
Xcode: 13.4/13F17a - /usr/bin/xcodebuild
npmPackages:
expo: ^45.0.4 => 45.0.4
metro: ^0.70.3 => 0.70.3
react: ^17.0.2 => 17.0.2
react-dom: ^18.1.0 => 18.1.0
react-native: 0.68.2 => 0.68.2
Expo Workflow: bare
Reproducible demo
Add "expo-keep-awake": "^10.1.1",
to package.json
Add #import "ProjectName-Swift.h"
to AppDelegate.mm
Try to build
My temp fix:
- Replace
expo-keep-awake
with https://github.com/sayem314/react-native-keep-awake - In Podfile
def remove_expo_modules_providers
project = Xcodeproj::Project.open('./your-app-name.xcodeproj')
group = project.groups.find { |e| e.name === 'ExpoModulesProviders' }
group.recursive_children_groups[0].files.each do |file|
project.targets.each do |target|
target.build_phases.each do |ph|
ph.remove_file_reference(file)
end
end
end
group.recursive_children_groups[0].remove_from_project
group.remove_from_project
project.save
end
...
target 'your-app' do
use_expo_modules!
post_integrate do |installer|
begin
expo_patch_react_imports!(installer)
rescue => e
Pod::UI.warn e
end
# TEMP FIX FOR https://github.com/expo/expo/issues/17705
remove_expo_modules_providers
end
My temp fix:
- Replace
expo-keep-awake
with https://github.com/sayem314/react-native-keep-awake- In Podfile
def remove_expo_modules_providers project = Xcodeproj::Project.open('./your-app-name.xcodeproj') group = project.groups.find { |e| e.name === 'ExpoModulesProviders' } group.recursive_children_groups[0].files.each do |file| project.targets.each do |target| target.build_phases.each do |ph| ph.remove_file_reference(file) end end end group.recursive_children_groups[0].remove_from_project group.remove_from_project project.save end ... target 'your-app' do use_expo_modules! post_integrate do |installer| begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end # TEMP FIX FOR https://github.com/expo/expo/issues/17705 remove_expo_modules_providers end
After trying this, Updates stopped working for me. It seems to always be disabled. For reference I am using a bare project. Did you encounter any side effects with this temp fix?
I made my AppDelegate a traditional objc file and commented out the C++ because we are not yet using the new architecture. This resolved the issue for me. I think the above Podfile patch causes an issue at least with Updates
I made my AppDelegate a traditional objc file and commented out the C++ because we are not yet using the new architecture. This resolved the issue for me. I think the above Podfile patch causes an issue at least with Updates
Interesting
Thanks for the update
happy to investigate if there is a clonable repro!
Hi there! It looks like your issue requires a minimal reproducible example, but it is invalid or absent. Please prepare such an example and share it in a new issue.
The best way to get attention to your issue is to provide a clean and easy way for a developer to reproduce the issue on their own machine. Please do not provide your entire project, or a project with more code than is necessary to reproduce the issue.
A side benefit of going through the process of narrowing down the minimal amount of code needed to reproduce the issue is that you may get lucky and discover that the bug is due to a mistake in your application code that you can quickly fix on your own.
Resources
Common concerns
"I've only been able to reproduce it in private, proprietary code"
You may not have spent enough time narrowing down the root cause of the issue. Try out the techniques discussed in this manual debugging guide to learn how to isolate the problem from the rest of your codebase.
"I didn't have time to create one"
That's understandable, it can take some time to prepare. We ask that you hold off on filing an issue until you are able to fully complete the required fields in the issue template.
"You can reproduce it by yourself by creating a project and following these steps"
This is useful knowledge, but it's still valuable to have the resulting project that is produced from running the steps, where you have verified you can reproduce the issue.
@brentvatne I am using these versions and getting this error Cannot find interface declaration for 'ModulesProvider', superclass of 'ExpoModulesProvider'
if you will install the same versions then you will get repro.
dont forget to add #import "ProjectName-Swift.h"
to AppDelegate.mm
{
"dependencies": {
"expo": "46.0.0-beta.1",
"expo-haptics": "11.3.0",
"expo-jwt": "^1.4.1",
"expo-localization": "13.1.0",
"expo-secure-store": "11.3.0",
"expo-web-browser": "11.0.0",
"react": "18.0.0",
"react-dom": "^17.0.2",
"react-native": "0.69.1"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@babel/runtime": "^7.17.8",
"@react-native-community/eslint-config": "^2.0.0",
"@types/jest": "^26.0.23",
"@types/react-native": "^0.66.15",
"@types/react-test-renderer": "^17.0.1",
"@typescript-eslint/eslint-plugin": "^5.7.0",
"@typescript-eslint/parser": "^5.7.0",
"babel-jest": "^26.6.3",
"babel-preset-expo": "^9.1.0",
"eslint": "^8.8.0",
"eslint-config-universe": "^10.0.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.70.3",
"react-native-dotenv": "^3.3.1",
"react-native-svg-transformer": "^1.0.0",
"react-test-renderer": "18.0.0",
"typescript": "^4.5.5"
},
"jest": {
"preset": "react-native",
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx",
"json",
"node"
]
}
}
@nomi9995 - can you run expo doctor
or create a new issue and fill out the template? note that sdk 46 beta isn't actually fully released yet also
Using #import "ExpoModulesCore-Swift.h"
just before #import "ProjectName-Swift.h"
in AppDelegate.mm
should resolve the problem
I have this issue in a bare project, so I can't use #import "ExpoModulesCore-Swift.h"
I am already importing "appName-Swift.h"
in my Appdelegate.mm
file
Using
#import "ExpoModulesCore-Swift.h"
just before#import "ProjectName-Swift.h"
inAppDelegate.mm
should resolve the problem
This solved the issue for me
Using
#import "ExpoModulesCore-Swift.h"
just before#import "ProjectName-Swift.h"
inAppDelegate.mm
should resolve the problem
Genius!
Using
#import "ExpoModulesCore-Swift.h"
just before#import "ProjectName-Swift.h"
inAppDelegate.mm
should resolve the problem
Using this solves it for me! However, our project also contains widgets that we maintain with intents.
Have there been anyone that uses widgets that encounter this during their upgrade? We were on expo 45 previously and moving to expo 48 has borked our build...
Any insights would be appreciated!