Error: Terminating app due to uncaught exception 'NSInternalInconsistencyException' - cocos2d-iphone

I am getting error on debugger:
cocos2d: CCTexture2D. Can't create Texture. UIImage is nil
cocos2d: Couldn't add image:bg.png in CCTextureCache
* Assertion failure in -[StartTrain addChild:z:tag:], /Users/nishant/Downloads/AnimBear 2/libs/cocos2d/CCNode.m:370
* Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Argument must be non-nil'
An Application runs on simulator but not on actual device.
please help.. :(

Is your device an iPhone 4? Someone on the cocos2d-iphone forums had a similar problem; this thread documents what he tried and what ended up solving the problem. It's possible that the hd version of the image you are trying to load is too large or is not in the correct format.
If you are running 0.99.5 rc1, you may also want to upgrade to the release version of 0.99.5, as mentioned in this thread about another similar problem.

I had a similar problem, the name of the file was correct, format was correct (was .png) and I had cleaned in xcode and deleted the app from my iphone, yet I still had the error.
As someone else said in the comment, the size of the sprite just might be too large (depending on your memory usage). For me I had all sorts of sprites and stuff flying over the screen. So I resized it and it currently runs perfect.
Also I was using a iPhone 3G.

Related

Xcode 11.1 SwiftUI Preview failing

I receive this error whenever I try to preview a freshly created swiftui view.
messageRepliedWithError("Connecting to launched interactive agent 9297", Optional(Error Domain=com.apple.dt.ultraviolet.service Code=17 "connectToPreviewHost: Failed to connect to 9297: Error Domain=com.apple.dt.ProcessAttachUtilities Code=3 "Target process 9297 exited prematurely, likely crashed" UserInfo={NSLocalizedDescription=Target process 9297 exited prematurely, likely crashed}" UserInfo={NSLocalizedDescription=connectToPreviewHost: Failed to connect to 9297: Error Domain=com.apple.dt.ProcessAttachUtilities Code=3 "Target process 9297 exited prematurely, likely crashed" UserInfo={NSLocalizedDescription=Target process 9297 exited prematurely, likely crashed}}))
I have no idea how to fix this so I can see previews again. I am on the latest Catalina 10.15.1
I found the Preview Canvas to be extremely buggy as well. Or maybe swiftUI code has a lot of undesired side effects.
In many occasions I found that Clean Build Folder, then kill Xcode, start Xcode, do a full Build may (sometimes) fix the problems. Until I make a tiny change somewhere... Then the whole circus starst again.
In practice this is very time consuming and basically unworkable. I found it more efficient to not use the preview canvas at all and just run the code. It is quicker, more reliable and in the end saves lots of time and frustration.
At the same time I think it is a bit of a shame on Apple. Most frustrating of all (for me at least) is that documentation is virtually non existing. It is all trial and error. Mostly error.
In short: my experience is that it is better not to use swiftUI Previews for anything beyond the very basic (yet).
I had the same problem with mine, I went through a couple of steps, so I will mention everything I did hopefully it helps someone.
But it's worth mentioning that I think the error was caused by Xcode trying to connect to the preview which failed all the time, because I was using an iPhone 8 preview.
Also I was able to use iPhone 8 preview after a while again. This looks like a buggy Xcode.
Steps.
1. Clean build folder and your derived data.
2. Close XCode Completely.
**Key Step. Open Xcode again and change your preview to iPhone XS or iPhone 11.
See the image below.
I had same issue. It was very confusing. I am using FirebaseFirestore pod in my podfile and when I remove FirebaseApp.configure() from AppDelegate didFinishLaunchingWithOptions function preview works.
I have done this 10 times just to make sure that this is an issue, and it was issue for me. So probably any code from Firbase added in that function was problem for me.
So, by checking logs I came across this error:
Crashed Thread: 3 Dispatch queue: com.google.GDTCORFlatFileStorage
Also googling I came across those bugs:
https://github.com/firebase/firebase-ios-sdk/issues/5707
https://github.com/firebase/firebase-ios-sdk/issues/5708
Turning off the thread sanitizer worked for me (I was just playing around with settings against another project that worked), so there's one more thing to try...

"Unable to open file libc++abi.dylib". Program builds, but crashes upon being run. Using xcode 10.1 (10B61)

newbie here. I am following along this SFML flappy bird tutorial. I am currently stuck at this portion of stage creation where a "Splash State" (or logo loading screen) is made. The code of which is exactly the same as what is shown here.
I am using xcode 10.1.
The project builds. But when I tried running it, it crashes and I am greeted with the following:
Failed to load image "Resouces/res/Splash Background.png". Reason: Unable to open file
libc++abi.dylib: terminating with uncaught exception of type std::out_of_range: map::at: key not found
(lldb)"
If I understand it correctly, it's saying it cannot perform the action of loading the image at the aforementioned path because it is not able to open "libc++abi.dylib". And now the program is being terminated. (please help me understand this problem better by either confirming or correcting me here).
When I tried looking for "libc++abi.dylib", it is missing. Instead, I can only find "libc++abi.td".
This thread says to add that under Link Binary With Libraries. That did not produce any result.
The tutorial shows that the code runs and a "Splash State" or logo screen is expected to appear. Instead my program crashes and I am greeted with the aforementioned error.
I was wondering if anyone else ran into similar issues?
It's solved. It is made by a typo on my end... sorry.
I'll try my best to explain it here for those of you who may have the same issues:
The game asset is governed by a map, which is a private member variable of a "AssetManager" class. The typo is at the file path. Because of this, the map never inserted the key since the file path isn't valid.
When the map is later accessed, it would be out of range since nothing ever got inserted (since the asset did not load).
Basically, the error of not being to open "libc++abi.dylib" is caused by the map being out of range.

Vulkan on X11: vkGetPhysicalDeviceSurfaceCapabilitiesKHR error

I am trying to get Vulkan running under X11.
I have (apparently) successfully created an instance, device and surface, and several calls relating to the surface also succeed, and even return reasonable values (for example vkGetPhysicalDeviceSurfaceFormatsKHR returns two formats). However, when I call vkGetPhysicalDeviceSurfaceCapabilitiesKHR, I get the following:
X Error of failed request: BadDrawable (invalid Pixmap or Window parameter)
Major opcode of failed request: 14 (X_GetGeometry)
Resource id in failed request: 0x5800009
Serial number of failed request: 42
Current serial number in output stream: 42
The X11 Window is 0x5800009, as referenced in the error. I am using Vulkan SDK 1.0.5, and Nvidia 364.12 drivers (if that is relevant).
On the hunch that Vulkan was querying something about the Window that had not yet been created, I put a XSync(<display>, false) call before this one, and that seems to have solved the issue.
I am not sure whether this is required for proper operation (I am not an X11 expert), or whether this is an issue with Vulkan itself. If somebody has a better explanation, I would love to hear it.
I had the same error on Linux with XCB and I resolved it (with the help of MuertoExcobito's answer) by calling xcb_flush after the window creation.
I came across that same error when I bound ::XDisplay to VkSwapchainCreateInfoKHR.dpy before a window handle was actually created. So long as I keep that structure updated during resize events (with both .dpy and .window), everything continues to work fine.

PIX DirectX 11 Debug Pixel Error

I recently updated my DirectX 11 (C++) application for dual-monitor, dual-window support. Ever since then, when I try to debug any pixel in the PIX debugger, I get the following error:
A call that previously succeeded failed during playback:
EID: 1375
Call: IDXGIFactory::CreateSwapChain()
HRESULT: DXGI_ERROR_INVALID_CALL
For more information click 'Help'.
I am no longer using D3D11CreateDeviceAndSwapChain, but instead using D3D11CreateDevice and then CreateSwapChain to create separate swap chains for each of two windows (one per monitor). I used the SDK sample MultiMon10 as a reference when making my changes, however I can still debug pixels without error when running the MultiMon10 sample project through PIX. So it can't just be a matter of "CreateSwapChain" not being PIX-friendly.
Any ideas what could be causing this error? Debugging pixels and stepping through shaders has helped me out a lot in the past and I'd hate to lose that capability.
Seems like I am hitting the same problem. It also happens with Visual Studio 2012 Graphics Debug. Must be something with CreateSwapChain in DX Debug mode.
I've been using Intel's GPA tool instead to workaround this issue. I find it very useful. It can be used to debug on the same machine or through a client/server model.

Invalid lock sequence error in an OpenSceneGraph application

I have an application that is built against OpenSceneGraph (2.6.1) and therefore indirectly OpenGL. The application initializes and begins to run, but then I get the following exception "attempt was made to execute an invalid lock sequence" in OpenGL32.dll. When I re-run it, I sometimes get this exception, and sometimes an exception about a "privileged instruction". The call stack looks like it is corrupted, so I can't really tell exactly where the exception is being thrown from. I ran the app quite a bit a couple of days ago and never saw this behavior. Since then I have added an else clause to a couple of ifs, and that is all. My app is a console application, is built with Visual Studio 2008, and it sets OpenScenGraph to SingleThreaded mode. Anybody seen this before? Any debugging tips?
Can you reproduce it with one of the standard examples?
Can you create a minimal app that causes this?
Do you have a machine with a different brand video card you can test it on (eg Nvidia vs. ATI) there are some issues with openscenegraph and bad OpenGL drivers.
Have you tried posting to osg-users#lists.openscenegraph.org
The problem turned out to be our app was picking up an incorrect version of the OpenGL DLL , instead of the one installed in System32.