NullReferenceException Json.NET Xamarin.Android android 4.3 - mono

I believe I have just run into this bug https://bugzilla.xamarin.com/show_bug.cgi?id=4902 on my Nexus 4 now that I have updated to android 4.3.
Basically, when JSON.NET tries to get the timezone via the mono runtime, we get a null reference exception because there are issues with an environment variable in certain android builds.
The same code worked fine before I updated and still works fine on other android devices. Are there any workarounds available for this? Is there anything else I can do or am I stuck? Has anyone else run into it recently?
Is there a fix planned in the near future?

Xamarin 4.8.2 (alpha) fixes this problem. (As of Sep 3, 2013)

Related

Kotlin MPP pod integration fails

I just released a first version of my Kotlin MPP as a library 3 days ago. It was integrated on Android and iOS successfully.
After the first released I switched to a coworkers branch and invalidated my caches. Since then I am not able to sync gradle anymore.
I'm getting this error:
Task :cinteropSnowplowTrackerIosArm64
Exception in thread "main" java.lang.Error: /var/folders/gv/rc4dmzjs3wj9kt4kr00nwhdw0000gn/T/13496315139908854548.m:1:9: fatal error: could not build module 'SnowplowTracker'
at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:152)
at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesASTFiles(ModuleSupport.kt:68)
at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesInfo(ModuleSupport.kt:14)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.buildNativeLibrary(main.kt:515)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:266)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.interop(main.kt:76)
at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(InteropCompiler.kt:45)
at org.jetbrains.kotlin.cli.utilities.MainKt.mainImpl(main.kt:38)
at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:60)
Even after going back to my very first POC commits, which was successfully published several times I am not able to build anymore.
Here is how I integrated the iOS dependency.
I don't have any idea what the issue is. I tried setting a whole bunch of different JDK versions (8, 11, 14, 15, 16, 17) without success. I tried upgrading Kotlin version from 1.4.20 to 1.5.x. I tried downgrading IntelliJ IDEA and many more things all without success. The only guess I have right now is that it is related to some plugin updated. How could I verify that?
Here is how the pod is integrated:
cocoapods {
ios.deploymentTarget = "12"
summary = "Kaia tracking library"
homepage = "https://github.com/KaiaHealth/kaia-tracking-library"
authors = company
pod("SnowplowTracker") {
version = "~> 1.2.0"
}
}
With credits to xoif as he answered this on youtrack. The problem seems to be xcode command line tools 13 and the solution is to downgrade:
Download Xcode 12.5
Select Xcode 12.5.1 as default Command Line Tool (in Xcode -> Preferences -> Locations)
cinterop should work again.
I think it has something to do with recent Xcode/toolchain update. I've got the same problem with other cocoapod that was compiling fine last week. I've just removed the pod for now, but probably if there's a way to downgrade xcode toolchain - it might help.
Im glad the xcode downgrade helped some of you. Some of the issues regarding Xcode 13 and Clang/cinterop will be supposedly fixed with Kotlin 1.6.0. However, the current preview (1.6.0-M1) still fails for me because of other issues. If I find a way to make my configuration run with kotlin 1.6.0 and Xcode 13, I'll let you know in this thread.

XCode autocomplete not working for a particular project in Objective C

