Flutter: Error compiling iOS app on CodeMagic, 'file_picker' not found - ios

I don't own a Mac and am compiling by CodeMagic, but I'm trying to solve this problem early on, i've done everything but the same thing happens all the time.
On Android it works fine.
Can anyone help me?
/Users/builder/clone/ios/Runner/GeneratedPluginRegistrant.m:12:9: fatal error: module 'file_picker' not found
#import file_picker;
~~~~~~~^~~~~~~~~~~
1 error generated.
Below is my Podfile...
# Uncomment the next line to define a global platform for your project
platform :ios, '11.0'
target 'Runner' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for Runner
end
File_picker version in my pubspec.yaml file
file_picker: ^4.6.1

Related

Flutter iOS error: GeneratedPluginRegistrant.m: fatal error: module 'package_info' not found

In my Flutter project, I target both Android and iOS, and I added the following libraries in my pubspec.yamlfile:
url_launcher: ^5.7.10
package_info: ^0.4.3+4
Now, when I run my app in debug mode on an iOS emulator, I got the following error during compile time:
/Users/blabla/MyProject/Developpement/myproject/ios/Runner/GeneratedPluginRegistrant.m:10:9: fatal error: module 'package_info' not found
#import package_info;
~~~~~~~^~~~~~~~~~~~
1 error generated.
I can see the error in Xcode, when I open GeneratedPluginRegistrant.m:
I took a look at that, and maybe the problem comes from the fact that I use a custom Cocoapods file in my project (a custom Podfile), not sure though. The problem is: I need that file to import AWS libraries in my iOS project.
Here is the content of my Podfile:
platform :ios, '12.0'
target 'Runner' do
use_frameworks!
pod 'AWSMobileClient'
pod 'AWSAPIGateway'
pod 'AWSS3'
end
So how can I fix that problem?
Thanks.
I finally managed to make this work by doing the following:
create a new Flutter project, and add, in pubspec.yaml, the url_launcher and package_info libraries
open the iOS module using Xcode, and open the Podfile
copy the content of that Podfile, and paste it in the Podfile of my current project
move, in the target Runner block of my Podfile project, the already existing libraries (in my case, the 3 AWS libraries)

Xcode Error: "ld: framework not found..."

I've got an iOS project on Xcode that uses Firebase, which was downloaded through Cocoapods. Everything was working fine - running on both simulators and devices - until I tried to run the app on an iPad 7th generation simulator and this error was thrown:
ld: framework not found GoogleAppMeasurement
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Now the project won't build on any device or simulator. I navigated through the Pods folder to check if GoogleAppMeasurement had its framework and it does. Besides this one error, there's no frameworks highlighted in red (like some other related questions mention) or other indication of what could have gone wrong.
Here's my pod file in case it helps:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'my project's name' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for my project's name
pod 'Firebase/Auth'
pod 'Firebase/Firestore'
pod 'Firebase/Core'
end
This same error has popped up on another one of my firebase-reliant projects and I've had no luck getting rid of it there either. Any suggestions on how to keep troubleshooting are welcome.

Running project on iPhone crashes but it works on the simulator

This is the error that I get and I'm not sure how to fix the issue.
dyld: Library not loaded: #rpath/AWSAuthCore.framework/AWSAuthCore
Referenced from:
/private/var/containers/Bundle/Application/989872E5-F2E1-4360-97B6-5995192BA95A/Project.app/Project
Reason: no suitable image found. Did find:
/private/var/containers/Bundle/Application/989872E5-F2E1-4360-97B6-5995192BA95A/Project.app/Frameworks/AWSAuthCore.framework/AWSAuthCore:
code signature invalid for
'/private/var/containers/Bundle/Application/989872E5-F2E1-4360-97B6-5995192BA95A/Project.app/Frameworks/AWSAuthCore.framework/AWSAuthCore'
In the target's General tab, under the Embedded Binaries field add the AWSAuthCore framework to resolve the crash.
In your Podfile comment the line of use_frameworks! like this
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'YourApp' do
# Comment the next line if you don't want to use dynamic frameworks
# use_frameworks!
use_modular_headers!
And add use_modular_headers!
Then do this in your terminal:
pod update
pod install
Unfortunately, Apple decided to prevent using cocoapods if your account is free.

