Unable to run flutter app on device with flutter_facebook_auth - ios

I am trying to implement login with facebook in my Flutter app. It seems the library to do so is https://pub.dev/packages/flutter_facebook_auth/install .
I followed all the installation instructions - and I am able to correctly run the app in the iPhone simulator. I am unable to run the app on my own device. The XCode build completes successfully, i.e. flutter build ios works but flutter run -d XXXXXXXX-XXXXXXXXXXXXXXXX (device ID snipped) fails with a lot of errors, here is some of the output of flutter run (see below).
How do I get this to run on my device?
/Users/imrigoldberg/Documents/flytrex/shopper/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/Internal/Instrument/FBSDKInstrumentManager.m:58:52: error: reference to 'FBSDKSettings' is ambiguous
settings:(id<FBSDKSettings>)settings
^
In file included from /Users/imrigoldberg/Documents/flytrex/shopper/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/Internal/Instrument/FBSDKInstrumentManager.m:34:
In file included from /Users/imrigoldberg/Documents/flytrex/shopper/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/Internal/FBSDKSettings+SettingsProtocols.h:22:
/Users/imrigoldberg/Documents/flytrex/shopper/build/ios/Debug-iphoneos/FBSDKCoreKit/FBSDKCoreKit.framework/PrivateHeaders/FBSDKSettingsProtocol.h:23:11: note: candidate found by name lookup is 'FBSDKSettings'
#protocol FBSDKSettings
^
In file included from /Users/imrigoldberg/Documents/flytrex/shopper/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/Internal/Instrument/FBSDKInstrumentManager.m:31:
/Users/imrigoldberg/Documents/flytrex/shopper/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKSettingsProtocol.h:23:11: note: candidate found by name lookup is 'FBSDKSettings'
#protocol FBSDKSettings
^
/Users/imrigoldberg/Documents/flytrex/shopper/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/Internal/Instrument/FBSDKInstrumentManager.m:58:52: error: type argument 'FBSDKSettings' must be a pointer (requires a '*')
settings:(id<FBSDKSettings>)settings
^
*
/Users/imrigoldberg/Documents/flytrex/shopper/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/Internal/Instrument/FBSDKInstrumentManager.m:58:49: error: type arguments cannot be applied to non-class type 'id'
settings:(id<FBSDKSettings>)settings
^ ~~~~~~~~~~~~~~~
2 warnings and 14 errors generated.

Related

Flutter iOS build failing on BigSur, XCode 12

