Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increasing plugin podspec minimum ios version causes compilation fatal error: module not found #56935

Closed
ened opened this issue May 11, 2020 · 4 comments
Labels
platform-ios iOS applications specifically r: fixed Issue is closed as already fixed in a newer version t: xcode "xcodebuild" on iOS and general Xcode project management tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@ened
Copy link
Contributor

ened commented May 11, 2020

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)
@ened ened added platform-ios iOS applications specifically t: xcode "xcodebuild" on iOS and general Xcode project management labels May 11, 2020
@iapicca iapicca added the tool Affects the "flutter" command-line tool. See also t: labels. label Jul 1, 2020
@jmagman
Copy link
Member

jmagman commented 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_TARGET version and it should build.

@jmagman
Copy link
Member

jmagman commented Jul 14, 2020

This compilation error is lame though.

@jmagman jmagman changed the title podspec platform may cause missing modules error Increasing plugin podspec minimum ios version causes compilation fatal error: module not found Jul 14, 2020
@jmagman jmagman added this to Awaiting triage in Tools - plugin and package support review via automation Jul 14, 2020
@christopherfujino christopherfujino moved this from Awaiting triage to Engineer reviewed in Tools - plugin and package support review Jul 21, 2020
@darshankawar
Copy link
Member

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 the example project using flutter build ios --debug --no-codesign which compiled and built properly without throwing the original issue reported.

dhs@Dhss-MacBook-Pro example % flutter build ios --debug --no-codesign
This app is using a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to migrate
this app to the V2 embedding.
Take a look at the docs for migrating an app:
https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects
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,297ms
Running Xcode build...                                                  
 └─Compiling, linking and signing...                         6.5s
Xcode build done.                                           31.8s
Built
/Users/dhs/Documents/NCFlutter/flt_perf_09_e2e_plugin/example/build/ios/iphoneos
/Runner.app.
dhs@Dhss-MacBook-Pro example % 

With these findings, I am going ahead and closing this as resolved. If anybody disagrees, please write in comments and I'll reopen it.

iOS Platform - plugin and package support review automation moved this from Awaiting triage to Engineer reviewed Oct 11, 2022
@darshankawar darshankawar added the r: fixed Issue is closed as already fixed in a newer version label Oct 11, 2022
@github-actions
Copy link

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 -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform-ios iOS applications specifically r: fixed Issue is closed as already fixed in a newer version t: xcode "xcodebuild" on iOS and general Xcode project management tool Affects the "flutter" command-line tool. See also t: labels.
Development

No branches or pull requests

4 participants