darwin-morocho / flutter-facebook-auth

A flutter plugin to add login with facebook in your flutter app
193 stars 127 forks source link

GeneratedPluginRegistrant.m:12:9: Module 'flutter_facebook_auth' not found #234

Closed tuxrick closed 2 years ago

tuxrick commented 2 years ago

Describe the bug Plugin works on development as expected but once I am trying to release I can't because on the build returns that error on xcode,

From CLI this is the output:

ickhdz@Ricks-MacBook-Pro jobid_mobile % flutter build ipa
Archiving com.jobid... Automatically signing iOS for device deployment using specified development team in Xcode project: UD2XFPG8A7 Running pod install... 3.0s Running Xcode build...
└─Compiling, linking and signing... 2,238ms Xcode archive done. 103.4s Failed to build iOS app Error output from Xcode build: ↳ 2022-04-29 20:59:35.102 xcodebuild[70133:4666776] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore 2022-04-29 20:59:35.103 xcodebuild[70133:4666776] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore ARCHIVE FAILED

Xcode's output: ↳ Writing result bundle at path: /var/folders/bk/x8n0z1ns1tl4_9lbdk2gx22r0000gn/T/flutter_tools.yTC9RY/flutter_ios_build_temp_dirJEYawV/temporary_xcresult_bu ndle

/Users/rickhdz/Documents/TB/jobid_mobile/ios/Runner/GeneratedPluginRegistrant.m:12:9: fatal error: module
'flutter_facebook_auth' not found
@import flutter_facebook_auth;
 ~~~~~~~^~~~~~~~~~~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in dependency order
/Users/rickhdz/Documents/TB/jobid_mobile/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target
'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.4.99. (in
target 'AppAuth' from project 'Pods')
/Users/rickhdz/Documents/TB/jobid_mobile/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target
'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.4.99. (in
target 'GoogleSignIn' from project 'Pods')

Result bundle written to path:
    /var/folders/bk/x8n0z1ns1tl4_9lbdk2gx22r0000gn/T/flutter_tools.yTC9RY/flutter_ios_build_temp_dirJEYawV/temporary_xcresult_bu
    ndle

Parse Issue (Xcode): Module 'flutter_facebook_auth' not found /Users/rickhdz/Documents/TB/jobid_mobile/ios/Runner/GeneratedPluginRegistrant.m:11:8

Encountered error while archiving for device.

Environment Add your flutter doctor -v rickhdz@Ricks-MacBook-Pro jobid_mobile % flutter doctor -v [✓] Flutter (Channel stable, 2.10.5, on macOS 12.3.1 21E258 darwin-x64, locale en-MX) • Flutter version 2.10.5 at /Users/rickhdz/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 5464c5bac7 (11 days ago), 2022-04-18 09:55:37 -0700 • Engine revision 57d3bac3dd • Dart version 2.16.2 • DevTools version 2.9.2

[✗] Android toolchain - develop for Android devices ✗ Unable to locate Android SDK. Install Android Studio from: https://developer.android.com/studio/index.html On first launch it will assist you in installing the Android SDK components. (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions). If the Android SDK has been installed to a custom location, please use flutter config --android-sdk to update to that location.

[✓] Xcode - develop for iOS and macOS (Xcode 13.3.1) • Xcode at /Applications/Xcode.app/Contents/Developer • CocoaPods version 1.11.3