Flutter iOS build fails due to issues with headers.
I followed the simple steps mentioned on flutter.dev for launching an app on iOS simulator. I've had no problems working with flutter on Android/Web, but this is the first time I've tried running it on iOS.
Summary of error - (Complete Error: https://gist.github.com/mannprerak2/520f8a749431a50b8472783c71d67dda)
...
#import "Headers/CoreMedia.h"
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.h:15:10: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.h:15:
#include <CoreMedia/CMFormatDescription.h>
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMFormatDescription.h:26:10: error: could not build module 'CoreAudio'
#include <CoreAudio/CoreAudioTypes.h>
^
/Users/prerakmann/development/test_ios/ios/Runner/Runner-Bridging-Header.h:1:9: note: in file included from /Users/prerakmann/development/test_ios/ios/Runner/Runner-Bridging-Header.h:1:
#import "GeneratedPluginRegistrant.h"
^
/Users/prerakmann/development/test_ios/ios/Runner/GeneratedPluginRegistrant.h:8:9: error: could not build module 'Flutter'
#import <Flutter/Flutter.h>
^
192 errors generated.
<unknown>:0: error: failed to emit precompiled header '/Users/prerakmann/Library/Developer/Xcode/DerivedData/Runner-ahrcvwuwhqnepxdcpfsagztcuwrr/Build/Intermediates.noindex/PrecompiledHeaders/Runner-Bridging-Header-swift_1QEOMJ6SUMBGB-clang_3BG5Q8JCTPBV5.pch' for bridging header '/Users/prerakmann/development/test_ios/ios/Runner/Runner-Bridging-Header.h'
384 errors generated.
<unknown>:0: error: generate-pch command failed with exit code 1 (use -v to see invocation)
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
...
System: Macbook Pro 13 (2020), BigSur 11.2.1, Xcode 12.4
Flutter: Tried on the latest stable and beta channel.
Simulator: Tried on iOS 8, iOS 12.
Steps to reproduce: Create a new flutter app, run it.
Turns out this was happening due to CPATH being defined like this.
╰─$ echo $CPATH
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
A temporary fix is to set CPATH= in current terminal window, run flutter clean, and then run the app.

vsCode doesn't run flutter app on physical iPhone

I just installed the latest version of flutter and xcode and I'm getting an error when I try running the flutter app on an actual iPhone. Works on ios simulator. The weird thing is that it works when I run it from xcode, but when I run it from vsCode, I get the following error:
It appears that your application still contains the default signing identifier.
Try replacing 'com.example' with your signing id in Xcode:
open ios/Runner.xcworkspace
What I tried doing:
Change the bundle identifier to myEmailAddress#gmail.com.appTitle
Clean and build the ios app
clean then ran flutter build bundle
What am I doing wrong and how can I get vsCode to run the app on an iPhone?
Here's the full error:
Launching lib/main.dart on Jessica’s iPhone in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: ITYTO5RCWD
Xcode build done. 25.4s
Failed to build iOS app
Error output from Xcode build:
↳
2020-04-19 13:53:51.828 xcodebuild[2046:21215] [MT] iPhoneConnect: 📱<DVTiOSDevice ...> == Underlying device preparation errors ==
2020-04-19 13:53:51.828 xcodebuild[2046:21215] [MT] iPhoneConnect: Failed _shouldMakeReadyForDevelopment check even though device is not locked by passcode.
Domain: com.apple.platform.iphoneos
Code: 5
Failure Reason: allowsSecureServices: 1. isConnected: 0. Platform: <"...platform info...">. DTDKDeviceIdentifierIsIDID: 0
User Info: {
DVTDeviceDescription = "...device info..."
}
--
2020-04-19 13:53:51.829 xcodebuild[2046:21215] [MT] iPhoneConnect: 📱<"...platform info..."> == END: Underlying device preparation errors ==
** BUILD FAILED **
Xcode's output:
↳
/Users/Jessica/Development/flutter/.pub-cache/hosted/pub.dartlang.org/audioplayers-0.15.1/darwin/Classes/AudioplayersPlugin.m:88:37: warning: incompatible pointer types sending 'FlutterEngine *' to parameter of type 'NSObject<FlutterBinaryMessenger> * _Nonnull' [-Wincompatible-pointer-types]
binaryMessenger:_headlessEngine];
^~~~~~~~~~~~~~~
In module 'Flutter' imported from /Users/Jessica/Development/flutter/.pub-cache/hosted/pub.dartlang.org/audioplayers-0.15.1/darwin/Classes/AudioplayersPlugin.h:2:
/Users/Jessica/Desktop/flutter_game2/ios/Flutter/Flutter.framework/Headers/FlutterChannels.h:178:74: note: passing argument to parameter 'messenger' here
binaryMessenger:(NSObject<FlutterBinaryMessenger>*)messenger;
^
1 warning generated.
/Users/Jessica/Desktop/flutter_game2/build/ios/Debug-iphoneos/Runner.app: resource fork, Finder information, or similar detritus not allowed
Command CodeSign failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
Could not build the precompiled application for the device.
It appears that your application still contains the default signing identifier.
Try replacing 'com.example' with your signing id in Xcode:
open ios/Runner.xcworkspace
Error launching application on Jessica’s iPhone.
Exited (sigterm)
Alright, so i solved this problem by pressing on the search icon on the top left of vscode, then searching for com.example
then i saw three search results that were in the ios folder click on it and replace all three com.example with the identifier you created in xcode.
you can change your signing identifier in Xcode
To do that, just open your workspace with app in Xcode, then go to signing and capabilities to change default com.example to anything else...
Better to use as follows to give app company / organization name
flutter create --org com.yourdomain your_app_name
Swift, Kotlin, and androidx dependencies are the default options
After just open the created project in Android Studio or in VSCode
Parameter
--org com.yourcompany
will form applicationId for Android:
com.yourcompany.yourappname
and iOS PRODUCT_BUNDLE_IDENTIFIER:
com.yourcompany.yourAppName
To explore all possible parameters type
flutter create --help

