Flutter Cannot complie project when using Firebase In App Messaging plugin - xcode

I successfully implemented the plugin on android but when I try to start the app on ios I'm getting an error message. When I disable the plugin and reinstall the app on ios, everything works just fine.
Here is my console log:
Launching lib/main.dart on iPhone 5s in debug mode...
Running pod install...
Warning: Podfile is out of date
This can cause a mismatched version of Flutter to be embedded in your app, which may result in App Store submission rejection or crashes.
If you have local Podfile edits you would like to keep, see https://github.com/flutter/flutter/issues/24641 for instructions.
To regenerate the Podfile, run:
rm ios/Podfile
Running Xcode build...
Xcode build done. 41,0s
Could not build the application for the simulator.
Error launching application on iPhone 5s.
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
While building module 'FirebaseInAppMessaging' imported from /Users/manolo/Developer/flutterprojects/fitness_recipes_clean/ios/Pods/FirebaseInAppMessagingDisplay/Firebase/InAppMessagingDisplay/FIDBaseRenderingViewController.h:19:
In file included from <module-includes>:1:
In file included from /Users/manolo/Developer/flutterprojects/fitness_recipes_clean/ios/Pods/Target Support Files/FirebaseInAppMessaging/FirebaseInAppMessaging-umbrella.h:13:
/Users/manolo/Developer/flutterprojects/fitness_recipes_clean/ios/Pods/FirebaseInAppMessaging/FirebaseInAppMessaging/Sources/Public/FirebaseInAppMessaging.h:21:2: warning: The FirebaseInAppMessagingDisplay subspec is deprecated. Please remove FirebaseInAppMessagingDisplay from your Podfile (or delete the framework). [-W#warnings]
#warning The FirebaseInAppMessagingDisplay subspec is deprecated. Please remove FirebaseInAppMessagingDisplay from your Podfile (or delete the framework).
^
1 warning generated.
1 warning generated.
1 warning generated.
1 warning generated.
While building module 'FirebaseInAppMessaging' imported from /Users/manolo/Developer/flutterprojects/fitness_recipes_clean/ios/Pods/Headers/Public/Firebase/Firebase.h:53:
In file included from <module-includes>:1:
In file included from /Users/manolo/Developer/flutterprojects/fitness_recipes_clean/ios/Pods/Target Support Files/FirebaseInAppMessaging/FirebaseInAppMessaging-umbrella.h:13:
/Users/manolo/Developer/flutterprojects/fitness_recipes_clean/ios/Pods/FirebaseInAppMessaging/FirebaseInAppMessaging/Sources/Public/FirebaseInAppMessaging.h:21:2: warning: The FirebaseInAppMessagingDisplay subspec is deprecated. Please remove FirebaseInAppMessagingDisplay from your Podfile (or delete the framework). [-W#warnings]
#warning The FirebaseInAppMessagingDisplay subspec is deprecated. Please remove FirebaseInAppMessagingDisplay from your Podfile (or delete the framework).
^
1 warning generated.
1 warning generated.
While building module 'FirebaseInAppMessaging' imported from /Users/manolo/Developer/flutterprojects/fitness_recipes_clean/ios/Pods/Headers/Public/Firebase/Firebase.h:53:
In file included from <module-includes>:1:
In file included from /Users/manolo/Developer/flutterprojects/fitness_recipes_clean/ios/Pods/Target Support Files/FirebaseInAppMessaging/FirebaseInAppMessaging-umbrella.h:13:
/Users/manolo/Developer/flutterprojects/fitness_recipes_clean/ios/Pods/FirebaseInAppMessaging/FirebaseInAppMessaging/Sources/Public/FirebaseInAppMessaging.h:21:2: warning: The FirebaseInAppMessagingDisplay subspec is deprecated. Please remove FirebaseInAppMessagingDisplay from your Podfile (or delete the framework). [-W#warnings]
#warning The FirebaseInAppMessagingDisplay subspec is deprecated. Please remove FirebaseInAppMessagingDisplay from your Podfile (or delete the framework).
^
1 warning generated.
1 warning generated.
duplicate symbol '_OBJC_CLASS_$_FIRIAMDefaultDisplayImpl' in:
/Users/manolo/Developer/flutterprojects/fitness_recipes_clean/build/ios/Debug-iphonesimulator/FirebaseInAppMessaging/FirebaseInAppMessaging.framework/FirebaseInAppMessaging(FIRIAMDefaultDisplayImpl.o)
/Users/manolo/Developer/flutterprojects/fitness_recipes_clean/build/ios/Debug-iphonesimulator/FirebaseInAppMessagingDisplay/FirebaseInAppMessagingDisplay.framework/FirebaseInAppMessagingDisplay(FIRIAMDefaultDisplayImpl.o)
duplicate symbol '_OBJC_METACLASS_$_FIRIAMDefaultDisplayImpl' in:
/Users/manolo/Developer/flutterprojects/fitness_recipes_clean/build/ios/Debug-iphonesimulator/FirebaseInAppMessaging/FirebaseInAppMessaging.framework/FirebaseInAppMessaging(FIRIAMDefaultDisplayImpl.o)
/Users/manolo/Developer/flutterprojects/fitness_recipes_clean/build/ios/Debug-iphonesimulator/FirebaseInAppMessagingDisplay/FirebaseInAppMessagingDisplay.framework/FirebaseInAppMessagingDisplay(FIRIAMDefaultDisplayImpl.o)
ld: 2 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
note: Using new build system
note: Planning build
note: Constructing build description
Has somebody faced the same issue and was able to fix it?

I fixed it!
comment firebase_in_app_messaging i.e (#firebase_in_app_messaging: ^0.1.1+3)
inside pubspec.yaml
Run flutter packages get
Delete Podfile.lock inside the ios folder
open up your terminal
cd to the projects ios folder
enter Vim Podfile
press "i" for insert mode
add these to lines to the bottom:
pod 'Firebase', '6.15.0'
pod 'FirebaseInAppMessaging', '0.16.0'
Press "esc" on your keyboard to save
enter pod install
enter pod update Firebase/Core
add uncomment firebase_in_app_messaging inside pubspec.yaml
run flutter packages get

You can try the following:
flutter clean.
rm ios/Podfile
rm ios/Podfile.lock
pod update
pod install
This could do the work.

Related

pod command is not recognized when running flutter project

I have tried every suggestion and solution in stack overflow and GitHub and yet I am not able to run pod install and I get pod : command not found , also my pod file is empty.
Warning: CocoaPods not installed. Skipping pod install.
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds
to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To install:
sudo gem install cocoapods
Running Xcode build...
Xcode build done. 6.4s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
error: /Users/seyedaliaghamali/Documents/projects/my_app/ios/Flutter/Debug.xcconfig:1:
could not find included file 'Pods/Target Support Files/Pods-Runner/Pods-
Runner.debug.xcconfig' in search paths (in target 'Runner')
error: /Users/seyedaliaghamali/Documents/projects/my_app/ios/Flutter/Debug.xcconfig:1:
could not find included file 'Pods/Target Support Files/Pods-Runner/Pods-
Runner.debug.xcconfig' in search paths (in target 'Runner')
error: /Users/seyedaliaghamali/Documents/projects/my_app/ios/Flutter/Debug.xcconfig:1:
could not find included file 'Pods/Target Support Files/Pods-Runner/Pods-
Runner.debug.xcconfig' in search paths (in target 'Runner')
error: /Users/seyedaliaghamali/Documents/projects/my_app/ios/Flutter/Debug.xcconfig:1:
could not find included file 'Pods/Target Support Files/Pods-Runner/Pods-
Runner.debug.xcconfig' in search paths (in target 'Runner')
error: /Users/seyedaliaghamali/Documents/projects/my_app/ios/Flutter/Debug.xcconfig:1:
could not find included file 'Pods/Target Support Files/Pods-Runner/Pods-
Runner.debug.xcconfig' in search paths (in target 'Runner')
error: /Users/seyedaliaghamali/Documents/projects/my_app/ios/Flutter/Debug.xcconfig:1:
could not find included file 'Pods/Target Support Files/Pods-Runner/Pods-
Runner.debug.xcconfig' in search paths (in target 'Runner')
warning: Capabilities for Runner may not function correctly because its entitlements
use a placeholder team ID. To resolve this, select a development team in the build settings
editor. (in target 'Runner')
note: Using new build systemnote: Planning buildnote: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone Xʀ.
The error was caused by CocoaPods not being installed, therefore pod install can't be run. Simply install CocoaPods to solve this issue. Run either sudo gem install cocoapods or install it without sudo following this guide.

AFNetworking - ld: library not found for -lAFNetworking

I have an Xcode project with Cocoa Pods installed which I added a tvOS single view app target. I shared with the tvOS target all the pod installed. When I build and run my iOS target everything is ok, but when I run the tvOS target I get this error
"ld: library not found for -lAFNetworking clang: error: linker command failed with exit code 1 (use -v to see invocation)"
So after searching on the web I found a solution to this error. If I go to the Build Settings for the tvOS target and under Valid Architectures I remove arm64 and type armv7 the error disappears but then when i run the project i get this: the file couldn't be opened because you don’t have permission to view it.
First, you must sure you're opening the .xcworkspace file, not the .xcodeproj file.
Then, open your project folder and run command pod install and reopen .xcworkspace file it will fix your issue.

error: conditional compilation flags must be valid Swift identifiers (rather than 'DEBUG”')

I'm trying to build my project with Xcode 9 beta 6 (9M214v). Also, I'm using CocoaPods. I've converted to Swift 4 and updated my project settings, but I keep getting this error.
Things I've tried so far:
Clean project and build folder
Deleting / re-adding pods
Restart Xcode
Remove Active Compilation Conditions flags
Anyone has an idea how to solve this?
Error message:
<unknown>:0: error: conditional compilation flags must be valid Swift identifiers (rather than 'DEBUG”')
Command /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1
Podfile
target 'iOS Application' do
use_frameworks!
pod 'SwiftLint'
pod 'RealmSwift'
pod 'ReachabilitySwift'
pod 'Fabric'
pod 'Crashlytics'
end
Found the error! In my iOS Application target's Build Settings, at Swift Compiler - Custom Flags > Other Swift Flags. There was a ”, instead of " at the end of the flag. I have no idea how this happened, but the quotation mark caused the error.
I find when you modify your "x-Code" setting for custom flags "Debug" to delete "-D",and then replace your swift language version to "Swift 4.0" ,It will fix your problem! Hoping help you...

xcode build error framework not found

Okay, using xcode7, swift and ios7 target.
I installed cocoapods
I change terminal to my project file folder and ran pod setup
Now Podfile is in the same directory as my .xcodeproj file and loks like this:
plaform :ios, '7.0'
use_frameworks!
pod 'OAStackView'
I change terminal to my project file folder and run pod install
Now, if I try build I get:
Frame not found OAStackView clang: error: linker command failed with
exit code 1 (use -v to see invocation)
Am I supposed to do anything else to get OAStackView working? (I verified the problem also happens wih other pods) I have not yet imported it to any unit or anything, just trying to compile
I think you might be opening the .xcodeproj instead of opening .xcworkspace. With CocoaPods we have to open .xcworkspace file.

library not found for -lBaiduMapApi

I use cocoaPods in my current project.
Because the 'Baidu map iOS SDK' don't have a pod spec so I just create one.
The 'Baidu map iOS SDK' use a '.a' static library and some header files, I add them into my project through cocoaPods
But when I build my project, it always has an error:
ld: library not found for -lBaiduMapApi
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I google it then I try to set the Library Path in Xcode.
Both in my project and the target in Pods.
I am sure the path is correct, but the error still there.
Can somebody help me?
It's weird......
I remove whole my project and Recreate a new one.
And config the Podfile, update .....
When I back to the Xcode, build, Success!!!
I can find another way to solve this problems

Resources