Error in resolving package dependency swiftUI project - swift

Dependencies could not be resolved because root depends on 'googleappmeasurement' 9.0.0.
'googleappmeasurement' 9.0.0 cannot be used because 'googleappmeasurement' 9.0.0 depends on 'nanopb' 2.30908.0..<2.30909.0 and root depends on 'nanopb' 2.30909.0..<2.30910.0.
that is my error message, can anyone help?

I am using SDK version 8.9.1 and everything working fine, If you executed the Resolve Package Versions and still not working. you can try the command Reset Package Caches from Project navigator scroll down right click on Package Dependencies then choose the command. that will clear all caches for all installed packages then re-install them again. if that not working i suggest you to use version 8.9.1 till Firebase fix the issue.

I have discovered the problem has been answered here. It occurs when importing Firebase using Swift Package Manager and setting to track "master" instead of a specific release version.

Got same error and solved, check attached image, this most likely packages usage misconfiguration, as follows:
1-perhaps you are working on a branch with different Xcode version than the other developer who installed the package.
2-Perhaps some package is conflicted being used twice, by so some dependencies are duplicated.
Well to solve this you gotta try either to match the Xcode version used while installing the packages, or to remove the package that makes errors(like Firebase here), and try adding that package again your side.

Related

After cloning any flutter project I can not resolve dependencies?

I want to clone open source projects, I face a hole punch of errors after tapping pub get, all dependencies cannot be resolved and many of the code is out of date, so how can I overcome this?
Please use intl 0.17.0 to resolve the issue
This problem is due to the conflict between dependency versions.
You are using two dependencies that need different version of intl:
flutter_localization
openfluttercommerce
in your pubspec.yaml change the version of intl from 0.16.0 to 0.17.0. It may cause another conflict with other dependencies that may depend on 0.16.0 version of intl. If it accurs, you need to change the version of utilized dependencies to whatever need the same version of intl.
Whenever you clone the project from Github try to open it with flutter sdk version 1.17.0 or 1.22.4 after seeing the first commit of the project then the problem seems to be solved.
but here it seems that you got problem with two dependencies try to resolve that by not mentioning any version in yuml file.

Flutter | Error: Couldn't resolve the package

I created a package that is a collection of my own helper classes for faster developing...
The package also included firebase_analytics: which requires a native implementation for each platform i want it to run. Even if i dont wanted to use firebase at all, but still wanted to use my package i was forced to create firebase-config files for the app, because the app crashes if the firebase_analytics package does not find a valid file for the specific platform. To avoid those things i splitted my package in two packages.
The Core-Package: All helper classes that run native dart code
Optional extension: Only the classes that need the firebase implementation
So if i want to use the package without firebase i just have to depend on the core.
If i want to use the firebase variant i could simply depend the firebase package, because the extension package itself depends on the core-package in its own pubspec.yaml file.
PROBLEM: Since i restructured my package like i described, all my apps that depend on it are not building anymore. The console says that all packages that i depend on in my two packages can not be found. This error occures both ways: With firebase & without.
ERROR: (Scroll down for the complete console output)
MY ATTEMPTS:
"flutter clean" & "flutter pub get" in every package and app folder
"flutter pub cache repair"
CORE-PACKAGE Pubspec.yaml:
FIREBASE-Extension Pubspec.yaml:
Plain Console Output:
pastebin.com/m14cbqDV
Thanks for any help!!
I am facing the same issue while i was making a build in Xcode 13.So I had upgraded my flutter version 2.8.0 to 2.10.2 and also removed the version of all firebase dependencies, then the issue was finally solved.
I have faced similar issues and resolved them by removing package versions. Issues like this often arise due to mismatched versions of packages (eg firebase_core, firebase analytics). Please try to remove versions of the firebase packages or the whole packages. (like firebase_analytics :).
Sorry, my bad! As you can see i moved my dependencys to the dev section of my pubspec.yaml. They should be placed in the dependency section.

XCode 12.5 won't allow me to add Swift packages. Package resolution failed. <folder> exists and is not an empty directory (-4)

What do I need to do to resolve this?
I can't add Swift packages to my project without XCode 12.5 complaining about a folder that didn't exist there prior to adding the package using Swift packages -> Add package dependancy.
I've tried
Reinstalling XCode
Deleting DerivedData
Clean Build folder
Reset package caches
Resolve package versions
Update to latest package versions
The image below shows ViewInspector failing, but that seems stochastic. The error occurs when fetching SwiftUI-Introspect every other time as well. This hints at a race condition somewhere. It doesn't matter which package I try to add, The folder in deriveddata will be created and XCode will complain and abort.

In flutter when I am trying to run project it is giving error

Pease help me!, I am new to flutter I am importing a project and when I try to run it is giving exception
/simple_permissions-0.1.9/android/src/main/java/com/ethras/simplepermissions/SimplePermissionsPlugin.java:9: error: cannot find symbol
import android.support.v4.app.ActivityCompat;
^
symbol: class ActivityCompat
location: package android.support.v4.app
My project is already compatible with androidX, I have tried package get and upgrade package but nothing happens, I have got the similar problem
When you migrate a flutter app to AndroidX, all the plugins the app depends on should also support AndroidX else your app build will fail and this is what is happening here.
Even though you have migrated your project to AndroidX, the simple-permissions plugin has not been migrated to AndroidX yet and this is what is causing the issue.
Below are the options you have in this case -
1. User the permission_handler plugin instead of simple-permissions.
The permission_handler plugin is a much more frequently updated plugin which has already been migrated to AndroidX. Here is the link to the plugin.
2. Migrate simple-permissions to AndroidX yourself
If you strictly want to use simple-permissions, you can clone the git repo and manually migrate the plugin to AndroidX and use the plugin via git url inside your pubspec.yaml. Details for migrating plugins to AndroidX can be found here.
You can use the plugin from git url in the following way inside you pubspec.yaml
dependencies:
plugin1:
git:
url: git://github.com/flutter/plugin1.git
//Your repo url goes in place of this url
3. Avoid using AndroidX altogether in you app.
You can force your app to use the older support libraries if you do not wish to perform the above two steps, but by doing this you will need to downgrade all your plugins to versions which do not use AndroidX, which is not the ideal solution.
More about this here.
Hope this helps!

Issues with cocoapods after upgrading Xcode

Updated my Xcode project and my IQKeyboardManager cocoapod was not working. I updated it and now I get this error:
Module file was created by an older version of the compiler; rebuild IQKeyboardManagerSwift
Any help on how to 'rebuild' a cocopod?
You can't rebuild the Cocoapods repo. You need to use the Use Legacy Swift Language Version to YES in your project.