We are doing some work around sharing UI across apps, both entire views and also individual controls, so the structure we end up with is (on Android):
Android App
View (Activity + Layout) pulled in from a NuGet package
Control (Layout) pulled in from another NuGet package
So the app pulls in the view and the view pulls in the control.
The problem we’ve seen is that resource IDs defined in the control’s layout don’t end up in the Resource.designer.cs of the app such that when the app runs we see a crash when FindViewByID is called.
Interestingly we have implemented the above in three different apps, it works in two and not the other, so I’m left thinking it is ever a difference in the build config somewhere or its pure chance and we can’t rely on this pattern working.
Has anyone seen this before?
Update:
Having paid closer attention to the build output I can actually see warnings being generated for the missing controls:
Warning XA0106: Skipping MyControl.Resource.Id.myId. Please check that
your Nuget Package versions are compatible. (XA0106)
Old question I know, but in case anyone needs it:
I experienced very similar problems after updating to Xamarin.Forms v4.1.0.581479, and followed James Esh's comment above, and JimmyGarrido's response here to get a resolution: https://forums.xamarin.com/discussion/89661/a-lot-of-warnings-appear-in-a-new-empty-xamarin-forms-xaml-project
The simple answer in my case was to remove the PCLAppConfig Nuget package. There may be other packages in your project which were built using an old version of the Xamarin.Android.Support* packages. Unfortunately I haven't found a way of diagnosing which package specifically causes the problem, so updating, then removing and retesting one-by-one led me to the solution.
Related
I really don't know if this is specific to the package or to xcframework or to the setup. In my case I just:
open VS 2022
create a Xamarin iOS empty project
add the Google Mobile Ads 8.13.0.1 Nuget package through the VS NuGet package manager ( this is the package https://www.nuget.org/packages/Xamarin.Google.iOS.MobileAds/)
build
get this error:
C:\Users\Admin\AppData\Local\XamarinBuildDownloadCache\GAppM-8.9.1\GoogleAppMeasurement-8.9.1\Frameworks\GoogleAppMeasurement.xcframework has an incorrect or unknown format and cannot be processed.
I've been using google ads in iOS projects for 10 years, updates tend to screw everything up, but it's usually fixable, this time I'm completely stuck.
I tried filing a bug report (https://developercommunity.visualstudio.com/t/GoogleAppMeasurementxcframework-has-an/10153891?entry=problem) and an issue on github (https://github.com/xamarin/GoogleApisForiOSComponents/issues/573) , but experience tells me it's useless...
[EDIT]
The project is here:
http://www.andreasabbatini.org/Files/AdmobTest.zip
Answering my own question:
I “think” I have found a solution, if not the cause. I cannot replicate it relably, but sometimes it happens sometimes not.
(in a brand new PC or VS install)
1-Create a project similar to that one. Add the Google Ads NuGet package. Build. The build works
2-Create another project (or use that one, it’s the same). Add the same Google Ads NuGet package, then the Xamarin.Facebook.AudienceNetwork.iOS 6.9.0.1 https://github.com/xamarin/FacebookComponents/tree/main/Facebook.iOS/source/AudienceNetwork
build this or the other project, for some strange reason, the above error starts to appear
3-remove the above facebook package, the error is still there. I’ve tried many things here, readding packages, etc none work
4-remove the packages, delete manually C:\Users\Admin\AppData\Local\XamarinBuildDownloadCache and readd the packages one at a time. Most of the time it works, but sometimes I have to repeat this step.
Until three weeks ago, my application could upload it to the App Store without any problem. However, Apple has refused to upload the app with a new message about Non-public API usage.
The application is developed with Xamarin in Visual Studio for Mac and has updated all the libraries and packages. Can anybody help me? Because I can not find what the problem is, nor do I see any solution. It will be something new?
Thank you all.
Non-public API usage:
The app references non-public selectors in AppAytoSS.iOS:
addTemporaryAttribute:value:forCharacterRange:,
addTemporaryAttributes:forCharacterRange:, behaviorWithType:,
defaultBaselineOffsetForFont:, defaultLineHeightForFont:, finished,
greekingThreshold, horizontalCornerRadius,
initWithSource:convolutionState:weights:, initWithType:,
postSession:didAddPlayer:, postSession:didReceiveData:fromPlayer:,
postSession:didReceiveMessage:withData:fromPlayer:,
postSession:didRemovePlayer:,
postSession:player:didChangeConnectionState:,
postSession:player:didSaveData:, preferredMetalContext, removeData:,
removeTemporaryAttribute:forCharacterRange:, setGreekingThreshold:,
setHorizontalCornerRadius:, setIsPrimary:, setShouldAntiAlias:, setUUID:,
setVerticalCornerRadius:, shouldAntiAlias,
temporaryAttribute:atCharacterIndex:effectiveRange:,
temporaryAttribute:atCharacterIndex:longestEffectiveRange:inRange:,
temporaryAttributesAtCharacterIndex:effectiveRange:,
temporaryAttributesAtCharacterIndex:longestEffectiveRange:inRange:,
textContainerChangedTextView:, toolTip, usesBackgroundSession,
verticalCornerRadius
We had the (exactly) same problem with an Xamarin iOS Project and where able to fix it via Setting Build/iOS Build/Linker Behaviour: Link Framework SDKs only (before Don't link) - what Jack Hua link shows as solution.
We where not able, to figure out the problem behind though. Two different MacBooks where used, one with the most recent version of XCode, Visual Studio and Xamarin Libs, the other with slightly older versions. The latter was able to create an IPA without the above described error, the updated machine was not.
However the used NugGet Packages where the same, so I think this issue is not related to them.
After filling an internal issue with the Xamarin team, they advised doing the following
adding --linksdkonly to the Additional mtouch arguments on the iOS Build settings page
As it seems that Visual Studio ignores the settings in GUI
I have tested it and now get my build accepted by Apple without the above error
This is the issue filed on Xamarin
https://github.com/xamarin/xamarin-macios/issues/5913
I find a thread where people meet the same problem with you recently:build-status-has-changed-to-invalid-binary.
So, I guess some third part nuget packages you are using has updated and using these non-public selectors that Apple not allow.
I would suggest you to get you code three weeks ago and don't update any third part nuget packages. Then submit again to check if it is the problem.
You can also compare your reference with the references people listed in that thread and find something similar. And any nuget packages related to Player(As I can see some player selector in the non-public selectors list)?
I built an electron app that allowed dragging files in, with a jQuery script that just takes some info from that (path) and adds an li to a list. That's it. It worked great.
Then I followed this guide, because the next step is to send that information to a python script that analyzes the files (maybe relevant: when installing zeroRPC I built from sources, didn't rely on the prebuilt fork that's available there).
Now I get this crazy bug where when I drag files into the app my mouse pointer changes to not-allowed and the drop event doesn't fire. It's so weird.
I don't have any code sample to give because I can't really tell which part is wrong. The only changes I've done are the ones in the guide I linked, and they have nothing to do with the front-end. I'm really confused by this. not-allowed? Why?
Well, as suspected, the issue had nothing to do with either the front end or the back end. None of my code, really. It turned out that since I needed to compile some stuff while preparing zeroRPC, I used powershell as an administrator,, and you can't drag files from user-run explorer into an admin-run electron app - which makes sense and is in fact an expected behavior (it just so happened that I encountered this after doing some work, causing me to think the problem was with something I changed in my code).
I have a Delphi project called VR that produces an executable named VR.exe. To my dismay I discovered Windows (I am running Window 7 64 bit Ultimate) has added links to the start menu and under games: Search & Rescue: Vietnam MED+EVAC. The icons for the links are the default delphi app icon.
Did a bit of research and I found this post:
http://social.technet.microsoft.com/Forums/windows/en-US/a5919fc1-db3d-4f13-b241-d059df2bf11f/renaming-a-file-into-vrexe
How can I prevent windows from doing this?
Update: I have another project MM, which produces mm.exe. This one created a link to the Steam Dark Messiah Might and Magic Single Player.
Another update: We submitted a support request to Microsoft. They acknowledged it is a bug, however, they failed to provide a timeline for a fix.
Update: This is the answer from Microsoft:
I am writing to inform you that this issue is reproducible at our end and we have been reported regarding this in past as well. Since this is already identified as “By design” with our code and to this point we do not have a resolution on this, there’s not much I would be able to help with.
However, if you have any points that you would like to bring to our knowledge like how it is impacting business or any other concerns , do let me know.
I accepted Remy's answer.
According to MSDN, game apps are supposed to integrate themselves into Game Explorer, Windows should not be integrating anything automatically. But I can confirm on a Win7 Home system that renaming any app to vr.exe and then running it causes Search & Rescue: Vietnam MED+EVAC to appear in Games Explorer (there was also a very noticeable delay when the app is run for the first time, which I imagine is due to the recognition/integraton taking place).
After running the app, I found the following Registry key associated with that game:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\GameUX\S-1-5-21-991038988-4040401710-2535580036-1000\{2A051900-E642-4D69-8D4E-1B3A2FD42CCF}
It contains a reference to this file
C:\Windows\system32\GameUXLegacyGDFs.dll
I looked at the file contents with a resource viewer, and see it is full of RC_DATA resources containing GDF game definitions.
I deleted the Registry key, and now the game no longer appears in Games Explorer, no matter how many times I run the renamed vr.exe file.
Recently I've noticed a couple of projects on github that extend the functionality of Xcode 4 via plugins.
Two projects as examples by #olemoritz:
MiniXcode changes the main toolbar.
ColorSense provides overlays to help pick colours.
Both projects are installed into ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins and Xcode just picks them up.
Are there any sources of documentation (officlal or user generated) on extending Xcode?
Edit: ping #olemortiz ;)
As I wrote those plugins you mentioned, here are some pointers:
There is no official documentation from Apple, so while Xcode does have a plugin infrastructure, it is entirely private API. (but hey, no one wants to submit Xcode plugins to the App Store, right? ;)) – The usual warnings apply: You should code very defensively, and it's possible that Xcode updates break things. Any plugin can bring Xcode down entirely, so be careful.
There is a seemingly abandoned effort to document the plugin interface here.
There are some open source projects that allow you to see what's needed to get a plugin loaded at all, e.g. mine and there's CLITool-Infoplist (I think that's where I got the basic structure from, but I can't really remember, because I've been doing this without publishing anything for quite a while).
You can use class-dump to generate headers from Xcode's private frameworks, e.g. IDEKit and IDEFoundation (in Xcode.app/Contents/Frameworks). Reading those gives you quite a bit of information on how Xcode is structured internally. DVTKit and DVTFoundation (in Xcode.app/Contents/SharedFrameworks) can also be useful to class-dump.
You can observe all notifications that are sent in Xcode by registering an observer for nil. I initially just logged all those notifications to get an idea of where I might be able to hook into.
Good luck!
There is no formal API or documentation.
Having said that nearly all community plugins are open sourced, use http://alcatraz.io to discover new plugins, then follow their github source code to learn how people are implementing them.
Here are some useful resources:
Use https://github.com/edwardaux/XcodeExplorer to discover the API hook point you need to be poking around.
Look at http://www.blackdogfoundry.com/blog/creating-an-xcode4-plugin/ for a series of posts about building Xcode plugins.
Check https://github.com/kattrali/Xcode-Plugin-Template for a Xcode 6+ template for creating new plugins.
Look at https://github.com/zats/AdjustFontSize-Xcode-Plugin as a good Xcode 7.1+ starting point
See http://www.blackdogfoundry.com/blog/debugging-your-xcode-plugin/ for debugging aid