Repository navigation
Increasing plugin podspec minimum ios version causes compilation fatal error: module not found #56935
Description
There is a huge problem in one of our packages, which had set it's iOS platform to 11.3 within the ios/*.podspec file.
It causes the main app build to fail when combined with e2e plugin, for example.
Here is the sample repo:
https://github.com/ened/flt_perf_09_e2e_plugin
The repository was created using:
flutter create -t plugin --org com.example --project-name flt_perf_09_e2e_plugin flt_perf_09_e2e_plugin
Using the Flutter version below.
If you checkout the repository above and run the following:
$ flutter pub get
$ cd example
$ flutter build ios --debug --no-codesign
Running "flutter pub get" in example... 0.3s
Warning: Building for device with codesigning disabled. You will have to manually codesign before deploying to device.
Building com.example.fltPerf09E2ePluginExample for device (ios)...
Warning: Missing build name (CFBundleShortVersionString).
Warning: Missing build number (CFBundleVersion).
Action Required: You must set a build name and number in the pubspec.yaml file version field before submitting to the App Store.
Running pod install... 1.5s
Running Xcode build...
└─Compiling, linking and signing... 1.2s
Xcode build done. 9.0s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Users/ened/tmp/flt_perf_09_e2e_plugin/example/ios/Runner/GeneratedPluginRegistrant.m:10:9: fatal error: module 'e2e' not found
@import e2e;
~~~~~~~^~~
1 error generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
════════════════════════════════════════════════════════════════════════════════
Building a deployable iOS app requires a selected Development Team with a
Provisioning Profile. Please ensure that a Development Team is selected by:
1- Open the Flutter project's Xcode target with
open ios/Runner.xcworkspace
2- Select the 'Runner' project in the navigator then the 'Runner' target
in the project settings
3- Make sure a 'Development Team' is selected.
- For Xcode 10, look under General > Signing > Team.
- For Xcode 11 and newer, look under Signing & Capabilities > Team.
You may need to:
- Log in with your Apple ID in Xcode first
- Ensure you have a valid unique Bundle ID
- Register your device with your Apple Developer Account
- Let Xcode automatically provision a profile for your app
4- Build or run your project again
For more information, please visit:
https://flutter.dev/setup/#deploy-to-ios-devices
Or run on an iOS simulator without code signing
════════════════════════════════════════════════════════════════════════════════
Encountered error while building for device.
This indicates the e2e module can not be resolved.
Now, go back 1 commit, to ened/flt_perf_09_e2e_plugin@7b976e5. The only change here is the revert of the .podspec's platform version and the Podfile platform.
$ cd ..
$ git checkout -f
$ git checkout 3a494d114bdecc52e29450cb058cd55d07a39b4f
$ git clean -xfd
$ flutter pub get
$ cd example
$ flutter build ios --debug --no-codesign
Warning: Building for device with codesigning disabled. You will have to manually codesign before deploying to device.
Building com.example.fltPerf09E2ePluginExample for device (ios)...
Warning: Missing build name (CFBundleShortVersionString).
Warning: Missing build number (CFBundleVersion).
Action Required: You must set a build name and number in the pubspec.yaml file version field before submitting to the App Store.
Running pod install... 1.5s
Running Xcode build...
└─Compiling, linking and signing... 4.8s
Xcode build done. 13.3s
Built /Users/ened/tmp/flt_perf_09_e2e_plugin/example/build/ios/iphoneos/Runner.app.
The application can now build. Unless there is a requirement somewhere to never touch the .podspec file in a plugins ios folder (then this issue should track the addition of a "DO NOT TOUCH" comment), this may be a bug in Flutters iOS build system.
Flutter doctor
[✓] Flutter (Channel beta, v1.17.0, on Mac OS X 10.15.4 19E287, locale en-GB)
• Flutter version 1.17.0 at /Users/ened/dev/flutter
• Framework revision e6b34c2b5c (9 days ago), 2020-05-02 11:39:18 -0700
• Engine revision 540786dd51
• Dart version 2.8.1
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/ened/Library/Android/sdk
• Platform android-29, build-tools 29.0.2
• ANDROID_HOME = /Users/ened/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.4.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.4.1, Build version 11E503a
• CocoaPods version 1.9.1
[✓] Android Studio (version 3.6)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 45.1.1
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
[✓] VS Code (version 1.45.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.10.1
[✓] Connected device (3 available)
• F8132 • CB512B5M7T • android-arm64 • Android 8.0.0 (API 26)
• Pixel 2 • HT83G1A03545 • android-arm64 • Android 10 (API 29)
Activity
jmagman commentedon Jul 14, 2020
https://github.com/ened/flt_perf_09_e2e_plugin/blob/3a494d114bdecc52e29450cb058cd55d07a39b4f/example/ios/Runner.xcodeproj/project.pbxproj#L359
The example project is set to a minimum deployment of 8.0, which is the default for a new Flutter project, so you're simulating what your average Flutter customer will see using that plugin. If you have a 11.3 minimum, your customers will too. If you're okay with that, then just up the example
IPHONEOS_DEPLOYMENT_TARGETversion and it should build.jmagman commentedon Jul 14, 2020
This compilation error is lame though.
[-]podspec platform may cause missing modules error[/-][+]Increasing plugin podspec minimum ios version causes compilation fatal error: module not found[/+]darshankawar commentedon Oct 11, 2022
I verified this issue on latest master version of the framework
(Channel master, 3.5.0-6.0.pre.5)by cloning the provided repo and then running theexampleproject usingflutter build ios --debug --no-codesignwhich compiled and built properly without throwing the original issue reported.With these findings, I am going ahead and closing this as resolved. If anybody disagrees, please write in comments and I'll reopen it.
github-actions commentedon Oct 25, 2022
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.