is there a way to create a Podfile in my flutter project using android studio? - ios

I'm trying to add firebase to my flutter project
I'm using windows machine so I did add it to the android level app while I'm trying to add it to the IOS level app I can't find a way to create the PodFile can someone please help?
as well I don't have access to a mac right now

well I just solved the problem by navigating to the project file via CMD and to the ios file then typing pod init

Related

Exposing flutter module as IOS framework results in "Failed to find assets path for "Frameworks/App.framework/flutter_assets"

I am receiving Failed to find assets path for "Frameworks/App.framework/flutter_assets when trying to expose a Flutter project via a framework to another IOS project (Add to App via a Framework).
I created a Flutter project that i now want to expose as a native Framework for IOS. We want to share our project with other companies so that they can integrate it in their IOS application.
I followed the documentation described on https://flutter.dev/docs/development/add-to-app/ios/project-setup and i used option C. This will create an XCFramework of our Flutter module and integrate it in our native IOS Framework which will have an API to work with the flutter project. In that way our IOS Framework can be seen as an Umbrella kind of Framework but also with an exposed API.
So what i created is:
A Flutter module
An IOS Framework
An IOS Project
I build the flutter module using ./flutterw build ios-framework --cocoapods --xcframework --no-universal --output=../WhiteLabelIOSFrameWork/Flutter --verbose into the IOS Framework. I added the libraries to the Framework and i created a codespec file for the Framework with only Flutter as a dependency. Afterwards i added a Podfile to the project and added the Framework as a dependency.
All of this is working (i only needed to upgrade to Flutter 1.24.X to have this fix available https://github.com/flutter/flutter/pull/69736). But when i start my Flutter engine it's unable to find the flutter_assets (Failed to find assets path for "Frameworks/App.framework/flutter_assets).
I tried building the ios-framework directly into our IOS project and skip the in between Framework and then it seems to work. So i think it cannot find the flutter_assets since the App.framework is not in the IOS project itself, but in a Framework in between.
Is there a way to move the flutter_assets path or so? Or any other idea on how to solve this?
Kind regards,
Daan
This issue cause when you create Flutter Engine without FlutterDartProject.
Just add FlutterEngine(name: "your name", project: FlutterDartProject(precompiledDartBundle: Bundle.init(for: Self.self)))

Ionic app loads using Ionic serve but not with Xcode

I'm currently stuck on a problem related to my Ionic project.
I have an Ionic project on GitHub which i've been working on in the past few weeks, i have a few Cordova plugins as part of the project.
When downloading the project from GitHub, i can run the app using Ionic Serve without a problem. However, when trying to setup the project for xCode to run on local device(s), i run into a multitude of errors
Some include:
When running ionic 'cordova platform add ios' the following error appears
Error: Could not install from "ios" as it does not contain a package.json file.
When trying to run 'ionic cordova run ios -l --external'
Error: Error: terminating with uncaught exception of type NSException
I have not yet tried to transfer my code into a new Ionic project, as i wish to see if my problem can be solved without that hassle.
View project code here: https://github.com/designsheikh/bitsandbobs.git
I figured it out. You have the exact same issue I've had with the android platform.
As I pointed it out in the comments, it is indeed caused by a "corrupted" project architecture.
How it happened
Initially, I had an issue with the cordova generated resources, somehow not being copied into the android platform directory. I tried plenty of things with the cordova-res CLI, including using the --copy and the --ios-project flags to force the copy to happen in the directory of my choice.
I couldn't manage to fix my issue, and then decided to rollback all my changes and start over on a clean project to try something else. Since then, I was not able to add the android platform anymore. Every single time, the following error was being thrown :
Error: Could not install from "android" as it does not contain a package.json file.
Explanation
With all my testing, I noticed that when using cordova to add the platform or copy the resources over, somehow, it had created the android platform in the wrong directory, at the root of my project instead of in the platforms folder. And that's where the issue comes from.
I can't explain it, but you will encounter this error every single time if you try to add a platform with cordova while having a folder with this platform name at the root of your project. I have no idea why this would prevent a platform from being added to the project, maybe this folder is used as a temp folder by the CLI.
Solution
The fix is to simply remove any ios or android directory at the root of your project.
The error will go away and you will be able to add the platform again.
#CodingJunkie
Regarding the Github repository you provided in your post, you will likely run into another error while trying to add the ios platform if you use cordova#>=9.0.0.
Using "requireCordovaModule" to load non-cordova module "xcode" is not supported.
Instead, add this module to your dependencies and use regular "require" to load it.
Check this issue#1033 for a workaround. However, it's not recommended to directly edit the plugin source code, you might want to look for another cordova Firebase plugin.
I also noticed you kinda mixed up cordova and capacitor in your project.
Make sure to use one or the other to avoid potential errors.
Hope this helped !
#Reqven
Thank you for your support! - i was sure that i had done this step while trying to fix the issue. It is such an absurd problem, it seems that there is a new project architecture as you mentioned which needs to be followed. I followed your steps with also one minor additional step as im working on the iIOS platform:
Delete iOS folder
cordova platform add ios
cordova prepare ios
ionic build
If step 2 throws an error causing the version not to be found or integrated into the project run - include '#latest' this also solved my problem

How to integrate Firebase Crashlytics for iOS part of Flutter app?

I am trying to integrate firebase_crashlytics in my Flutter App.
https://pub.dartlang.org/packages/firebase_crashlytics#-readme-tab-
I am facing an issue with iOS integration. In the docs, it is specified that If on Xcode 10 Add your app's built Info.plist location to the Build Phase's Input Files field. Eg: $(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)
I have already created the Firebase project and did the initial setup required on the iOS part like pod install for Firebase and adding code in AppDelegate File.
I am not able to figure out what does this means? does it mean the literal path of info.plist file. I downloaded the sample project mentioned in the docs but it does not have anything related to the above point. I did something as below
I literally added the path to my info.plist file as below $(BUILT_PRODUCTS_DIR)/$(/Users/priitshsawant/Desktop/firebase_crashltics/firebase_crashltics/ios/Runner/Info.plist). I tried crashing my app but it is not showing up in Firebase Crashlytics
You should be perfectly fine by just leaving it as $(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)
This will resolve to your absolute path of the Info.plist once Xcode is building.
Just like so:
I fixed this problem following these steps.
Make sure that Run Script is added as mention by the Robin Reiter
Run Flutter Clean
Run Pod install
Then use Xcode to build and run
if it's not working with the actual device use the simulator
it's work for me in firebase_crashlytics: 2.5.1:
${PODS_ROOT}/FirebaseCrashlytics/run
not use
"${PODS_ROOT}/FirebaseCrashlytics/run"

Installing react-native-custom-segmented control, need to install ios framework to react-native project

I'm trying to install this: https://github.com/wix/react-native-custom-segmented-control into my react-native project.
In the installation instructions, it says to move the .xcodeproj file to my project folder. I dragged it to the root folder of my project (though I am not sure that is right).
Then the instructions say to add the libCustomSegmentedControl.a file to my target's library.
The project was initialized using expo and I don't think it has a xcode target project? I am confused as to how to proceed in installing this. Is there a secret place in a react-native app that I can find the xcode project?
I'm a beginner with ios so any help would be really appreciated!
If you created the project using expo then you need to eject it before you can install any module that expo doesn’t support.
You can find more info at this link.
https://docs.expo.io/versions/latest/expokit/eject
Expo doesn’t actually have an Xcode or Android project inside the code base, so you can’t add react-native-custom-segmented-control to an expo project.
This post does a good breakdown of the differences between creating a react-native project using expo or react-native init
https://stackoverflow.com/a/49324689/5508175

Xcode showing error 'No such module' even though I've installed Cocoapods and installed pod file of Dialogflow

I've been making a chatbot using Dialogflow formerly Api.AI but now encountering error while integrating the project to my app written in Swift in Xcode. I'd installed cocoapods using terminal "sudo gem install cocoapods" and using this version of Dialogflow to create the podfile.
All gone well but now when I'm importing inside Xcode in my app's AppDelegate.swift file using import ApiAI or import AI Xcode is showing me error that No such module. Please refer to image.
And on GitHub this library which is written in Swift, showing that it has depreciated and asking me to refer to API.AI's Apple Client library which is in Obj-C and unfortunately I've no expertise in Obj-C.
After installing a pod using Cocoa Pods, you must from that point forward open the workspace rather that the project file. The icons will appear differently in your project like so:
In the image you provided is clearly showing that you have opened the project file not the workspace one.
Go to Pods Build settings and set Build Active Architecture Only to NO. This always helps while using pods. After that clean the project once and then build.
After installing pod you should clean project (shift + command + k) and then builds (command + b) in it a few times. Repeat it a few times if it is not still working.
Hope this help!

Resources