in Xcode12 beta the Swift package manager fails to load dependencies - xcode

Recently the SPM has started to give me errors. Was working before.
I'm trying to use the AlamofireImage library but xcode fails to resolve de dependency and doesn't give any good explanation.
Does anybody know why and how to make it work?

this was once happened to me, maybe you can try to go ahead to File > Swift Packages > Update to Latest Package Versions. Let's see if that works

I ran into a similar issue when I was trying to arrange the files inside the project folder, and when I put them back to their old position the problem was resolved and the app run successfully.

I found something that's not ideal, but works for now. In your main xCode project file, go under Project not Target and find Package Dependencies. After finding it, remove the SDK, and then right click on the name of your project and add a package. This time when adding Firebase, use Minor version. It should hopefully resolve and install.

Related

How do I manually remove a nuget package for .Net MAUI

I'm in the process of migration a XamarinForms 5 app to MAUI and the latest error I get is
The Java type `mono.android.support.v4.media.session.MediaSessionCompat_OnActiveChangeListenerImplementor` is generated by more than one managed type
Searching online, so far I think it is because the app is using Android.Support.V4 when it should only be using AndroidX, causing the duplicate to be generated as AndroidX replaces Support.V4.
However I cannot figure out how to remove the Support.v4 package because the only reference to it is an implicit reference by an SDK which I cannot remove ( see screenshot below)
The project file (MAUI) only has these package references
Any help greatly appreciated.
Thanks
I'll answer my own question as I managed to figure out the issue after a solid several hours long session.
No packages needed to be removed. Somehow I had managed to install a version of
Birdie.Plugin.FirebasePushNotification from 2020 , instead of `Plugin.FirebasePushNotification', the current version.
The solution was to remove that old package and install the correct once which made the error go away.

Running old code on new flutter and dart version

I abandoned a project I was working on for a while I came back to open it on upgraded flutter and dart plugin in visual studio code windows 10.now I get so many problems. is there a way to automatically update code to solve these errors?
do these steps:
delete build folder
delete .idea folder
run flutter clean
run flutter pub get
run flutter pub upgrade
then try to run your project.
The simple answer is it depends.
Judging by the comments from a reasonably good answer by Hasan Abbasi, this wasn't enough.
Depending on how old your project is, there are 2 choices before or after doing what that answer said:
If it's any more than 2 or 3 years old, I'd probably rewrite it from scratch. In that time, Flutter and Dart have matured greatly, which involves many breaking changes. Also, null-safety has been introduced. Creating a new project after updating Flutter will also fix those Gradle issues because the configuration files will be reset.
If it's less than that, try to fix those Gradle issues either by hand or just deleting the '/android' or '/ios' etc. folders and letting Flutter/Dart automatically recreate them when you run the app next. You'll probably need to migrate to null-safety: read about null-safety so you understand it properly, then try using the dart migrate tool. You will likely need to spend some time changing dependencies for null-safe versions. Then you can try the flutter fix tool to automatically resolve SOME issues.
Hope you can get your app to work soon!

Unable to Resolve Build File: Reference to Missing Target with GUID

I recently forked an iOS library on GitHub to add support to it for the Swift Package Manager. Here's the repository: https://github.com/skelpo/mapbox-gl-native-ios
When I add it to a completely new iOS app and try to build it, I get this error:
Unable to resolve build file: XCBCore.BuildFile (The workspace has a reference to a missing target with GUID 'PACKAGE-TARGET:Mapbox')
I've found posts for similar errors, such as this one, but the reason for the build file failing to resolve is different.
I have tried the usual cleaning the build folder, deleting derived data, and restarting Xcode, but that hasn't helped.
What is the reason for this specific resolution failure, and how would I fix it?
I ran into a similar problem after upgrading to Xcode 12 recently, and found a fix for my case.
A major hint that led to the solution came from Aaron's May 3, 2019 answer on this page.
What fixed it for me was to select the root of the Xcode project, and change the Project Format from "Xcode 11.0-compatible" to "XCode 12.0-compatible".

Xamarin.Forms.DefaultItems.props Not Found

So, I have been trying to fix this error I am getting over a month now, but with no success. I am currently working on a personal app project in collaboration with one other friend and surprisingly the project compiles perfectly fine on my friend's machine.
I am getting the below error:
"The imported project "C:\Users\divye\Documents\NHSF Xamarin App\packages\Xamarin.Forms.2.5.0.280555\build\netstandard1.0\Xamarin.Forms.DefaultItems.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk".
I can't understand why my code will not compile. I have gone through lots and lots of Stack Overflow posts already and tried pretty much all the proposed solutions without any success. As a last resort I am having to post on here.
I have tried the following:
Deleted the project locally from my machine and re-cloned the git repository and then tried running the project
Cleaned the project out and tried rebuilding again
Have spoken with my friend who is also working on the project, and matched my local project set out to his
I have gone into the Xamarin.iOS and Xamarin.Android .csproject files and also manually added in the Import statement for 'Xamarin.Forms.DefaultItems.props'
I have manually checked the folder '$..\netstandard1.0\ folder path to make sure the 'Xamarin.Forms.DefaultItems.props' file physically exists in the folder and it does for both iOS and Android.
Updated all packages in Xamarin Studio for the project to make sure latest versions of the packages are being used
Downgraded the Xamarin.Forms package to see if it could be to do with a bug in the latest package but this does not seem to be the issue.
A suggested fix that worked for my friend was recreating the project to contain the ASP.NET backend for mobile packages. I have tried this as well.
I was initially getting the error on my Mac so I thought I would give it a go on my Windows machine. Same thing happens on there too.
I am stumped at the issue. It is failing to build at all. Neither iOS or Android work.
I am hoping someone from here can help.
Thanks,
Divyesh!
Remove the whitespaces in the pathname of the project!

SpeechToTextV1 - Missing required modules SSCZLib, SSCommonCrypto

I am working on XCode 9.1 project that uses IBM Watson swift-sdk SpeechToTextV1 package. After upgrading swift-sdk to the version 0.19.0 and building XCode project the compiler error has occured: Missing required modules: 'SSCZLib', 'SSCommonCrypto' pointing to the import SpeechToTextV1 statement. swift-sdk updated via Carthage.
Cartfile content: github "watson-developer-cloud/swift-sdk".
command line update: carthage update --platform ios --no-use-binaries.
How can I include SSCZLib and SSCommonCrypto modules into XCode project?
Please help. Thanks a lot.
Use carthage update --platform iOS --no-use-binaries. It takes a while, but it works.
I'm afraid that I haven't been able to replicate the problem on my machine. I started with a new, empty Xcode project and was able to transcribe audio with the Speech to Text service.
I uploaded my app here. Can you try downloading it, adding your Speech to Text credentials, and running the app?
Please make sure that the newly compiled frameworks are the ones being used. Carthage does not place the frameworks in a custom location that is referenced in the project or workspace.
For me - in addition to building the library using --no-use-binaries flag - I also had to ensure that under my target's
Build Phases->Embed Frameworks
Build Phases->Link Binary with Libraries
SpeechToTextV1.framework is included
In addition - I found that these two files made all the difference inside the Carthage folder:
Carthage/Checkouts/ios-sdk/Source/SupportingFiles/Dependencies/Starscream/zlib/include.h
Carthage/Checkouts/ios-sdk/Source/SupportingFiles/Dependencies/Starscream/zlib/module.modulemap
I could only get this to work after my project was directly referencing the Carthage folder. Deleting either of these two files caused the error to return.
The v0.21.0 release of the Watson Swift SDK fixes this issue. You should no longer have to add a link to the zlib folder in your project settings. However, you will need to copy Starscream.framework into your application in the same way that other frameworks are copied.
The solution was to externalize the Starscream dependency. Adding Starscream as a recursive dependency for the Swift SDK allows it to build independently with its own environment. When the Starscream library is copied into your application, it should automatically include the SSCZLib and SSCommonCrypto dependencies.
We test each SDK before it's release, but this problem slipped past us. Our test machine happens to have other software that adds SSCZLib and SSCommonCrypto to the path, making it available to the Xcode build. It wasn't until we refreshed the machine with a new macOS install that we were able to replicate the problem. And with v0.21.0, that problem has been solved.
Sorry for your trouble and thank you for your patience while we tracked down the solution!

Resources