Xcode build error - "Implicit declaration of function ‘sqlite3_key’ is invalid in C99"

I am modularising a large iOS app lets say, MyAppWithDatabase into two modules (i.e. projects). So I will have one main project MyApp as a host and a linked MyDataPlatform as a framework under same workspace MyApp.xcworkspace. When SQLCipher pod was integrated for target MyAppWithDatabase it worked fine, but as all of the database related codes are being moved into MyDataPlatform framework in refactoring, I want to integrate SQLCipher pod only for the framework to keep internal encryption mechanism abstract from host app. Now, when I have integrated for framework it started producing below build error.
Implicit declaration of function ‘sqlite3_key’ is invalid in C99
Note that this issue is being produced from one statement of MyApps source code as a warning but Xcode build treating it as error,
sqlite3_key(_db, [password UTF8String], (int)password.length);
I have the above line still remaining in MyApp because it takes time to move database related codes gradually into MyDataPlatform and I assume the SQLCipher headers are still supposed to be available in host app as the related framework in linked.
I have gone through many proposed solutions on the Internet but none of them worked for my case. I doubt most of the solutions are about integrating SQLCipher for host app only. What should I do when I get the error for framework in my case?
Below is the structure of my pod file (after refactored),
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
workspace 'MyApp.xcworkspace'
target 'MyApp' do
# Uncomment this line if you're using Swift or would like to use dynamic frameworks
use_frameworks!
pod 'Google/Analytics'
pod 'GoogleMaps'
# ...
target 'MyAppTests' do
inherit! :search_paths
end
end
target 'MyDataPlatform' do
project 'MyDataPlatform/MyDataPlatform.xcodeproj'
pod 'SQLCipher', '~>3.4.2'
#https://discuss.zetetic.net/t/ios-11-xcode-issue-implicit-declaration-of-function-sqlite3-key-is-invalid-in-c99/2198/53
post_install do | installer |
print "SQLCipher: link Pods/Headers/sqlite3.h"
system "mkdir -p Pods/Headers/Private && ln -s ../../SQLCipher/sqlite3.h Pods/Headers/Private"
end
end
Previously SQLCipher was integrated under MyAppWithDatabase i.e.
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
target 'MyAppWithDatabase' do
# Uncomment this line if you're using Swift or would like to use dynamic frameworks
use_frameworks!
pod 'Google/Analytics'
pod 'GoogleMaps'
pod 'SQLCipher', '~>3.4.2'
# ...
target 'MyAppWithDatabaseTests' do
inherit! :search_paths
end
end
My problem was solved after defining SQLITE_HAS_CODEC in application's,
MyApp -> Build Settings -> Other C Flags
Another solution also works after adding SQLITE_HAS_CODEC=1 in application's,
MyApp -> Build Settings -> Preprocessor Macros
My problem was caused by SPACEs in my project's pathname. The sqlite 'make' script that should generate the sqlite3.c at compilation time seems to trip when there are SPACEs in the sqlcipher library's pathname. I temporarily removed the SPACEs from the pathname and compilation worked.

Getting started with Firebase, iOS and Swift

Perhaps this is a n00b question but I'm going to ask it anyways. I followed the instructions for adding Firebase to a Swift app via CocoaPods. Everything seems to have worked fine. Here is my Podfile:
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
target 'FirebaseDemo2' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for FirebaseDemo2
pod 'Firebase'
end
When trying to import the Firebase module into the AppDelegate, at first Xcode complains it cannot find it but the project builds just fine. However, when trying to add the FIRApp it then fails to build because it cannot find the class.
The Podfile is in the same directory as the .xcodeproj and I am opening the .xcworkspace file in Xcode. This is really confusing me. Can someone see what I am doing wrong? Is CocoaPods misconfigured?
I had the same problem, it installed 2.5.1 but you need 3.2.0
Try running
pod update Firebase
You should now have Firebase 3.2.0
I think your Podfile should look like this:
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
use_frameworks!
target 'FirebaseDemo2' do
pod 'Firebase'
end
Make sure to open the Xcodeworkspace and not the Project

Resources