I developed an iOS game in Unity editor which is also playable in Unity editor and I did Build&Run the game in iOS (Xcode). The build is succeed but the game does not work properly. That is why I decided to debug my function and then I got the following errors in Xcode (NOT IN UNITY):
NullReferenceException: A null value
was found where an object instance was
required. at
BallScript.MobileControl () [0x00000]
in :0
(Filename:
currently not available on il2cpp
Line: -1)
What is the reason to cause those errors and what can I do against them?
This means the code in the MobileControl method in the BallScript class is trying to use a null value somewhere. I'd recommend debugging the code to better understand what is happening. You need to be using Unity 2018.2 or later to debug C# code on iOS. You can see directions about how to do that here: https://docs.unity3d.com/Manual/ManagedCodeDebugging.html
Note that the (Filename: currently not available on il2cpp Line: -1) is benign. It is unrelated to the specific error in this case, and you can ignore it.
Related
I created a simple UWP app from the VS 2017 blank UWP template. No added XAML or C# code-behind:
Create new app with Blank Universal Windows template
Set Debugger type to Mixed (Managed and Native)
Build and Run (No XAML or code added)
Following error: WinRT originate error - 0x80070490 : 'Element not found.'
This happens every time. Does anyone have a handle on this error? If I don't have Mixed Mode debugging on, I don't see the error but I'm assuming it's still there. Is this an error that I should be concerned about?
Thank you.
A lot of problem may result this error, and it should not be a fatal error in your case. Most likely you changed the default Exception Settings in visual studio.
Just like all other apps, Windows use exceptions and catch them at different level.
For end user, you should not see this exception and app should not crash.
In your situation, I think you click continue and the program should not crash, and it should not be a big concern.
I suggest you:
1, start and debug your app, open Debug|Windows|Exception Setting, then click the 'restore the list to default settings' button
2, restart your app.
3, You should not catch the exception, but you still see error message in Output window.
If you still see a exception window popup, you need to post more information like your os version, and then someone can help you
I met this error when I call the winRT api CommunityToolkit.WinUI.Notifications.ToastNotificationHistoryCompat.Clear(). Then let the app toast someting once the error had gone.
I'm working on a Direct2D (XAML) application (I picked this because I haven't done it before and I wanted to try it out, I thought it would be simple).
I created the project in Visual Studio 2012 using the default options.
I added a button to the GUI successfully.
I added a button press handler to the GUI successfully.
The problem is that I need the button press handler to send a registered windows message. I #include <Windows.h> as instructed by the MSDN docs for ::RegisterWindowMessage(), and finding the declaration and definition of the function with the F12 key works fine.
However, building the project fails, because the compiler can't find the function. Intellisense also flags the function as unrecognized.
I'm probably missing something in the project configuration, but I don't even know where to begin.
Can you please help me?
Edit: The exact error messages that I'm getting are:
error C2039: 'RegisterWindowMessage' : is not a member of '`global namespace''
error C3861: 'RegisterWindowMessage': identifier not found
RegisterWindowMessage is not available in a UWP application (which is likely what you are targeting in a XAML application). If you look into WinUser.h, you'll find the declarations are wrapped inside a
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
guard. This API is available to desktop applications only. There is nothing you can do to make it work in a UWP application.
I have taken over a Xamarin.Forms (C#) application from an external source for fixing.
Problem is, that the application does sometimes fail with a runtime error:
System.NullReferenceException: Object reference not set to an instance of an object
The message appears in the output console and in a separate message window in Visual Studio. Unfortunately neither gives any more information about the failed object, a source code line number or a classname, there is just the bare message. Furthermore the "Call Stack" window in Visual Studio is always empty --> I have no easy way to find out where the failure occurs in foreign source code, because virtually no documentation of the program flow exists.
Full source code is available, and I have re-built the application with "Debug" configuration.
Right now the only option I can think of is to scatter breakpoints and Debug.Writelines all over the source code to get an idea where the problem occurs.
Is this really my only option, or did I miss some setting somewhere, so I can retrieve more info, so I can somehow go straight to the code where the failure occurs?
Thx!
iOS 10 / Xcode 8 GM build getting the below, never had it before on Xcode 7. Any ideas?
objc[25161]: Class PLBuildVersion is implemented in both
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices
(0x12049a910) and
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibraryServices.framework/PhotoLibraryServices
(0x1202c4210). One of the two will be used. Which one is undefined.
(NOTE: Only seems to happen in simulator, does not appear on real device).
Main Idea
Main idea is simple:
If your app (or dependencies, such as Pods) uses framework, that uses explicit (or implicit) PhotoLibraryServices.framework or AssetsLibraryServices.framework as dependency, Xcode warns you (even if you are using only one of them). It might be Photos/PhotosUI.framework or AssetsLibrary.framework, or another (I don't have full list of dependencies, but it is possible).
What is the problem?
Class with name PLBuildVersion is defined in both PhotoLibraryServices.framework and AssetsLibraryServices.framework. Class name is unique in Objective-C (you can't define 2 classes with same name), so it is undefined which one will be used in runtime.
However, I think that it will not be a problem, because both classes have same methods and fields (checked this with disassembler) and I guess that both were compiled from the same source.
Radar is already sent.
As per answer from Apple employee on Apple's Developer Forum:
You don't control either of the class sources listed, so there isn't anything you can or should do – aside from Reporting a Bug.
I was unable to find a way to get rid of the warning, but if you want to prevent the app from crashing, you need to provide a description for why you are accessing the camera, photo library, etc. This is new in iOS10.
Input the following into your Info.plist file.
Photo
Key: Privacy - Photo Library Usage Description
Value: $(PRODUCT_NAME) photo use
Camera
Key: Privacy - Camera Usage Description
Value: $(PRODUCT_NAME) camera use
More info can be found here: https://iosdevcenters.blogspot.com/2016/09/infoplist-privacy-settings-in-ios-10.html
I find you can get this error merely by using a UIWebView. My solution was to replace my use of UIWebView with WKWebView.
I had this after adding Answers on Fabric to my project.
Deleting derived data did the trick for me. (shift alt command k in XCode)
Edit a year later:
After deleting derived data, always exit XCode and start it again.
In unrelated cases I have the impression that deleting derived data does not clear XCode’s in memory caches of the derived data.
Resetting the iOS simulator fixed this for me. Simulator -> Reset Content And Settings.
In my case this warning started to appear after opening a second xcode project and running the second app on the simulator. After changing back to the first app, the warning started to appear. I just quit the Simulator and Xcode and reopened my project. The warning disappeared after that. If that doesn't solve it, proceed with the other answers. Xcode can be really picky sometimes.
I'm currently developing a Cordova application with jQuery Mobile by using sublime text 3 and using Ripple to emulate my devices (I'll reference this project as SublimeProject).
I can build apps for IOS, Android and Win8. But now I need to build it for Windows 10. Apparently this doesn't work with my setup.
A colleague of mine told me to import the project in Visual Studio (I'll reference this as VSProject), add the plugins in the config.xml, copy over the files to the www folder and run it. Problem here is that it just doesn't work.
When I try to run it on Android with the Ripple - Nexus (Galaxy) emulator, it'll give me a warning like this:
I Haz CHeeseburger?!?!
PushPlugin.register
We seem to be missing some stuff :(
What is kinda cool though you can fill in the textarea to pass a json object to the callback you want to execute
Success! Fail!
But when I press Fail! the program will just work, somehow.
My console shows me the following for ripple.js:
ripple.js:37 Ripple :: Environment Warming Up (Tea. Earl Grey. Hot.)
ripple.js:51 Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
ripple.js:51 GET http://localhost:4400/config.xml 404 (Not Found)(anonymous function) # ripple.js:51module.exports.initialize # ripple.js:51_baton.pass # ripple.js:13xhr.onreadystatechange # ripple.js:39
ripple.js:37 cordova :: Initialization Finished (Make it so.)
ripple.js:37 cordova :: Native back button handler was detached.
ripple.js:41 missing exec:PushPlugin.register
ripple.js:48 PushPlugin
ripple.js:48 register
Makes sense that something is wrong with pushplugin, but can't figure out what.
Additional, when I try to run the application on Windows-AnyCPU (which my actual intent is), the application will just show me the default cordova splash screen and hang there:
So that's where I'm at. I need to figure out a way to get the app to run on Windows 10. Prefered to use Visual Studio because I know it has an option to build me an .xap file.
Updates:
Update 1
I'm tracing where the PushPlugin error comes from.
try {
pushNotification = window.plugins.pushNotification;
}
pushNotification seems to be undefined, yet in my config.xml I have the following line:
<gap:plugin name="com.phonegap.plugins.pushplugin" version="2.4.0" />
Update 2
The pushplugin doesn't seem to be relevant, because when debugging in Visual Studio, I'll find the pushNotification to be not undefined.
Currently there is nothing pointing to a good reason why I only see the splash screen instead of my application.
I had the same problem and it turned out it was due to duplicate url in the $stateProvider.