-
Notifications
You must be signed in to change notification settings - Fork 243
Description
Describe the bug
Markdown
Bug Report
When trying to build a minimal Flutter project with the flutter_branch_sdk plugin on a modern environment (Apple Silicon, latest Flutter/Xcode), the iOS build fails with a 'Module not found' error in the GeneratedPluginRegistrant.
This happens even after following a comprehensive troubleshooting process, including a full clean of all caches (Flutter, Pods, DerivedData) and using a known-good Podfile configuration.
Expected Behavior
The minimal project should build successfully.
Actual Behavior
The build fails with the error Module 'flutter_branch_sdk' not found in GeneratedPluginRegistrant.swift.
Environment Details
flutter doctor -v
[✓] Flutter (Channel stable, 3.32.7, on macOS 14.8.1 23J30 darwin-arm64, locale en-US) [1,070ms]
• Flutter version 3.32.7 on channel stable at /Users/denilvisharia/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision d7b523b356 (3 months ago), 2025-07-15 17:03:46 -0700
• Engine revision 39d6d6e699
• Dart version 3.8.1
• DevTools version 2.45.1
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.1) [1,993ms]
• Android SDK at /Users/denilvisharia/Library/Android/sdk
• Platform android-36, build-tools 35.0.1
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: flutter config --jdk-dir="path/to/jdk".
• Java version OpenJDK Runtime Environment (build 21.0.5+-12932927-b750.29)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 16.2) [1,625ms]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 16C5032a
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web [9ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2024.3) [9ms]
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 21.0.5+-12932927-b750.29)
[✓] VS Code (version 1.97.2) [8ms]
• VS Code at /Users/denilvisharia/Downloads/current files/Visual Studio Code.app/Contents
• Flutter extension can be installed from:
🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (2 available) [6.7s]
• macOS (desktop) • macos • darwin-arm64 • macOS 14.8.1 23J30 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 141.0.7390.66
[✓] Network resources [278ms]
• All expected network resources are available.
• No issues found!
Project Configuration
pubspec.yaml
cat pubspec.yaml
name: test_app
description: "A new Flutter project."
The following line prevents the package from being accidentally published to
pub.dev using flutter pub publish. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
The following defines the version and build number for your application.
A version number is three numbers separated by dots, like 1.2.43
followed by an optional build number separated by a +.
Both the version and the builder number may be overridden in flutter
build by specifying --build-name and --build-number, respectively.
In Android, build-name is used as versionName while build-number used as versionCode.
Read more about Android versioning at https://developer.android.com/studio/publish/versioning
In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion.
Read more about iOS versioning at
https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
In Windows, build-name is used as the major, minor, and patch parts
of the product and file versions while build-number is used as the build suffix.
version: 1.0.0+1
environment:
sdk: ^3.8.1
Dependencies specify other packages that your package needs in order to work.
To automatically upgrade your package dependencies to the latest versions
consider running flutter pub upgrade --major-versions. Alternatively,
dependencies can be manually updated by changing the version numbers below to
the latest version available on pub.dev. To see which dependencies have newer
versions available, run flutter pub outdated.
dependencies:
flutter:
sdk: flutter
The following adds the Cupertino Icons font to your application.
Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.8
flutter_branch_sdk: ^8.10.0
dev_dependencies:
flutter_test:
sdk: flutter
The "flutter_lints" package below contains a set of recommended lints to
encourage good coding practices. The lint set provided by the package is
activated in the analysis_options.yaml file located at the root of your
package. See that file for information about deactivating specific lint
rules and activating additional ones.
flutter_lints: ^5.0.0
For information on the generic Dart part of this file, see the
following page: https://dart.dev/tools/pub/pubspec
The following section is specific to Flutter packages.
flutter:
The following line ensures that the Material Icons font is
included with your application, so that you can use the icons in
the material Icons class.
uses-material-design: true
To add assets to your application, add an assets section, like this:
assets:
- images/a_dot_burr.jpeg
- images/a_dot_ham.jpeg
An image asset can refer to one or more resolution-specific "variants", see
https://flutter.dev/to/resolution-aware-images
For details regarding adding assets from package dependencies, see
https://flutter.dev/to/asset-from-package
To add custom fonts to your application, add a fonts section here,
in this "flutter" section. Each entry in this list should have a
"family" key with the font family name, and a "fonts" key with a
list giving the asset and other descriptors for the font. For
example:
fonts:
- family: Schyler
fonts:
- asset: fonts/Schyler-Regular.ttf
- asset: fonts/Schyler-Italic.ttf
style: italic
- family: Trajan Pro
fonts:
- asset: fonts/TrajanPro.ttf
- asset: fonts/TrajanPro_Bold.ttf
weight: 700
For details regarding fonts from package dependencies,
see https://flutter.dev/to/font-from-package
ios/Podfile
platform :ios, '15.0'
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), FILE)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(FILE))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.0'
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
end
Steps to reproduce
- Create a new Flutter project:
flutter create test_app - Add
flutter_branch_sdk: ^8.10.0to thedependenciessection ofpubspec.yaml. - Replace the contents of
ios/Podfilewith the known-good configuration below. - Run
flutter pub get. - Run
cd ios && pod install --repo-update. - Open
ios/Runner.xcworkspacein Xcode. - Select a device target of "Any iOS Device (arm64)".
- Clean build folder (
Shift+Cmd+K). - Attempt to build (
Cmd+B).
Expected behavior
Expected behavior: The minimal project should build successfully.
Actual behavior: The build fails with the error Module 'flutter_branch_sdk' not found in GeneratedPluginRegistrant.swift.
SDK Version
8.10.0
XCode Version
8.10.0
Device
Any iOS Device (arm64) target from an Apple Silicon Mac.
OS
15.0
Additional Information/Context
No response