I am currently on XCode Beta Version 9.3 beta 2 (9Q107o. I am facing some issues with a particular project. Autocomplete seems to have broken for the project. Its working fine for other projects.
Can anyone please help. Can't seem to figure out.
Thanks
Autocomplete working in Xcode is by no means guaranteed and definitely not for a beta. Try quitting everything, deleting your derived data, restarting your computer and if that doesn't work, go back to a supported version.
You can do as #Alper say, If it doesn't work. try restore Xcode to the default Settings ,than restarting your Xcode
This is the officially recommended way to delta Xcode preferences, type in Terminal.app:
defaults delete com.apple.dt.Xcode
That should restore Xcode to the state of its first launch.
(for older versions of Xcode the command was defaults delete com.apple.Xcode, i.e. without the dt in the middle).

XCode 6.1crash on run project

I upgraded XCode to versin 6.1 (6A1052d) and now my project crash when i try to run it on simulator.
Doesn't happen all times. The pattern seams to be after i made code changes.
No exception is throw, the XCode just restart as nothing happened.
It's running on Yosemite 10.10.
I already try:
change the computer language to english U.S and region to U.S, which was recommended to fix a similar problem in a early version.
recreated the project. Project has both Swift and objective-c, shouldn't matter but anyway...
find info on xcode logs. No logs are generated at library\logs when this happens. Any place where i can find xcode logs?
This is odd, i don't believe that xCode release its so buggy that don't run properly, so must be something less usual in settings or in project that testers missed, but have no clue of what.
fwiw, I found that this issue doesn't happen if I use the cmd-R hotkey instead of clicking the Play button.
I can also verify that this isn't a crash. It's as if the Close Workspace command is being invoked at the wrong time. Definitely a defect though.
I'm on Yosemite 10.10.1 running the latest Xcode 6.1.1. The project was upgraded from Xcode 5.1.1 where it continues to work fine. Not using Swift. US English. Pretty standard install.

Build failed. Could not find type 'System.Globalization.SortVersion'

Somewhere along the line in the last week, Xamarin on my Windows machine started giving the above mentioned error any time I compile with MONO.
Specifically occurs when Project|Active Runtime is MONO - never happens when runtime is Microsoft.NET.
I've tried uninstalling/reinstalling MONO runtime (mono-3.2.3-gtksharp-2.12.11-win32-0.exe)
Any clues? Google searches come up with pretty much nothing
I get the same error today, (after an update yesterday to 4.2.4 Build 35) There is a bugfix here
Build works fine on another PC without the latest update (4.2.3 build 59). I guess the answer is to roll back to 4.2.3.
You can get it from your account page at Xamarin.com >> Downloads >> View all versions.
The solution from here says that you should either uncheck the box "Use MsBuild" in project settings or use .NET for building but then run with Mono if you want to test runtime compatibility.

Strange application behavior when building a project with the latest xcode/OSX version

I have an OSX application written in Objective-C/Cocoa using xcode. The application is quite finished, tested and sold on the App Store.
I haven't worked on this application for some time and recently, I rebuilt it using xcode 4.3.3 on my OSX 10.7.4 and I noticed that while it builds just fine, there are some very strange visual glitches when running the application that were never seen before and occasionally, I get EXC_BAD_ACCESS when closing the application. All these seem to be related to the PDFKit framework I am using. I am unable to debug these problems since the glitches are just visual (nothing I can check in code) and EXC_BAD_ACCESS exception comes from internally allocated objects not related to my code.
The code itself haven't changed, I tried previous revisions of the code and they all exhibit the same strange behavior now. I tried running an old binary I have of the application (compiled couple of months ago) and it works just fine. Then I tried building it with previous versions of xcode, down to 4.2.1 (which I know was ok when I submitted the app to the app store) and the problems still occur.
Then I suspected this may be something specific to my environment so I built the project on different machine also with xcode 4.3.2 and OSX 10.7.4. Same results, the problems are still there.
So now I suspect that it has something to do with the OSX 10.7.4 update since this is the last thing that was changed between now and when I was able to produce a good build of the application. I am pretty puzzled to what to do next and how to identify the cause of this problem. I have an old binary that is working fine and I have a newly compiled binary of the same code revision that has problems.
Is there any useful information I can get from the difference of these binaries? What can I do to determine the cause of these problems? What can I try next?
Thanks!
NOTE (update): I stated it above but I want to make sure it is clear. This is a Mac OSX Cocoa application, not iOS.
just reset your simulator then try.
I hope you check the ARC information
go to your project Target set build settings --> Search Paths-->Always Search User Paths Set Yes.
And check your all class variables different from one another.
Xcode--> preferences-->Documentation check installed core Libraries (or) install it
like that
Xcode--> preferences-->Components check required component installed or not
check these things in your project.
Are you sure your customers are not having the same problem? Since you have tested the application on a different machine you probably do not have corrupt libraries installed (unless you did not install from scratch but used some migration tool?), so that is probably not the problem.
Most logical explanation to me would be that your customers also have this problem but they haven't reported it yet. In that case, you probably have a memory problem and there are techniques to attack that.
In any case, eliminate all the parameters that you can eliminate to simplify the problem. Deconstruct the application until the problem does not occur anymore or reconstruct the application in a different project until the problem occurs again.
It sounds like a nasty one, but you'll get there in the end, with patience and perseverance :)
First of all, you need check and verify the build log for suspicious compiler warnings.
For EXC_BAD_ACCESS, XCode analysis will give useful information.
You could try 10.6 or 10.5 (need manual installation) SDK. Or restrict the deployment target to 10.5 or 10.6.
I will answer my own question (since none of the above answers really answer it) so anyone with a similar problem might have a hint. I was not able to understand why exactly this happens but I'm pretty sure this is not a problem with my code but rather some glitch on Apple's side. And there is a workaround.
First, I compiled Apple's sample "PDF Annotation Editor" project on my Lion 10.7.4 and while the functionality is obviously different from my project, it also exhibited similar glitches with the PDFView display that my project does when compiled with 10.7.4
Then I proceeded to building a fresh clean system on new hard disk. Intalled Snow Leopard and upgraded to 10.6.8 and ONLY installed xcode. Compiled my project (the source code always stays exactly the same) and everything works fine. No problems seen in the compiled project.
Updated my OSX to Lion 10.7.4 and xcode 4.3.3, same source code. The problem is there after I compile it. I am pretty sure that if I tried 10.7.3 first, I would not see the problem as I remember it only starts with 10.7.4 but Apple doesn't provide any reasonable way to update to 10.7.3 first or downgrade to it after 10.7.4 is installed (shame on them, not very developer friendly!).
So, the problem appears in 10.7.4.
Then I installed the pre-release version of 10.7.5. This was the only thing that was changed, same source, same xcode. To my surprise, the compiled code works flawlessly now and the problems seen with 10.7.4 are now gone!
So my workaround - wait for 10.7.5 release before working on the project further. Hopefully Apple won't screw it in the future with Mountain Lion. I don't think I am going to try and debug it further or submit a ticket to Apple, going to be a tough case to explain.
Thanks for the responses.