How to fix “swift package generate-xcodeproj” results in manifest parse error?

I'm new to Swift and the Package Manager. I'm following a tutorial that generates the Xcode project file, but I get errors when I run "swift package generate-xcodeproj" (or "swift package update" for that matter). Below is the output.
It looks like it doesn't recognise the 'uuid_string_t' type in hfs_format.h header file.
Any ideas on how to solve this? I'm using Xcode 10.2 and Swift 5 on macOS 10.14.4. My Xcode Command Line Tools setting under the Location Preferences tab is set to 10.2.
/Users/rayscott/Developer/Source/Swift/TCPClient: error: manifest parse error(s):
:353:9: note: in file included from :353:
#import "hfs/hfs_format.h"
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/hfs/hfs_format.h:794:2: error: unknown type name 'uuid_string_t'
uuid_string_t ext_jnl_uuid;
^
:353:9: note: in file included from :353:
#import "hfs/hfs_format.h"
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/hfs/hfs_format.h:796:20: error: use of undeclared identifier 'uuid_string_t'; did you mean 'uuid_variant'?
char reserved[JIB_RESERVED_SIZE];
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/hfs/hfs_format.h:787:61: note: expanded from macro 'JIB_RESERVED_SIZE'
#define JIB_RESERVED_SIZE ((32*sizeof(u_int32_t)) - sizeof(uuid_string_t) - 48)
^
/usr/local/include/uuid/uuid.h:98:5: note: 'uuid_variant' declared here
int uuid_variant(const uuid_t uu);
^
:0: error: could not build Objective-C module 'Darwin'
I had the same issue after installing Xcode 10.2 and macOS 10.14.4. Solution for me was to run the following commands in Terminal:
brew doctor, and fix the mentioned issues
sudo xcode-select --reset
After executing these steps I did a reboot, and build started to work again.

Can't build OpenCV 3.1 on Windows (using MinGW)

I need to build OpenCV from source, because I want to make modifications to it. So using pre-built binaries is not an option for me. I'm doing this on Windows 8. I do not have MS Visual Studio, and I don't want to use it.
Here is how I reproduce the build error:
I git clone https://github.com/opencv/opencv
I use CMake 3.7.1, press Configure, then press Generate. It seems to work (no errors). I named the output folder opencv/release.
I go to the opencv/release folder, and type mingw32-make.
Eventually, after compiling for a while, it displays the following error message:
Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/parallel.cpp.obj
modules\core\src\parallel.cpp:135:43: error: operator '&&' has no right operand
modules\core\src\parallel.cpp: In function 'void cv::parallel_for_(const cv::Range&, const cv::ParallelLoopBody&, double)':
modules\core\src\parallel.cpp:311:52: error: 'parallel_for_pthreads' was not declared in this scope parallel_for_pthreads(range, body, nstripes);
^
modules\core\src\parallel.cpp: In function 'int cv::getNumThreads()':
modules\core\src\parallel.cpp:370:50: error: 'parallel_pthreads_get_threads_num' was not declared in this scope return parallel_pthreads_get_threads_num();
^
modules\core\src\parallel.cpp: In function 'void cv::setNumThreads(int)':
modules\core\src\parallel.cpp:431:46: error: 'parallel_pthreads_set_threads_num' was not declared in this scope parallel_pthreads_set_threads_num(threads);
^
modules\core\CMakeFiles\opencv_core.dir\build.make:990: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/src/parallel.cpp.obj' failed mingw32-make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/parallel.cpp.obj] Error 1
Note: I tried to compile both with and without TPP (in the CMake config), and I get the same error message.
Also, I read the other similar questions on StackOverflow and the answers do not help.

Xcode build creation errors on Generic iOS Device

My project is working fine when run in debug mode, on device or simulator.
But when i try to build project for Generic IOS Device it gives me 282 errors.
Here is the screenshot:
Some main points are
Header 'stdatomic.h' not found
Unknown type name '__BEGIN_DECLS'
Could not build module 'CoreFoundation'
Expected function body after function declarator
Unknown type name 'size_t'
Could not build module 'os_object'
Could not build module 'UIKit'

Resources