[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[!] Android Studio (not installed) • Android Studio not found; download from https://developer.android.com/studio/index.html (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).

[✓] VS Code (version 1.66.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension can be installed from: 🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (2 available) • iPhone 8 (mobile) • 09525180-5381-469C-88BC-F5E5DFC37857 • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-4 (simulator) • Chrome (web) • chrome • web-javascript • Google Chrome 100.0.4896.127

[✓] HTTP Host Availability • All required HTTP hosts are available

! Doctor found issues in 2 categories.

Add your pubspec.yaml

name: jobid 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 used as CFBundleVersion.

Read more about iOS versioning at

https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html

version: 1.0.0+1

environment: sdk: ">=2.16.1 <3.0.0"

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: cupertino_icons: ^1.0.2 dio: ^4.0.4 flutter: sdk: flutter flutter_chat_ui: ^1.5.5 flutter_credit_card: ^3.0.1 flutter_facebook_auth: ^4.3.0 flutter_polygon: ^0.3.0+2 flutter_rating_bar: ^4.0.0 flutter_secure_storage: ^5.0.2 flutter_svg: ^1.0.3 google_fonts: ^2.3.1 google_maps_flutter: ^2.1.2 google_sign_in: ^5.2.4 http: ^0.13.4 image_picker: ^0.8.4+11 provider: ^6.0.2 sign_in_with_apple: ^3.3.0 swipe_image_gallery: ^0.0.5 uuid: ^3.0.6

dev_dependencies: flutter_lints: ^1.0.0 flutter_test: sdk: flutter

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.

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:

Add your Info.plist

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

CFBundleURLTypes CFBundleURLSchemes fb384570645890986 FacebookAppID 384570645890986 FacebookClientToken 58c72af3ec6543457b0e83e7a87f9fd2 FacebookDisplayName Jobid LSApplicationQueriesSchemes fbapi fb-messenger-share-api fbauth2 fbshareextension CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName Jobid CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier com.jobid CFBundleInfoDictionaryVersion 6.0 CFBundleName jobid CFBundlePackageType APPL CFBundleShortVersionString $(FLUTTER_BUILD_NAME) CFBundleSignature ???? CFBundleVersion $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS UILaunchStoryboardName LaunchScreen UIMainStoryboardFile Main NSPhotoLibraryUsageDescription This app requires access to the photo library. NSMicrophoneUsageDescription This app does not require access to the microphone. NSCameraUsageDescription This app requires access to the camera. UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIViewControllerBasedStatusBarAppearance

Add your AppDelegate.swift

import UIKit import Flutter import GoogleMaps

@UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { GeneratedPluginRegistrant.register(with: self)

// GOOGLE MAPS
GMSServices.provideAPIKey("HIDE_YOUR_KEY")

To Reproduce Create a new project Add the plugin Create archive for release on ios

Expected behavior generate the ipa file

darwin-morocho commented 2 years ago

Are you sure that you have chosen 'any ios device' before run archive?

Also make sure that you have defined the same deployment target in your podfile and your general tab https://stackoverflow.com/questions/61956166/flutter-module-not-found-in-xcode

tuxrick commented 2 years ago

yes, in the porfile I have

platform :ios, '13.0'

and in the target is iOS 13 as well

and yes, I have chosen any ios device

darwin-morocho commented 2 years ago

@tuxrick Unfortunately your issue is not correctly redacted and is very difficult try to understand it. please make sure that you have used bloc codes instead plain texts. Also it seems that you AppDelegate.swift is incomplete or is wrong

https://pub.dev/packages/google_maps_flutter#ios

tuxrick commented 2 years ago

you are right, its impossible to see the code, ok

Flutter doctor ` rickhdz@Ricks-MacBook-Pro jobid_mobile % flutter doctor -v [✓] Flutter (Channel stable, 2.10.5, on macOS 12.3.1 21E258 darwin-x64, locale en-MX) • Flutter version 2.10.5 at /Users/rickhdz/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 5464c5bac7 (11 days ago), 2022-04-18 09:55:37 -0700 • Engine revision 57d3bac3dd • Dart version 2.16.2 • DevTools version 2.9.2

[✗] Android toolchain - develop for Android devices ✗ Unable to locate Android SDK. Install Android Studio from: https://developer.android.com/studio/index.html On first launch it will assist you in installing the Android SDK components. (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions). If the Android SDK has been installed to a custom location, please use flutter config --android-sdk to update to that location.

[✓] Xcode - develop for iOS and macOS (Xcode 13.3.1) • Xcode at /Applications/Xcode.app/Contents/Developer • CocoaPods version 1.11.3

[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[!] Android Studio (not installed) • Android Studio not found; download from https://developer.android.com/studio/index.html (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).

[✓] VS Code (version 1.66.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension can be installed from: 🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (2 available) • iPhone 8 (mobile) • 09525180-5381-469C-88BC-F5E5DFC37857 • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-4 (simulator) • Chrome (web) • chrome • web-javascript • Google Chrome 100.0.4896.127

[✓] HTTP Host Availability • All required HTTP hosts are available

! Doctor found issues in 2 categories. `

Pubspec.yaml ` name: jobid 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 used as CFBundleVersion.

Read more about iOS versioning at

https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html

version: 1.0.0+1

environment: sdk: ">=2.16.1 <3.0.0"

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: cupertino_icons: ^1.0.2 dio: ^4.0.4 flutter: sdk: flutter flutter_chat_ui: ^1.5.5 flutter_credit_card: ^3.0.1 flutter_facebook_auth: ^4.3.0 flutter_polygon: ^0.3.0+2 flutter_rating_bar: ^4.0.0 flutter_secure_storage: ^5.0.2 flutter_svg: ^1.0.3 google_fonts: ^2.3.1 google_maps_flutter: ^2.1.2 google_sign_in: ^5.2.4 http: ^0.13.4 image_picker: ^0.8.4+11 provider: ^6.0.2 sign_in_with_apple: ^3.3.0 swipe_image_gallery: ^0.0.5 uuid: ^3.0.6

dev_dependencies: flutter_lints: ^1.0.0 flutter_test: sdk: flutter

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.

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:

`

Info.plist

` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

CFBundleURLTypes CFBundleURLSchemes fb384570645890986 FacebookAppID 384570645890986 FacebookClientToken 58c72af3ec6543457b0e83e7a87f9fd2 FacebookDisplayName Jobid LSApplicationQueriesSchemes fbapi fb-messenger-share-api fbauth2 fbshareextension CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName Jobid CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier com.jobid CFBundleInfoDictionaryVersion 6.0 CFBundleName jobid CFBundlePackageType APPL CFBundleShortVersionString $(FLUTTER_BUILD_NAME) CFBundleSignature ???? CFBundleVersion $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS UILaunchStoryboardName LaunchScreen UIMainStoryboardFile Main NSPhotoLibraryUsageDescription This app requires access to the photo library. NSMicrophoneUsageDescription This app does not require access to the microphone. NSCameraUsageDescription This app requires access to the camera. UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIViewControllerBasedStatusBarAppearance

`

AppDelegate

` import UIKit import Flutter import GoogleMaps

@UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { GeneratedPluginRegistrant.register(with: self)

// GOOGLE MAPS
GMSServices.provideAPIKey("AIzaSyAL7n1nLt_iENC7iyStBIzNHw2RA2mVrnw")

return super.application(application, didFinishLaunchingWithOptions: launchOptions)

} }

`

darwin-morocho commented 2 years ago

I'm sorry but I am not able to reproduce the error because there is not enough info.

Try with flutter clean and flutter build ios before archive. Also check the example folder to check if you have a wrong ios configuration

SylvainFlattet commented 2 years ago

Hi,

I get the same issue while building for iOS (flutter build ios) but everything is fine while running on simulator & iPhone.

Could be related to Release.xconfig ? but my file is quite

I've run pretty much any flutter clean, pod upgrade, pod install combination possible, but I'm stuck here too. Removed this package from pubpsec, and then, build iOS worked fine.

Any clue ? hint...

darwin-morocho commented 2 years ago

@SylvainFlattet I've tried to reproduce the issue without success. this seems to be a flutter bug.

Here you can find some posible solutions https://github.com/flutter/flutter/issues/53573

SylvainFlattet commented 2 years ago

Thanks !

I've updated IPHONEOS_DEPLOYMENT_TARGET = 9.0;

to

IPHONEOS_DEPLOYMENT_TARGET = 11.0;

tuxrick commented 2 years ago

Ok you may close this ticket the issue was also on the pod version.

Steps to fix:

sudo gem uninstall cocoapods sudo gem install cocoapods -v 1.9.0

then

cd ios pod deintegrate pod install

Open your xcode project and archive