GithubHelp home page GithubHelp logo

bugsnag / bugsnag-unity Goto Github PK

View Code? Open in Web Editor NEW
88.0 36.0 31.0 211.2 MB

Automatic error reporting for Unity games

Home Page: https://docs.bugsnag.com/platforms/unity

License: MIT License

Ruby 4.82% C# 77.43% Java 0.38% Objective-C++ 0.25% C 0.10% CMake 0.08% PowerShell 0.95% Shell 2.75% Gherkin 8.78% Makefile 0.04% C++ 0.14% Objective-C 4.26% Batchfile 0.01%
bugsnag unity unity-game exception-reporting error-monitoring error-reporting error-handling unity-ios unity-android crash

bugsnag-unity's Introduction

Bugsnag exception reporter for Unity

Documentation

The Bugsnag Notifier for Unity gives you instant notification of exceptions thrown from your Unity games on iOS and Android devices, as well as standalone Mac and WebGL deployments. Exceptions in your Unity code (JS, C# and Boo) as well as native crashes (Objective C, Java) are automatically detected and sent to Bugsnag.

Bugsnag captures errors in real-time from your web and mobile apps, helping you to understand and resolve them as fast as possible. Create a free account to start monitoring and reporting errors today.

Features

Getting started

  1. Create a Bugsnag account
  2. Complete the instructions in the integration guide to report unhandled exceptions thrown from your app
  3. Report handled exceptions using Bugsnag.Notify
  4. Customize your integration using the configuration options

Support

Contributing

All contributors are welcome! For information on how to build, test and release bugsnag-unity, see our contributing guide.

License

The Bugsnag Unity notifier is free software released under the MIT License. See LICENSE.txt for details.

bugsnag-unity's People

Contributors

avram avatar bengourley avatar cawllec avatar clr182 avatar codehex avatar conradirwin avatar fractalwrench avatar github-actions[bot] avatar gracecheung avatar imjoehaines avatar jessicard avatar joshedney avatar kattrali avatar kstenerud avatar lemnik avatar loopj avatar martin308 avatar nickdowell avatar pezzah avatar rich-bugsnag avatar richardelms avatar robert-smartbear avatar shinjiyoshida avatar sixeight avatar snmaynard avatar steve-nester-uk avatar tomlongridge avatar twometresteve avatar wrossmck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bugsnag-unity's Issues

TimingTracker does not persist for life of application

Description

The foreground status and duration values are not accurate if a new scene is loaded. The TimingTrackerBehaviour gets destroyed in this case and stops tracking foreground status.

Without the following tag specified on a Unity object, it will unload on scene change:
https://docs.unity3d.com/ScriptReference/Object.DontDestroyOnLoad.html

Issue

Unity game loads.
Bugsnag initializes, which spawns the TimingTrackerBehaviour.
Game loads a new scene.
TimingTrackerBehaviour is destroyed.
inForground and durationInForeground values are not accurate in reports

Environment

  • bugsnag-unity version: 4.6.4
  • Unity version: 2018.4.3f1
  • Operating system name and version: Android or iOS, any version
  • Target platform names and versions: Android, iOS
  • Initializing bugsnag via the Unity UI or in code? UI

Example code snippet

n/a

Could not configure release stage on android

Description

Android build could not configure release stage. It goes production even if set to Staging.

Issue

Use configured release stage.

Environment

  • macOS Mojave 10.14.2
  • Unity 2018.3.3f1
  • BugsnagUnity 4.1.1
  • Galaxy S8, Android 8.0.0

Reproduce

  1. Download unity package from https://github.com/bugsnag/bugsnag-unity/releases/tag/v4.1.1
  2. Create a new project with Unity 2018.3.3f1
  3. Import Bugsnag.unitypackage
  4. Switch platform to Android
  5. Add Button UI
  6. Define BugsnagTest script
  7. Add BugsnagTest to the button, and set up api key, release stage, and on click event
  8. Play the game, and click the button
  9. The bugsnag reports the exception at release stage Staging exactly
  10. Build android (Add Open Scenes, Set package name to ProductName.DefaultCompany)
  11. Install, start, and click the button
  12. Then bugsnag reports the exception at release stage production incrrectly

Example code snippet

using System;
using BugsnagUnity;
using UnityEngine;


namespace DefaultNamespace
{

    public class TestBugsnag : MonoBehaviour
    {

        public string ApiKey;

        public string ReleaseStage;

        private void Awake()
        {
            Bugsnag.Init(ApiKey);
            Bugsnag.Configuration.AutoNotify = true;
            Bugsnag.Configuration.AutoCaptureSessions = true;
            Bugsnag.Configuration.UniqueLogsTimePeriod = TimeSpan.FromSeconds(5);
            Bugsnag.Configuration.NotifyLevel = LogType.Exception;
            Bugsnag.Configuration.MaximumBreadcrumbs = 25;
            Bugsnag.Configuration.NotifyReleaseStages = new[]
            {
                "Development",
                "Staging",
                "Production",
            };

            Bugsnag.Configuration.ReleaseStage = ReleaseStage;
        }

        public void CreateException()
        {
            var a = 0;
            var b = 2;
            var c = b / a;
        }

    }

}

bugsnag-osx.bundle is not signed

We're getting an error when trying to use the library in a signed OSX build. Would it be possible for you to release a signed version of the native plugin?

Plugins: Couldn't open /Users/x/Desktop/1215842/Y.app/Contents/Plugins/bugsnag-osx.bundle/Contents/MacOS/bugsnag-osx, error: dlopen(/Users/x/Desktop/1215842/Y.app/Contents/Plugins/bugsnag-osx.bundle/Contents/MacOS/bugsnag-osx, 2): no suitable image found.  Did find:
	/Users/x/Desktop/1215842/Y.app/Contents/Plugins/bugsnag-osx.bundle/Contents/MacOS/bugsnag-osx: code signature in (/Users/x/Desktop/1215842/Y.app/Contents/Plugins/bugsnag-osx.bundle/Contents/MacOS/bugsnag-osx) not valid for use in process using Library Validation: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)

Bugsnag not reporting errors in asynchronous functions on iOS through Xcode

Description

I'm working on getting bugsnag properly working in a Unity project I'm working on.

Issue

Bugsnag does not report errors in asynchronous functions when running the App in Xcode after building to iOS.

Environment

  • bugsnag-unity version: 4.5.1
  • Unity version: 2019.1.2f1
  • Operating system name and version: Tested on iOS 11.3.1 and 12.3.1
  • Target platform names and versions: Testing on iPhone X
  • Initialized bugsnag in code

Example code snippet

private async void BreakMe()
    {
        await Task.CompletedTask; //To make function async without warnings

        throw new System.Exception();
    }

This method is inside the mainApp game object, and is called in the synchronous awake function.

As a note, bugsnag is working properly when running the project through Unity.

Support for new Xcode 10 build system when using app extensions

Description

The new Xcode 10 build system fails builds because of circular dependencies when a project contains extensions

Issue

We have a rich push notification extension added via UnityEditor.iOS.Xcode.Extensions.PBXProjectExtensions.AddAppExtension. Removing the extension, removing the BugsnagPostProcess logic that adds the "bugsnag dsym upload script", or reverting to the legacy build system resolves the issue

error: Cycle in dependencies between targets 'Unity-iPhone' and 'NotificationService'; building could produce unreliable results.
Cycle path: Unity-iPhone → NotificationService → Unity-iPhone
{redacted}
○ Target 'NotificationService': Strip /Users/me/Library/Developer/Xcode/DerivedData/Unity-iPhone-bczknawwvgfuzselychrkmftqfug/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/NotificationService.appex/NotificationService
○ That command depends on command in Target 'Unity-iPhone': script phase “Run Script”

Environment

  • bugsnag-unity version: 3.6.5
  • Unity version: 2018.2.8f1
  • Operating system name and version: macOS 10.13.6, Xcode 10.0 (10A255)
  • Target platform names and versions: iOS 12.0

3.0.0 bugsnag-unity plugin iOS compile error when using C++98

I got this message during xcode compile.

CompileC build/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/armv7/NSString+Demangle.o /Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/Assets/Plugins/iOS/NSString+Demangle.mm normal armv7 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler
    cd /Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/build/il2cpp/XxxxClient.ipa
    export LANG=en_US.US-ASCII
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/xxxx/work/android-sdk/platform-tools:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c++ -arch armv7 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -stdlib=libc++ -fobjc-arc -Wno-trigraphs -fpascal-strings -Os -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-implicit-atomic-properties -Wno-arc-repeated-use-of-weak -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-shorten-64-to-32 -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wdeprecated-implementations -Wno-c++11-extensions -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -Winvalid-offsetof -miphoneos-version-min=6.0 -g -fvisibility=hidden -fvisibility-inlines-hidden -Wno-sign-conversion -iquote /Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/build/il2cpp/XxxxClient.ipa/build/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/inhouse-generated-files.hmap -I/Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/build/il2cpp/XxxxClient.ipa/build/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/inhouse-own-target-headers.hmap -I/Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/build/il2cpp/XxxxClient.ipa/build/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/inhouse-all-target-headers.hmap -iquote /Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/build/il2cpp/XxxxClient.ipa/build/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/inhouse-project-headers.hmap -I/Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/build/ios/build/Unity-iPhone.build/include -I/Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/build/il2cpp/XxxxClient.ipa/Classes -I/Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/build/il2cpp/XxxxClient.ipa -I/Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/build/il2cpp/XxxxClient.ipa/Classes/Native -I/Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/build/il2cpp/XxxxClient.ipa/Libraries/bdwgc/include -I/Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/build/il2cpp/XxxxClient.ipa/Libraries/libil2cpp/include -I/Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/build/il2cpp/XxxxClient.ipa/../../../../Libs/ScaleForm/Src -I/Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/build/il2cpp/XxxxClient.ipa/../../../../Libs/ScaleForm/Integrations/Unity/Src -I/Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/build/il2cpp/XxxxClient.ipa/../../../../Libs/ScaleForm/Include -I/Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/build/il2cpp/XxxxClient.ipa/../../../../Libs/ProudNet/include -I/Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/build/il2cpp/XxxxClient.ipa/build/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/DerivedSources/armv7 -I/Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/build/il2cpp/XxxxClient.ipa/build/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/DerivedSources -F/Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/build/ios/build/Unity-iPhone.build -F/Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/Assets/Plugins/iOS -F/Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/Assets/Plugins/iOS/FacebookSDKStrings.bundle -F/Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/Assets/Plugins/iOS/Resources -F/Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/Assets/Plugins/iOS/Toy -F/Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/Assets/Plugins/iOS/FacebookSDKStrings.bundle/Resources -F/Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/Assets/Plugins/iOS/Resources/TapjoyResources.bundle -F/Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/build/il2cpp/XxxxClient.ipa/Frameworks/Plugins/iOS -mno-thumb -DINIT_SCRIPTING_BACKEND=1 -include /var/folders/rf/c5c8pbbx1572rxyy_f99mrg40000gn/C/com.apple.DeveloperTools/7.3.1-7D1014/Xcode/SharedPrecompiledHeaders/Prefix-agwqmmdhjojnoccuuhsuvhmgsxiw/Prefix.pch -MMD -MT dependencies -MF /Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/build/il2cpp/XxxxClient.ipa/build/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/armv7/NSString+Demangle.d --serialize-diagnostics /Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/build/il2cpp/XxxxClient.ipa/build/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/armv7/NSString+Demangle.dia -c /Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/Assets/Plugins/iOS/NSString+Demangle.mm -o /Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/build/il2cpp/XxxxClient.ipa/build/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/armv7/NSString+Demangle.o
In file included from /Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/Assets/Plugins/iOS/NSString+Demangle.mm:29:
/Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/Assets/Plugins/iOS/Demangle.h:154:17: error: union member 'TextPayload' has a non-trivial copy constructor
    std::string TextPayload;
                ^
In file included from /Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/Assets/Plugins/iOS/NSString+Demangle.mm:29:
In file included from /Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/Assets/Plugins/iOS/Demangle.h:17:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:1333:5: note: because type 'std::__1::basic_string<char>' has a user-provided copy constructor
    basic_string(const basic_string& __str);
    ^
In file included from /Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/Assets/Plugins/iOS/NSString+Demangle.mm:29:
/Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/Assets/Plugins/iOS/Demangle.h:167:11: error: use of undeclared identifier 'TextPayload'
    new (&TextPayload) std::string(std::move(t));
          ^
/Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/Assets/Plugins/iOS/Demangle.h:171:5: error: use of undeclared identifier 'IndexPayload'
    IndexPayload = index;
    ^
/Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/Assets/Plugins/iOS/Demangle.h:186:12: error: use of undeclared identifier 'TextPayload'
    return TextPayload;
           ^
/Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/Assets/Plugins/iOS/Demangle.h:192:12: error: use of undeclared identifier 'IndexPayload'
    return IndexPayload;
           ^
/Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/Assets/Plugins/iOS/Demangle.h:362:28: error: no matching constructor for initialization of 'swift::Demangle::Node'
    return NodePointer(new Node(K, std::move(Text)));
                           ^    ~~~~~~~~~~~~~~~~~~
/Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/Assets/Plugins/iOS/Demangle.h:165:3: note: candidate constructor not viable: no known conversion from 'std::__1::basic_string<char>' to 'std::string &&' (aka 'basic_string<char, char_traits<char>, allocator<char> > &&') for 2nd argument
  Node(Kind k, std::string &&t)
  ^
/Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/Assets/Plugins/iOS/Demangle.h:169:3: note: candidate constructor not viable: no known conversion from 'std::__1::basic_string<char>' to 'IndexType' (aka 'unsigned long long') for 2nd argument
  Node(Kind k, IndexType index)
  ^
/Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/Assets/Plugins/iOS/Demangle.h:162:3: note: candidate constructor not viable: requires single argument 'k', but 2 arguments were provided
  Node(Kind k)
  ^
/Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/Assets/Plugins/iOS/Demangle.h:173:3: note: candidate constructor not viable: requires 1 argument, but 2 were provided
  Node(const Node &) = delete;
  ^
/Users/Xxxx/UnityJenkinsNode/workspace/Xxxx/alpha/IOS/XxxxGITDev/NClient/Assets/Plugins/iOS/Demangle.h:405:35: error: rvalue reference to type 'basic_string<[3 * ...]>' cannot bind to lvalue of type 'basic_string<[3 * ...]>'
  std::string &&str() && { return std::move(Stream); }
                                  ^~~~~~~~~~~~~~~~~
7 errors generated.

** BUILD FAILED **

i share my xcode compile setting

DEBUG_INFORMATION_FORMAT = dwarf-with-dsym
GCC_ENABLE_CPP_EXCEPTIONS = YES
GCC_ENABLE_CPP_RTTI = YES
GCC_ENABLE_OBJC_EXCEPTIONS = YES
CLANG_CXX_LANGUAGE_STANDARD = compiler-default
CLANG_CXX_LIBRARY = libc++
CLANG_ENABLE_OBJC_ARC = YES

if problem casued by standard library or compiler setting, I cannot change my build setting.
this setting is forced by another 3rd-party library.

thanks.

[Windows] UnityEngine.SystemInfo.* should not be called from background threads

Description

Bugsnag-unity hooks into the log callback, looking for exceptions. When it handles an exception, it queries Unity for information about the current device. These calls are not allowed to be called at certain times: (1) when not on the main thread and (2) when Unity is calling constructors or field initializers.

Debug.LogException triggers this callback, and Debug.LogException is allowed to be called from anywhere, including other threads (as are all the Debug.Log* methods).

I would suggest that you move any Unity calls into initialization, rather than doing it every time you catch an exception, and look for other possible threading problems in the exception handler.

Issue

Here's a stack trace of such an event. (This is from an il2cpp release build, so there are no line numbers.)

UnityException: GetDeviceModel can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
at BugsnagUnity.NativeClient.PopulateDevice (BugsnagUnity.Payload.Device device) [0x00000] in <00000000000000000000000000000000>:0
at BugsnagUnity.Client.Notify (BugsnagUnity.Payload.Exception[] exceptions, BugsnagUnity.Payload.HandledState handledState, BugsnagUnity.Middleware callback, System.Nullable1[T] logType) [0x00000] in <00000000000000000000000000000000>:0 at BugsnagUnity.Client.Notify (System.String condition, System.String stackTrace, UnityEngine.LogType logType) [0x00000] in <00000000000000000000000000000000>:0 at BugsnagUnity.Client.MultiThreadedNotify (System.String condition, System.String stackTrace, UnityEngine.LogType logType) [0x00000] in <00000000000000000000000000000000>:0 at System.Action3[T1,T2,T3].Invoke (T1 arg1, T2 arg2, T3 arg3) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.Application.CallLogCallback (System.String logString, System.String stackTrace, UnityEngine.LogType type, System.Boolean invokedOnMainThread) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.Logger.LogException (System.Exception exception, UnityEngine.Object context) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.Debug.LogException (System.Exception exception) [0x00000] in <00000000000000000000000000000000>:0

Environment

  • bugsnag-unity version: 4.6.1
  • Unity version: 2018.4.5
  • Operating system name and version: Windows 10
  • Target platform names and versions: Probably all of them
  • Initializing bugsnag via the Unity UI or in code? In code

Crash in Unity on NSNotificationCenter events

I've started to get random crashed in iOS build in Unity plugin. Debugging lead me to BugsnagIosNotifier. In some cases NSNotificationCenter throws unrecognized selector. It happens with every handler, but i've received it most frequently on lowMemoryWarning and orientationChanged. This was happening sometimes in runtime, but almost every time on resume-after-pause.

I do have another subscriber to these events, but i don't think this can be a problem. After i commented out all subscriptions to NSNotificationCenter in BugsnagIosNotifier, everything started to work fine.

v4.6.7 iOS PostProcessBuild fails

We're getting this error building iOS after integrating Bugsnag v4.6.7. We have other 3rd party libraries already integrated that also make modifications to the XCode project.

Parameter name: node
System.Collections.Generic.LinkedList`1[T].ValidateNode (System.Collections.Generic.LinkedListNode`1[T] node) (at <d2957de1c3fd4781a43d89572183136c>:0)
System.Collections.Generic.LinkedList`1[T].AddBefore (System.Collections.Generic.LinkedListNode`1[T] node, T value) (at <d2957de1c3fd4781a43d89572183136c>:0)
BugsnagUnity.PostProcessBuild.Apply (System.Collections.Generic.LinkedList`1[T] lines, System.String symbolScriptUploadUuid) (at <fcf4c46fc47147ee98aa67bb67d63f8c>:0)
BugsnagUnity.PostProcessBuild.Apply (System.Collections.Generic.LinkedList`1[T] lines) (at <fcf4c46fc47147ee98aa67bb67d63f8c>:0)
BugsnagUnity.BugsnagBehaviourEditor.OnPostProcessBuild (UnityEditor.BuildTarget target, System.String path) (at Assets/_hothead/thirdparty/code/Bugsnag/BugsnagBehaviour.cs:156)

[Android] emulator:true & jailbroken:true is wrong for android out of memory crashes

Description

I am looking at Android SIGSEGV: Segmentation violation (invalid memory reference) errors in Bugsnag. When you go into the Device tab, it says emulator = true and jailbroken = true. That is not correct however, as I'm reproducing this crash on a non-jailbroken non-emulator device.

Issue

emulator and jailbroken should be correct

Environment

Unity Android

  • bugsnag-unity version: 4.2.0
  • Unity version: 2017.4.14f1
  • Operating system name and version: building with OSX
  • Target platform names and versions: Android 8.0 on HUAWEI ANE-LX2 (P20 Lite)
  • Initializing bugsnag via the Unity UI or in code? UI

Example code snippet

// run this method and it will crash your android device. start it up again and you should get a SIGSEGV error in Bugsnag.
// Then look at the Device tab and check what it says for Emulator and Jailbroken.
public void MemoryCrash() {
	StartCoroutine(MemoryCrashCor());
}

IEnumerator MemoryCrashCor() {
	Debug.Log("MemoryCrashCor");
	System.Text.StringBuilder sb = new System.Text.StringBuilder();
	List<string> list = new List<string>();
	for (int i = 0; i < int.MaxValue; ++i) {
		if (i % 100 == 0) {
			yield return 1;
		}
		try {
			sb.AppendFormat("!! {0},{1},{2},{3} !!\n", i, i * 2, Mathf.Pow((float)i, 2f), int.MaxValue - i);
			list.Add(sb.ToString());
		} catch {
			Debug.Log("MemoryCrashCor .... BOOOM!!");
		}
	}
}

dSYM Automatic Upload for Unity Build

In the recent days I have been working on my project and also have cloned the bugsnag Unity project. I have followed all of the Unity set up instructions to make sure that errors are being uploaded to Bugsnag. I was notified that with the NDK upload, this must be done with a curl and can't be done automatically with a Unity build at the moment. I am just looking to get confirmation on whether or not dSYMs can be uploaded automatically or do they have to be done with a curl for every new build when it comes to a Unity build? Any information about this is much appreciated.

Thanks a lot,
Christopher

Use better folder structure

The folder structure used by bugsnag is quite messy and should be changed so the plugin resides in it's own sub folders, like most other plugins.

This makes it easier to create build systems and keep track of which files belong to Bugsnag.

Plugins
--> Android
-->-->Bugsnag

Bugsnag
--> Editor
-->--> BugsnagPostProcess
--> Busnag.cs

Example project needs updating

Loading up the example project in Unity 5 gives build errors. I think this is because the project hasn't be changed to use the new version of the notifier.

[Android] SIGSEGV (out of memory) crashes dont get grouped up properly

Description

I am looking at our Bugsnag dashboard and there are thousands of issues, all with 1 user 1 event, for SIGSEGV errors. They should be grouped together but they aren't. It breaks the way you are supposed to use Bugsnag with this behavior.

Issue

SIGSEGV errors should be grouped together as 1 issue.

Environment

  • bugsnag-unity version: 4.2.0
  • Unity version: 2017.4.14f1
  • Operating system name and version: building with OSX
  • Target platform names and versions: Android 8.0 on HUAWEI ANE-LX2 (P20 Lite)
  • Initializing bugsnag via the Unity UI or in code? UI

Example code snippet

Reproduce a memory crash like in this ticket: #134
Each time you do, it creates a new issue rather than grouping them up.
I am assuming it is because the "callstack" is actually just a single memory address which is always different.

Screenshots:

image

image

Unity integrate application link 404 during sign-up flow

Expected behavior

unity package is downloaded when clicking link to DL

Observed behavior

404

Steps to reproduce

Sign up for account
On step 3, click link bugsnag-unity notifier [https://github.com/bugsnag/bugsnag-unity/blob/master/Bugsnag.unitypackage?raw=true]
404

Version

na

Additional information

Submitting as Github issue as the URL is to this repo, could easily be a site issue instead

Can't comment on Issues?

RegisterLogCallback is obsolete in Unity 5

RegisterLogCallback, used in bugsnag SDK, is obsolete. Unity asks to use logMessageReceived event instead:

UnityEngine.Application.RegisterLogCallback(UnityEngine.Application.LogCallback)' is obsolete:Application.RegisterLogCallback is deprecated. Use Application.logMessageReceived instead.'

Crash on android unity 4.6.3

"I'm on Unity 4.6.3. From the stack trace it looks more like its trying to log a debug via a method but it seems not available with expected signature.

This crash I got from Logcat when testing on android device. Bugsnag crashes the app after this issue. Nothing is logged on Bugsnag as you can see Bugsnag crashed.

I'm tracking all debug logs as well when I tried this. This happens random."

03-15 12:05:43.696  com.company.product 10856   10886   F   art art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: the return type of CallStaticObjectMethodA does not match void com.bugsnag.android.Bugsnag.notify(java.lang.String, java.lang.String, java.lang.StackTraceElement[], com.bugsnag.android.Severity, com.bugsnag.android.MetaData)

[iOS] out of memory events do not include the real user id

Describe the bug

iOS out of memory events do not include the real user ID.
Instead, the user id appears to be a guid for the device.

The out of memory events are also missing configuration set immediately after Bugsnag.Init(), the user id is the most important thing for us though.

Steps to reproduce

  1. On iOS, init Bugsnag and set the user id to "bob1"
  2. Trigger an out of memory crash
  3. Reopen the app and initialize bugsnag again (so that OOM event is reported)
  4. See that the event on bugsnag.com has some guid as the user id (should be "bob1")

Environment

  • Bugsnag version: v4.8.4
  • Unity version: 2019.4.16f1
  • iOS/Android/macOS/Windows/browser version: iOS 14.4
  • simulator/emulator or physical device: physical iPhone 8
  • Initializing bugsnag via a Unity GameObject or in code?: code
  • Player Settings:
    • Scripting backend (Mono or IL2CPP): IL2CPP
    • API compatibility level for .NET: .NET 4.x
    • Stack Trace level for all error types (None/ScriptOnly/Full): ScriptOnly

Example code snippet

    // init Bugsnag and trigger an out of memory crash
    public void TriggerOOM() {
		Bugsnag.Init("apikey", true);
        Bugsnag.Client.User.Id = "bob1";

        var list = new List<byte[]>();
        const int twentyMB = 20 * 1024 * 1024;
        while (true) {
            list.Add(new byte[twentyMB]);
        }
    }

This may be related to the already resolved issue [Android] user id not filled in for native crashes if you set user id after bugsnag.init #134

iOS 7.1.2 - EXC_BAD_ACCESS

When building on iPad (iOS 7.1.2) XCode (6.1) reports me this after starting the Unity app (Setup within Unity is as the Documentation says):

BugsnagEvent.m +writeEventToDisk:
[[NSFileManager defaultManager] createDirectoryAtPath:[self errorPath] withIntermediateDirectories:YES attributes:nil error:nil];
Thread 1: EXC_BAD_ACCESS (code=1, address=0x25)

bugsnag

[Android] Calling Bugsnag.Notify multiple times per frame will crash the app

Description

Call Bugsnag.Notify multiple times per frame will crash the app

Issue

JNI ERROR (app bug): local reference table overflow (max=512)
at BugsnagUnity.NativeInterface.DictionaryFromJavaMap (intptr)

It looks like this DictionaryFromJavaMap() method in NativeInterface.cs isn't deleting all the local references it is creating. So if you run it enough in the same frame, it will crash due to this local reference table overflow error.

I'm no Android/Java programmer, but I think all of these calls to CallStringMethod and CallObjectMethod need to have their result deleted via DeleteLocalRef.

I think the crash only happens on older/slower Android devices such as the Nexus 5X running Android OS 7.0. I don't think the Android OS matters though, I have seen the crash also on an Xiaomi Mi 8 running Android OS 9.0 device. But haven't seen the crash on any Android OS 8.0 devices.

Here is a subset of the devices that we've seen the crash on:
P9, P9 Lite, Tab A, Intex Aqua Craze, Galaxy Grand 2, S4, Xperia Z2, Le Pro 3, Redmi 4 Pro, Redmi Note 4, Vibe K5.
Almost all of those were running Android OS 7.0.

Environment

  • bugsnag-unity version: 4.2.0
  • Unity version: 2017.4.14f1
  • Operating system name and version: Windows 10
  • Target platform names and versions: Android, on a Nexus 5X running Android OS 7.0
  • Initializing bugsnag via the Unity UI or in code? UI

Example code snippet

To reproduce, you can just open this Unity project, scene "main", then build to your Android device. It will run 20 Bugsnag.Notify() calls which will crash the app. The project is completely empty except for the Bugsnag plugin plus my test code.
https://www.dropbox.com/s/43ssyb4kjrmksb4/TestBugsnag.zip?dl=0

update documentation for Breadcrumbs.Leave so it tells you how to leave a longer message

In the breadcrumb docs it does not tell you how to leave a longer message. It really should:

Breadcrumbs.Leave(logType.ToString(), BreadcrumbType.Log, new Dictionary<string, string> {
  { "message", longMessage },
});

Had to dig into the source code to figure that out since it's not really obvious that the dictionary would take a "message" key with the full text.

Native Windows Support

I would like to request Windows (not UWP) to be supported. It is the last thing I would need since Bug Snag supports all the platforms I need it to.

Specify available severity levels

Currently, in this notification plugin, severity is described as a string, which lead me to believe (erroneously) that Bugsnag supports any string as "severity" setting for an issue. However, the notifier API says that severity only has three valid values: "error", "warning" and "info". The best way to reflect it in C# is using an enum instead of string, and dotNET notifier plugin already has one.

Refactoring Unity notifier plugin to use enum instead of string internally would prevent such confusion.

Compatibility with Unity 4.7

Loading up the example project in Unity 4.7, there seems to be some code that is not compiled in/out correctly. The new notifier code files should be checked that they run using both Unity 5 editor and Unity 4 editor. e.g. !UNITY_LT_5 doesn't work and should be replaced with UNITY_5_OR_NEWER.

Bugsnag spams UnknownHostException on Android without internet and then app crashes

Description

I've integrated Bugsnag SDK into my project, and it caught some errors.

Issue

The phone wasn't connected to internet, and I've got a LOT of these lines:

    (Filename:  Line: 451)
2019-01-30 13:37:19.591 22565-22609/? E/Unity: java.net.UnknownHostException: Unable to resolve host "sessions.bugsnag.com": No address associated with hostname
     
    (Filename:  Line: 451)
2019-01-30 13:37:19.591 22565-22623/? E/Unity: java.net.UnknownHostException: Unable to resolve host "notify.bugsnag.com": No address associated with hostname
     
    (Filename:  Line: 451)
2019-01-30 13:37:19.610 22565-22613/? E/Unity: java.net.UnknownHostException: Unable to resolve host "sessions.bugsnag.com": No address associated with hostname
     
    (Filename:  Line: 451)
2019-01-30 13:37:19.627 22565-22610/? E/Unity: java.net.UnknownHostException: Unable to resolve host "notify.bugsnag.com": No address associated with hostname
     
    (Filename:  Line: 451)
2019-01-30 13:37:19.637 22565-22612/? E/Unity: java.net.UnknownHostException: Unable to resolve host "sessions.bugsnag.com": No address associated with hostname
     
    (Filename:  Line: 451)
2019-01-30 13:37:19.649 22565-22619/? E/Unity: java.net.UnknownHostException: Unable to resolve host "sessions.bugsnag.com": No address associated with hostname
     
    (Filename:  Line: 451)
2019-01-30 13:37:19.658 22565-22621/? E/Unity: java.net.UnknownHostException: Unable to resolve host "sessions.bugsnag.com": No address associated with hostname

spammed seemingly every frame. Then (after a minute or so) the app crashes, and it seems that this crash is associated with this condition as well:

2019-01-30 13:37:19.659 22565-22619/? E/CRASH: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 000000c4
2019-01-30 13:37:19.659 22565-22619/? E/CRASH: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2019-01-30 13:37:19.659 22565-22619/? E/CRASH: Build type 'Release', Scripting Backend 'mono', CPU 'armeabi-v7a'
2019-01-30 13:37:19.659 22565-22619/? E/CRASH: Build fingerprint: 'samsung/gts3lltexx/gts3llte:8.0.0/R16NW/T825XXU2BRG3:user/release-keys'
2019-01-30 13:37:19.659 22565-22619/? E/CRASH: Revision: '5'
2019-01-30 13:37:19.661 22565-22619/? E/CRASH: pid: 22565, tid: 22619, name: Thread-20722  >>> ru.sillypenguin.rat <<<
2019-01-30 13:37:19.661 22565-22619/? E/CRASH:     r0 000000c4  r1 c92a0b10  r2 00000000  r3 000000c4
2019-01-30 13:37:19.661 22565-22619/? E/CRASH:     r4 cd8ab778  r5 cd8ab770  r6 cd8ab778  r7 cc1da190
2019-01-30 13:37:19.661 22565-22619/? E/CRASH:     r8 80000001  r9 ca1f9260  sl 00000000  fp c92a07bc
2019-01-30 13:37:19.661 22565-22619/? E/CRASH:     ip caa5cc24  sp c92a0798  lr ca801d14  pc ed18b52e  cpsr 0000585b
2019-01-30 13:37:19.661 22565-22619/? E/CRASH: backtrace:
2019-01-30 13:37:20.142 22565-22619/? E/CRASH: 	#00  pc 0004952e  /system/lib/libc.so (pthread_mutex_lock+1)
2019-01-30 13:37:20.142 22565-22619/? E/CRASH: 	#01  pc 0013ed10  /data/app/ru.sillypenguin.rat-cbvirNzFbhe0t_f9x7JtoQ==/lib/arm/libmono.so
2019-01-30 13:37:20.142 22565-22619/? E/CRASH: 	#02  pc 00177c74  /data/app/ru.sillypenguin.rat-cbvirNzFbhe0t_f9x7JtoQ==/lib/arm/libmono.so (mono_gchandle_free+112)
2019-01-30 13:37:20.142 22565-22619/? E/CRASH: 	#03  pc 00643860  /data/app/ru.sillypenguin.rat-cbvirNzFbhe0t_f9x7JtoQ==/lib/arm/libunity.so
2019-01-30 13:37:20.142 22565-22619/? E/CRASH: 	#04  pc 002abd8c  /data/app/ru.sillypenguin.rat-cbvirNzFbhe0t_f9x7JtoQ==/lib/arm/libunity.so
2019-01-30 13:37:20.142 22565-22619/? E/CRASH: 	#05  pc 002abd30  /data/app/ru.sillypenguin.rat-cbvirNzFbhe0t_f9x7JtoQ==/lib/arm/libunity.so
2019-01-30 13:37:20.142 22565-22619/? E/CRASH: 	#06  pc 00935cfc  /data/app/ru.sillypenguin.rat-cbvirNzFbhe0t_f9x7JtoQ==/lib/arm/libunity.so
2019-01-30 13:37:20.142 22565-22619/? E/CRASH: 	#07  pc 009347b8  /data/app/ru.sillypenguin.rat-cbvirNzFbhe0t_f9x7JtoQ==/lib/arm/libunity.so
2019-01-30 13:37:20.142 22565-22619/? E/CRASH: 	#08  pc 002ab56c  /data/app/ru.sillypenguin.rat-cbvirNzFbhe0t_f9x7JtoQ==/lib/arm/libunity.so
2019-01-30 13:37:20.142 22565-22619/? E/CRASH: 	#09  pc 0057d238  /data/app/ru.sillypenguin.rat-cbvirNzFbhe0t_f9x7JtoQ==/lib/arm/libunity.so
2019-01-30 13:37:20.142 22565-22619/? E/CRASH: 	#10  pc 0057d19c  /data/app/ru.sillypenguin.rat-cbvirNzFbhe0t_f9x7JtoQ==/lib/arm/libunity.so
2019-01-30 13:37:20.142 22565-22619/? E/CRASH: 	#11  pc 0057d720  /data/app/ru.sillypenguin.rat-cbvirNzFbhe0t_f9x7JtoQ==/lib/arm/libunity.so
2019-01-30 13:37:20.142 22565-22619/? E/CRASH: 	#12  pc 0057d858  /data/app/ru.sillypenguin.rat-cbvirNzFbhe0t_f9x7JtoQ==/lib/arm/libunity.so
2019-01-30 13:37:20.142 22565-22619/? E/CRASH: 	#13  pc 0057caf0  /data/app/ru.sillypenguin.rat-cbvirNzFbhe0t_f9x7JtoQ==/lib/arm/libunity.so
2019-01-30 13:37:20.142 22565-22619/? E/CRASH: 	#14  pc 005f3178  /data/app/ru.sillypenguin.rat-cbvirNzFbhe0t_f9x7JtoQ==/lib/arm/libunity.so
2019-01-30 13:37:20.142 22565-22619/? E/CRASH: 	#15  pc 00048e77  /system/lib/libc.so (__pthread_start(void*)+22)
2019-01-30 13:37:20.142 22565-22619/? E/CRASH: 	#16  pc 0001b871  /system/lib/libc.so (__start_thread+32)

Environment

  • bugsnag-unity version: 4.1.1
  • Unity version: 2018.3.2f2
  • Operating system name and version: (where project was built) Windows 10 Pro 1803
  • Target platform names and versions: Android 8.0.0
  • Bugsnag initialized via code

Native crashes are not sent to On-Premise endpoint

Description

The custom endpoint should be used when a native crash is sent.

Issue

After an app crash, the crash is not reported anywhere. I dont see it on bugsnag.com and I dont see it on the server.

Environment

  • bugsnag-unity version: v4.8.2
  • Unity version: 2019.2.8f1
  • Operating system name and version: Mac OS Catalina (10.15.4)
  • Target platform names and versions: Android 10.0
  • Initializing bugsnag via the Unity UI or in code? Code

Example code snippet

Bugsnag.Init(demoApiKey, false);
// run a simple web server and put your local network ip here
Bugsnag.Configuration.Endpoint = new Uri("http://192.168.1.20:3000");

Exceptions reported with Bugsnag.Notify() are received on the web server. Native crashes are not. So I suspect this is an issue with the Endpoint not being passed to the Android plugin.

OSX bundle format is ambigious

The bugsnag-osx.bundle file that is used in the OSX plugin currently doesn't pass verification using codesign. One possible explaination is when the Unity packager compresses and inflates the bundle, the symlinks in the package are lost. By running codesign -v on the bundle we get Assets/Plugins/OSX/bugsnag-osx.bundle: bundle format is ambiguous (could be app or framework). This shouldn't stop the plugin for working, but will cause errors if the corresponding MacOSX app is submitted to the App Store.

Unity output huge amount of warnings on Android.

Description

Unity output huge amount of warnings on Android.

Issue

As soon as Bugsnag is initialized, the console is flooded by 2 warnings, triggered by unity, making the app laggy.
The warning are the following:

W/Unity: AndroidJNIHelper: converting Byte array is obsolete, use SByte array instead
W/Unity: AndroidJNIHelper.GetSignature: using Byte parameters is obsolete, use SByte parameters

Environment

  • bugsnag-unity version: v4.6.7 (android 64bit)
  • Unity version: 2019.2.0f1
  • Operating system name and version: OSX 10.14.6
  • Target platform names and versions: Android - api level 28 -
  • Initializing bugsnag via the Unity UI or in code? UI

Proposed fix

The issue seem to came from the method MakeJavaString in src/BugsnagUnity/Native/Android/NativeInterface.cs

return new AndroidJavaObject("java.lang.String", Encoding.UTF8.GetBytes(input), charset);

AndroidJavaObject constructor is call with an utf string encoded as byte[]. This type seems to be deprecated and should be replaced by sbyte[].

The following change has fixed the issue for me:

    private AndroidJavaObject MakeJavaString(string input) {
      if (input == null) {
        return null;
      }

      try {
        var CharsetClass = new AndroidJavaClass("java.nio.charset.Charset");
        // The default encoding on Android is UTF-8
        var charset = CharsetClass.CallStatic<AndroidJavaObject>("defaultCharset");
        byte[] Bytes = Encoding.UTF8.GetBytes(input);
        sbyte[] SBytes = new sbyte[Bytes.Length];
        Buffer.BlockCopy( Bytes, 0, SBytes, 0, Bytes.Length );
        return new AndroidJavaObject("java.lang.String", SBytes, charset);
      } catch (EncoderFallbackException _) {
        // The input string could not be encoded as UTF-8
        return new AndroidJavaObject("java.lang.String");
      }
    }

NDK Automatic Upload not working for Unity Android Build with Gradle

I have followed the set up for getting Bugsnag to report any errors or crashes in Unity with the gameobject and behaviour addition into my game. I am now seeing crashes and errors, and have moved onto the NDK upload document found here: https://docs.bugsnag.com/build-integrations/gradle/ I have added the necessary items into both AndroidManifest.xml and build.gradle and haven't seen any NDK get uploaded into the bugsnag dashboard under settings. I have my API key inside AndroidManifest.xml and in the build.gradle I have added the following lines:
apply plugin: 'com.android.application'
apply plugin: 'com.bugsnag.android.gradle'

bugsnag {
    ndk true
    sharedObjectPath "app/build/jni/libs"
    overwrite true
    retryCount 5
    requestTimeoutMs 5000
    failOnUploadError true
    builderName "Chris"
}

I have also added the following into proguard rules:
-keepattributes SourceFile,LineNumberTable
-keep class com.bugsnag.android.NativeInterface { *; }
-keep class com.bugsnag.android.Breadcrumb { *; }
-keep class com.bugsnag.android.Breadcrumbs { *; }
-keep class com.bugsnag.android.Breadcrumbs$Breadcrumb { *; }
-keep class com.bugsnag.android.BreadcrumbType { *; }
-keep class com.bugsnag.android.Severity { *; }
-keep class com.bugsnag.android.ndk.BugsnagObserver { *; }

Any help with this is greatly appreciated and if any other lines of code or explanation is needed, I will make sure to add them.

Thanks in advance!

tvOS support

Hello.

The support for tvOS is on near-future roadmap?

Thanks.

WebGL build failing in unity 5.6, Firefox

We get this exception when building in unity WebGL

exception thrown: ReferenceError: Bugsnag is not defined,_Register@blob:null/cef3cf97-00a7-44df-88b5-0d9ecf1adf45:9271:2
_NativeBugsnag_Register_m2124563816@blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:2930433:1
_Bugsnag_Init_m425662402@blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:1170152:1
_Bugsnag_Awake_m2325478159@blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:2693821:1
__Z31RuntimeInvoker_Void_t1841601450PK10MethodInfoPvPS2_@blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:3046808:1
__ZN6il2cpp2vm7Runtime6InvokeEPK10MethodInfoPvPS5_PP15Il2CppException@blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:2859708:1
_il2cpp_runtime_invoke@blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:2878602:1
__Z23scripting_method_invoke18ScriptingMethodPtr18ScriptingObjectPtrR18ScriptingArgumentsP21ScriptingExceptionPtrb@blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:2637447:1
__ZN19ScriptingInvocation6InvokeEP21ScriptingExceptionPtrb@blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:1576167:1
__ZN19ScriptingInvocation13InvokeCheckedEP21ScriptingExceptionPtr@blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:2392812:1
__ZN13MonoBehaviour9CallAwakeEv@blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:1391759:1
__ZN13MonoBehaviour12AddToManagerEv@blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:1346406:1
__ZN9Behaviour13AwakeFromLoadE17AwakeFromLoadMode@blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:2545914:1
__ZN13MonoBehaviour13AwakeFromLoadE17AwakeFromLoadMode@blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:928898:1
__ZN18AwakeFromLoadQueue28InvokePersistentManagerAwakeEPNS_4ItemEj17AwakeFromLoadMode@blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:1539762:1
__ZN18AwakeFromLoadQueue30PersistentManagerAwakeFromLoadEv@blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:2262347:1
__ZN18LoadSceneOperation21CompleteAwakeSequenceEv@blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:1902550:1
__ZN18LoadSceneOperation25PlayerLoadSceneFromThreadEv@blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:695116:1
__ZN18LoadSceneOperation19IntegrateMainThreadEv@blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:1337999:1
__ZN14PreloadManager26UpdatePreloadingSingleStepENS_21UpdatePreloadingFlagsEi@blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:1068975:1
__ZN14PreloadManager35WaitForAllAsyncOperationsToCompleteEv@blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:2421159:1
__ZN19RuntimeSceneManager9LoadSceneERKN4core12basic_stringIcNS0_20StringStorageDefaultIcEEEES6_S6_RK9UnityGUIDiNS_11LoadingModeE@blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:2391866:1
__Z21PlayerStartFirstSceneb@blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:880478:1
__Z20PlayerLoadFirstSceneb@blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:1951012:1
_main@blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:743703:1
UnityLoader.f965beab8cf410458f071d70728020b7/asm._main@blob:null/cef3cf97-00a7-44df-88b5-0d9ecf1adf45:20157:9
callMain@blob:null/cef3cf97-00a7-44df-88b5-0d9ecf1adf45:21593:13
doRun@blob:null/cef3cf97-00a7-44df-88b5-0d9ecf1adf45:21630:40
run@blob:null/cef3cf97-00a7-44df-88b5-0d9ecf1adf45:21642:3
runCaller@blob:null/cef3cf97-00a7-44df-88b5-0d9ecf1adf45:21570:28
removeRunDependency@blob:null/cef3cf97-00a7-44df-88b5-0d9ecf1adf45:1497:4
UnityLoader.f965beab8cf410458f071d70728020b7/</unityFileSystemInit</<@blob:null/cef3cf97-00a7-44df-88b5-0d9ecf1adf45:11:4
doCallback@blob:null/cef3cf97-00a7-44df-88b5-0d9ecf1adf45:6147:11
done@blob:null/cef3cf97-00a7-44df-88b5-0d9ecf1adf45:6158:5
done@blob:null/cef3cf97-00a7-44df-88b5-0d9ecf1adf45:5280:12
storeLocalEntry@blob:null/cef3cf97-00a7-44df-88b5-0d9ecf1adf45:5198:3
UnityLoader.f965beab8cf410458f071d70728020b7/reconcile/</<@blob:null/cef3cf97-00a7-44df-88b5-0d9ecf1adf45:5291:6
UnityLoader.f965beab8cf410458f071d70728020b7/loadRemoteEntry/req.onsuccess@blob:null/cef3cf97-00a7-44df-88b5-0d9ecf1adf45:5217:4
  UnityLoader.js:234:40
Invoking error handler due to
ReferenceError: Bugsnag is not defined  UnityLoader.js:522:7
ReferenceError: Bugsnag is not defined[Learn More]  cef3cf97-00a7-44df-88b5-0d9ecf1adf45:9271:2
	_Register blob:null/cef3cf97-00a7-44df-88b5-0d9ecf1adf45:9271:2
	_NativeBugsnag_Register_m2124563816 blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:2930433:1
	_Bugsnag_Init_m425662402 blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:1170152:1
	_Bugsnag_Awake_m2325478159 blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:2693821:1
	__Z31RuntimeInvoker_Void_t1841601450PK10MethodInfoPvPS2_ blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:3046808:1
	__ZN6il2cpp2vm7Runtime6InvokeEPK10MethodInfoPvPS5_PP15Il2CppException blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:2859708:1
	_il2cpp_runtime_invoke blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:2878602:1
	__Z23scripting_method_invoke18ScriptingMethodPtr18ScriptingObjectPtrR18ScriptingArgumentsP21ScriptingExceptionPtrb blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:2637447:1
	__ZN19ScriptingInvocation6InvokeEP21ScriptingExceptionPtrb blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:1576167:1
	__ZN19ScriptingInvocation13InvokeCheckedEP21ScriptingExceptionPtr blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:2392812:1
	__ZN13MonoBehaviour9CallAwakeEv blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:1391759:1
	__ZN13MonoBehaviour12AddToManagerEv blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:1346406:1
	__ZN9Behaviour13AwakeFromLoadE17AwakeFromLoadMode blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:2545914:1
	__ZN13MonoBehaviour13AwakeFromLoadE17AwakeFromLoadMode blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:928898:1
	__ZN18AwakeFromLoadQueue28InvokePersistentManagerAwakeEPNS_4ItemEj17AwakeFromLoadMode blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:1539762:1
	__ZN18AwakeFromLoadQueue30PersistentManagerAwakeFromLoadEv blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:2262347:1
	__ZN18LoadSceneOperation21CompleteAwakeSequenceEv blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:1902550:1
	__ZN18LoadSceneOperation25PlayerLoadSceneFromThreadEv blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:695116:1
	__ZN18LoadSceneOperation19IntegrateMainThreadEv blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:1337999:1
	__ZN14PreloadManager26UpdatePreloadingSingleStepENS_21UpdatePreloadingFlagsEi blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:1068975:1
	__ZN14PreloadManager35WaitForAllAsyncOperationsToCompleteEv blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:2421159:1
	__ZN19RuntimeSceneManager9LoadSceneERKN4core12basic_stringIcNS0_20StringStorageDefaultIcEEEES6_S6_RK9UnityGUIDiNS_11LoadingModeE blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:2391866:1
	__Z21PlayerStartFirstSceneb blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:880478:1
	__Z20PlayerLoadFirstSceneb blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:1951012:1
	_main blob:null/7b2c3e55-dc53-4e77-9390-05c972423957:743703:1
	UnityLoader.f965beab8cf410458f071d70728020b7/asm._main blob:null/cef3cf97-00a7-44df-88b5-0d9ecf1adf45:20157:9
	callMain blob:null/cef3cf97-00a7-44df-88b5-0d9ecf1adf45:21593:13
	doRun blob:null/cef3cf97-00a7-44df-88b5-0d9ecf1adf45:21630:40
	run blob:null/cef3cf97-00a7-44df-88b5-0d9ecf1adf45:21642:3
	runCaller blob:null/cef3cf97-00a7-44df-88b5-0d9ecf1adf45:21570:28
	removeRunDependency blob:null/cef3cf97-00a7-44df-88b5-0d9ecf1adf45:1497:4
	UnityLoader.f965beab8cf410458f071d70728020b7/</unityFileSystemInit</< blob:null/cef3cf97-00a7-44df-88b5-0d9ecf1adf45:11:4
	doCallback blob:null/cef3cf97-00a7-44df-88b5-0d9ecf1adf45:6147:11
	done blob:null/cef3cf97-00a7-44df-88b5-0d9ecf1adf45:6158:5
	done blob:null/cef3cf97-00a7-44df-88b5-0d9ecf1adf45:5280:12
	storeLocalEntry blob:null/cef3cf97-00a7-44df-88b5-0d9ecf1adf45:5198:3
	UnityLoader.f965beab8cf410458f071d70728020b7/reconcile/</< blob:null/cef3cf97-00a7-44df-88b5-0d9ecf1adf45:5291:6
	UnityLoader.f965beab8cf410458f071d70728020b7/loadRemoteEntry/req.onsuccess blob:null/cef3cf97-00a7-44df-88b5-0d9ecf1adf45:5217:4

PostProcess Dsym uploader

I was also having another issue, though, with the postprocess build script. I was able to fix it by modifying BugsnagPostProcess.cs.

When it defines the dsym upload script, it has a chunk in there like:

require 'shellwords'

This generated a nonfunctional build script for me, full of weird '' characters, but it seemed to generate appropriately when I replaced this chunk with

require \"shellwords\"

Runnig iOS fails

Hi

Maybe ARC Issue(*errorPath)
Unity Version 4.3.1f1
Xcode Version 5.1.1 (5B1008)
2014-06-25 19 16 26

Update documentation for class/message split

After going through Bugsnag documentation I noticed the split between Class and Message on error, and then found the split implemented with a regex in HandleLog method of Bugsnag.cs. It's nice that this is implemented, but it would be nicer if it was documented.

[Android] user id not filled in for native crashes if you set user id after bugsnag.init

Description

I am setting the user id and I want to see that same user id on bugsnag issues for native crashes.
I think the problem is because I am calling Bugsnag.Init before I set the user id, so it sends the previous native crash before the user id is set. But that is going to be a typical workflow and there should be a mechanism to handle it.

Issue

When I look at the bugsnag issue, the user id is the bugsnag generated user id and not my custom user id.

Environment

Android

  • bugsnag-unity version: 4.2.0
  • Unity version: 2017.4.14f1
  • Operating system name and version: building with OSX
  • Target platform names and versions: Android 8.0 on HUAWEI ANE-LX2 (P20 Lite)
  • Initializing bugsnag via the Unity UI or in code? UI

Example code snippet

// after your app starts up, run this code somewhere to set the user id
// this will run after bugsnag initializes, because we want to capture errors and exceptions from the first moment possible, but we dont know their user id until later
		BugsnagUnity.Bugsnag.SetUser(guid, email, name);
		BugsnagUnity.Bugsnag.BeforeNotify(report => {
			report.Metadata.Add("user", new Dictionary<string, object> {{ "admin", isAdmin }, { "guid", guid }});
		});

// run this method and it will crash your android device. start it up again and you should get a SIGSEGV error in Bugsnag.
// Then look at your report in bugsnag, the user id will not be set properly.
public void MemoryCrash() {
	StartCoroutine(MemoryCrashCor());
}

IEnumerator MemoryCrashCor() {
	Debug.Log("MemoryCrashCor");
	System.Text.StringBuilder sb = new System.Text.StringBuilder();
	List<string> list = new List<string>();
	for (int i = 0; i < int.MaxValue; ++i) {
		if (i % 100 == 0) {
			yield return 1;
		}
		try {
			sb.AppendFormat("!! {0},{1},{2},{3} !!\n", i, i * 2, Mathf.Pow((float)i, 2f), int.MaxValue - i);
			list.Add(sb.ToString());
		} catch {
			Debug.Log("MemoryCrashCor .... BOOOM!!");
		}
	}
}

Note: In the Android docs it says there is a setting called persistUserBetweenSessions (https://docs.bugsnag.com/platforms/android-kotlin/configuration-options/#setpersistuserbetweensessions) but that doesn't seem to exist for Unity. Mabye this would solve the problem?

Android Crash on start

Description

Trying to install the alpha version on Bugsnag on our Unity project

Issue

When starting the application it crashes

Environment

  • bugsnag-unity version: 4.0.0 alpha 1
  • Unity version: 2017.4.9f1
  • Operating system name and version: MacOs 10.13.5
  • Target platform names and versions: Android 6.0.1
  • Initializing bugsnag via the Unity UI or in code? Code

Bug report

                   art  E  JNI ERROR (app bug): accessed stale local reference 0x200001 (index 0 in a table of size 0)
                         F  art/runtime/indirect_reference_table.cc:67] JNI ERROR (app bug): see above.
        google-breakpad  W  ### ### ### ### ### ### ### ### ### ### ### ### ###
                         W  Chrome build fingerprint:
                         W  68.0.3440.91
                         W  344009150
                         W  ### ### ### ### ### ### ### ### ### ### ### ### ###
                  CRASH  E  signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr da8d0000
                         E  *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
                         E  Build fingerprint: 'Verizon/nobleltevzw/nobleltevzw:6.0.1/MMB29K/N920VVRS2BPF2:user/release-keys'
                         E  Revision: '9'
                         E  pid: 32461, tid: 306, name: Thread-2392  >>> com.************.********** <<<
                         E      r0 00000000  r1 00000000  r2 0001f3c4  r3 da8d0000
                         E      r4 da8cdfbc  r5 da8cdf40  r6 e9b443b9  r7 da8ce020
                         E      r8 00000000  r9 da8cdf50  sl c69c9a80  fp da8cdfbc
                         E      ip 00000004  sp da8cded4  lr f612cd61  pc f74b0a98  cpsr eeb61c4c
                         E  backtrace:
                         E      #00  pc 00017a98  /system/lib/libc.so (memset+48)
                         E      #01  pc 00009d5d  /system/lib/libunwind.so (_Uarm_local_access_addr_space_init+8)
                         E      #02  pc e9b4608c  <unknown/absolute>
                         E  stack:
                         E           da8cde94  ffffffff
                         E           da8cde98  ffffffff
                         E           da8cde9c  00000000
                         E           da8cdea0  00000000
                         E           da8cdea4  00000000
                         E           da8cdea8  00000032
                         E           da8cdeac  0000001f
                         E           da8cdeb0  da8cdf40
                         E           da8cdeb4  e9b4439a
                         E           da8cdeb8  da8ce020
                         E           da8cdebc  00000005
                         E           da8cdec0  da8cdf50
                         E           da8cdec4  00000000
                         E           da8cdec8  c69c9a80  [anon:libc_malloc]
                         E           da8cdecc  e9b460a8
                         E           da8cded0  00000000
                         E      #00  da8cded4  da8cdfbc
                         E           ........  ........
                         E      #01  da8cded4  da8cdfbc
                         E           da8cded8  e9b46090
                         E      #02  da8cdedc  f612c247  /system/lib/libunwind.so
                         E           da8cdee0  ffffffff
                         E           da8cdee4  00000000
                         E           da8cdee8  00001000
                         E           da8cdeec  00000001
                         E           da8cdef0  00000000
                         E           da8cdef4  00000037
                         E           da8cdef8  e9b45000
                         E           da8cdefc  e9b460c0
                         E           da8cdf00  0000002d
                         E           da8cdf04  da8cdf3c
                         E           da8cdf08  e9b443b9
                         E           da8cdf0c  00007ecd
                         E           da8cdf10  e9b4439a
                         E           da8cdf14  f7513ec0
                         E           da8cdf18  da8cdf34
                         E  memory near r2:
                         E      0001f3a4 ffffffff ffffffff ffffffff ffffffff  ................
                         E      0001f3b4 ffffffff ffffffff ffffffff ffffffff  ................
                         E      0001f3c4 ffffffff ffffffff ffffffff ffffffff  ................
                         E      0001f3d4 ffffffff ffffffff ffffffff ffffffff  ................
                         E      0001f3e4 ffffffff ffffffff ffffffff ffffffff  ................
                         E      0001f3f4 ffffffff ffffffff ffffffff ffffffff  ................
                         E      0001f404 ffffffff ffffffff ffffffff ffffffff  ................
                         E      0001f414 ffffffff ffffffff ffffffff ffffffff  ................
                         E      0001f424 ffffffff ffffffff ffffffff ffffffff  ................
                         E      0001f434 ffffffff ffffffff ffffffff ffffffff  ................
                         E      0001f444 ffffffff ffffffff ffffffff ffffffff  ................
                         E      0001f454 ffffffff ffffffff ffffffff ffffffff  ................
                         E      0001f464 ffffffff ffffffff ffffffff ffffffff  ................
                         E      0001f474 ffffffff ffffffff ffffffff ffffffff  ................
                         E      0001f484 ffffffff ffffffff ffffffff ffffffff  ................
                         E      0001f494 ffffffff ffffffff ffffffff ffffffff  ................
                         E  code around pc:
                         E      f74b0a78 e1a01c01 e1811421 e1811821 e213c007  ....!...!.......
                         E      f74b0a88 1a000024 e1a00001 e2522040 3a00000a  $.......@ R....:
                         E      f74b0a98 e1c300f0 e1c300f8 e1c301f0 e1c301f8  ................
                         E      f74b0aa8 e1c302f0 e1c302f8 e1c303f0 e1c303f8  ................
                         E      f74b0ab8 e2833040 e2522040 aafffff4 e2822040  @0..@ R.....@ ..
                         E      f74b0ac8 e1b0cd82 3a000004 e1c300f0 e1c300f8  .......:........
                         E      f74b0ad8 e1c301f0 e1c301f8 e2833020 5a000002  ........ 0.....Z
                         E      f74b0ae8 e1c300f0 e1c300f8 e2833010 e1b0ce82  .........0......
                         E      f74b0af8 3a000000 e0c300f8 5a000000 e4831004  ...:.......Z....
                         E      f74b0b08 e1b0cf82 14c31001 24c31001 25c31000  ...........$...%
                         E      f74b0b18 e8bd0001 e12fff1e e26cc008 e042200c  ....../...l.. B.
                         E      f74b0b28 e1b00f8c 44c31001 24c31001 24c31001  .......D...$...$
                         E      f74b0b38 e35c0004 3affffd2 e4831004 eaffffd0  ..\....:........
                         E      f74b0b48 eec01b10 e1b0ce82 3a000000 f400070d  ...........:....
                         E      f74b0b58 aa000000 f480080d e1b0cf82 44c01001  ...............D
                         E      f74b0b68 24c01001 24c01001 e8bd0001 e12fff1e  ...$...$....../.
                         E  code around lr:
                         E      f612cd40 2024f845 f855bdf8 60311024 f06fbdf8  E.$ ..U.$.1`..o.
                         E      f612cd50 bdf80002 2100b510 46044a03 ea58f7f8  .......!.J.F..X.
                         E      f612cd60 447b4b02 bd1060e3 00021448 ffffff47  .K{D.`..H...G...
                         E      f612cd70 2100b510 4a154c16 4620447c ea48f7f8  ...!.L.J|D F..H.
                         E      f612cd80 49142301 4a154814 4b156263 68094479  .#.I.H.Jcb.KyD.h
                         E      f612cd90 68004478 6061447a 447b4912 48126020  xD.hzDa`.I{D `.H
                         E      f612cda0 4a1260a2 4b1260e3 44784479 6812447a  .`.J.`.KyDxDzD.h
                         E      f612cdb0 21006161 6120447b 61a24620 61e3460a  aa.!{D a F.a.F.a
                         E      f612cdc0 fc1df7f8 4010e8bd bb94f7ff 00021448  .......@....H...
                         E      f612cdd0 0000b2e0 00007128 00007128 fffffef5  ....(q..(q......
                         E      f612cde0 fffffeff ffffff3b ffffff73 00007110  ....;...s....q..
                         E      f612cdf0 ffffff05 b085b530 a8044605 0006e900  ....0....F......
                         E      f612ce00 461a9902 b9199c03 f06fb914 e00d0002  ...F......o.....
                         E      f612ce10 0c02f014 682b6868 9300d004 69042300  ....hh+h.....#.i
                         E      f612ce20 e00347a0 46639300 47a868c5 bd30b005  .G....cF.h.G..0.
                         E      f612ce30 b5734b62 460d4604 681b447b b9086818  bKs..F.F{D.h.h..
             System.err  W  remove failed: ENOENT (No such file or directory) : /data/user/0/com.************.**********/files/AppEventsLogger.persistedevents
om.facebook.FacebookSdk  D  getGraphApiVersion: v3.0
           ViewRootImpl  D  ViewPostImeInputStage processPointer 0
                  CRASH  E  other thread is trapped; signum = 11
     InputEventReceiver  E  Exception dispatching input event.
       MessageQueue-JNI  E  Exception in MessageQueue callback: handleReceiveCallback
                         E  java.lang.Error: signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr da8d0000
                         E  Build fingerprint: 'Verizon/nobleltevzw/nobleltevzw:6.0.1/MMB29K/N920VVRS2BPF2:user/release-keys'
                         E  Revision: '9'
                         E  pid: 32461, tid: 306, name: Thread-2392  >>> com.************.********** <<<
                         E      r0 00000000  r1 00000000  r2 0001f3c4  r3 da8d0000
                         E      r4 da8cdfbc  r5 da8cdf40  r6 e9b443b9  r7 da8ce020
                         E      r8 00000000  r9 da8cdf50  sl c69c9a80  fp da8cdfbc
                         E      ip 00000004  sp da8cded4  lr f612cd61  pc f74b0a98  cpsr eeb61c4c
                         E      at libc.memset(memset:48)
                         E      at libunwind._Uarm_local_access_addr_space_init(_Uarm_local_access_addr_space_init:8)
                         E      at Unknown.0000208c(Unknown Source)

iOS notifier locks all threads on manual notify

At the moment bugsnag-cocoa locks all threads during a manual notify, which causes the unity game to stutter. We should disable threads collection in iOS (as we dont even attach it to the report)

[Windows] Cannot compose metadata in the same category.

Description

I have separate parts of my application that want to add keys to the same Metadata categories.

Executing the following statements should be valid:
BugsnagUnity.Bugsnag.Metadata.Add( "myCategory", new Dictionary<string, string> { { "keyA", "valueA" } } ) ;
BugsnagUnity.Bugsnag.Metadata.Add( "myCategory", new Dictionary<string, string> { { "keyB", "valueB" } } ) ;

Issue

Exception is thrown:
System.ArgumentException: An item with the same key has already been added. Key: myCategory

The Unity C# wrapper around the NativeClient uses a dictionary and naively calls .Add which will fail and throw exceptions if you attempt to add additional keys to the same category.

Environment

  • bugsnag-unity version: 4.6.4
  • Unity version: 2018.4.3f1
  • Operating system name and version: Windows 10
  • Target platform names and versions: Android/iOS
  • Initializing bugsnag via the Unity UI or in code? UI

Example code snippet

BugsnagUnity.Bugsnag.Metadata.Add( "myCategory", new Dictionary<string, string> { { "keyA", "valueA" } } ) ;
BugsnagUnity.Bugsnag.Metadata.Add( "myCategory", new Dictionary<string, string> { { "keyB", "valueB" } } ) ;

Expectation: KeyA,ValueA and KeyB,ValueB are merged into the category.
Result: Exception is thrown.

Support for Google external dependency manager

I've been testing out Bugsnag and run into a problem when targeting Android. The problem was caused by duplicate Kotlin libraries embedded into project. One version was part of the Bugsnag unity package and the second one were added through Google Dependency resolver as a dependency of MoPub.

I managed to fix the issue by removing the kotlin* libraries that were distributed as part of the unity package.

It would be nice if Bugsnag would also support Google dependency manager and not embed the external libraries directly. This has become almost a standard and for example Firebase, Facebook and MoPub use it, as well as many other 3rd party plugins.

https://github.com/googlesamples/unity-jar-resolver

xCode Compiler errors when using IL2CPP and Universal Architecture for unity ios build

Using Unity 4.6.5 and xCode 6.3.1. I get compiler errors when building the xCode project generated by Unity with IL2CPP scripting backend and Universal architecture.

I get errors for the KSCrashReport.c file:

  • Libraries/KSCrashReport.c:55:13: Unknown type name 'ucontext64_t'; did you mean 'ucontext_t'?
  • Libraries/KSCrashReport.c:424:69: _No member named 'uc_mcontext64' in 'struct _darwin_ucontext'; did you mean 'uc_mcontext'?

Error on Android 2.3.6

This reports whenever I log an exception. Lots of frames have passed before this is called and Bugsnag object is in the scene, enabled etc.

I don't get this error on other devices with a newer android os.

AndroidJavaException: java.lang.IllegalStateException: You must call Bugsnag.init before any other Bugsnag methods
at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in :0
UnityEngine.AndroidJNISafe.CallStaticVoidMethod (IntPtr clazz, IntPtr methodID, UnityEngine.jvalue[] args) [0x00000] in :0
UnityEngine.AndroidJavaObject._CallStatic (System.String methodName, System.Object[] args) [0x00000] in :0
UnityEngine.AndroidJavaObject.CallStatic (System.String methodName, System.Object[] args) [0x00000] in :0
Bugsnag+NativeBugsnag.SetContext (System.String context) [0x00000] in /Assets/Standard Assets/Bugsnag.cs:138
Bugsnag.set_Context (System.String value) [0x0000d] in /Assets/Standard Assets/Bugsnag.cs:218

[Android] java.lang.Error causing tgkill after upgrading unity

Describe the bug

We have a unity project that was on the 2018.4 LTS, and after upgrading to 2019.4 LTS we started seeing a couple of crashes on specific devices/os versions, that were consistent always and ended up with a java.lang.Error signal 6 crash. Commenting out the initialization and usage of bugsnag in our c# code was enough to stop all these weird crashes from hapenning.
While debugging, we noticed that these crashes started happening on 2019.2 and after, while testing on an upgrade to 2019.1 the problem never appeared. Unity changed the way they import/use the androidjni module on 2019.2, which might be a reason for this weird behaviour.

Steps to reproduce

We couldn't reproduce it but on our actual production use-case.

Environment

  • Bugsnag version: 4.8.2
  • Unity version: 2019.4.9f1
  • iOS/Android/macOS/Windows/browser version: Android 8
  • simulator/emulator or physical device: Physical Device - Huawei Mate 10 Lite
  • Initializing bugsnag via a Unity GameObject or in code?: Code
  • Player Settings:
    • Scripting backend (Mono or IL2CPP): Both
    • API compatibility level for .NET: 4.x
    • Stack Trace level for all error types (None/ScriptOnly/Full): Script Only
Caused by java.lang.Error: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Version '2019.4.9f1 (50fe8a171dd9)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
Build fingerprint: 'HUAWEI/LDN-L21B/HWLDN-Q:8.0.0/HUAWEILDN-L21/166(C185):user/release-keys'
Revision: '0'
ABI: 'arm64'
Timestamp: 2020-10-08 09:37:17+0300
pid: 15806, tid: 17100, name: UnityMain  >>> com.boundless.jawaker <<<
uid: 10249
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
    x0  0000000000000000  x1  00000000000042cc  x2  0000000000000006  x3  0000000000000008
    x4  000000007645b0c0  x5  000000007645b0c0  x6  000000007645b0c0  x7  000000007645b200
    x8  0000000000000083  x9  111f4897e6198655  x10 00000075652d3588  x11 111f4897e6198655
    x12 111f4897e6198655  x13 0000000000000020  x14 000000758773090c  x15 111f4897e6198655
    x16 00000075877eb2d8  x17 000000758777ea38  x18 0000000000000010  x19 0000000000003dbe
    x20 00000000000042cc  x21 000000757233f4c0  x22 000000000000000b  x23 00000075652d2689
    x24 0000000000000051  x25 00000075830623b0  x26 0000000000000244  x27 00000075834f947b
    x28 0000000000000043  x29 00000075652d25f0
    sp  00000075652d25b0  lr  0000007587724394  pc  000000758777ea40

backtrace:
      #00 pc 0000000000078a40  /system/lib64/libc.so (tgkill+8) (BuildId: b5934c95dd5853f7ffd9b057a52ab13e)
      #01 pc 000000000001e390  /system/lib64/libc.so (abort+88) (BuildId: b5934c95dd5853f7ffd9b057a52ab13e)
      #02 pc 000000000047b418  /system/lib64/libart.so (art::Runtime::PreZygoteFork()) (BuildId: d5abbb207b704ae580a598ed2f6f9d4f)
      #03 pc 000000000047bb64  /system/lib64/libart.so (art::Runtime::Create(art::RuntimeArgumentMap&&)) (BuildId: d5abbb207b704ae580a598ed2f6f9d4f)
      #04 pc 00000000005744c4  /system/lib64/libart.so (android::base::LogMessage::~LogMessage()+852) (BuildId: d5abbb207b704ae580a598ed2f6f9d4f)
      #05 pc 00000000004a96ac  /system/lib64/libart.so (art::Thread::AssertNoPendingExceptionForNewException(char const*) const+1184) (BuildId: d5abbb207b704ae580a598ed2f6f9d4f)
      #06 pc 000000000049fc0c  /system/lib64/libart.so (art::Thread::ThrowOutOfMemoryError(char const*)+200) (BuildId: d5abbb207b704ae580a598ed2f6f9d4f)
      #07 pc 000000000037eff4  /system/lib64/libart.so (art::JNI::EnsureLocalCapacityInternal(art::ScopedObjectAccess&, int, char const*)+104) (BuildId: d5abbb207b704ae580a598ed2f6f9d4f)
      #08 pc 000000000033c7a4  /system/lib64/libart.so (art::JNI::PushLocalFrame(_JNIEnv*, int)+616) (BuildId: d5abbb207b704ae580a598ed2f6f9d4f)
      #09 pc 00000000008e8988  /data/app/com.boundless.jawaker-Ka8k_E79giJZ6UFIIP7Hng==/lib/arm64/libunity.so (BuildId: da6ca9ca9f1345ae56e4125c2cd427e2ed5f6bd6)

       at libc.tgkill(tgkill:8)
       at libc.abort(abort:88)
       at libart.art::Runtime::PreZygoteFork()(PreZygoteFork)
       at libart.art::Runtime::Create(art::RuntimeArgumentMap&&)(Create)
       at libart.android::base::LogMessage::~LogMessage()(~LogMessage:852)
       at libart.art::Thread::AssertNoPendingExceptionForNewException(char const*) const(AssertNoPendingExceptionForNewException:1184)
       at libart.art::Thread::ThrowOutOfMemoryError(char const*)(ThrowOutOfMemoryError:200)
       at libart.art::JNI::EnsureLocalCapacityInternal(art::ScopedObjectAccess&, int, char const*)(EnsureLocalCapacityInternal:104)
       at libart.art::JNI::PushLocalFrame(_JNIEnv*, int)(PushLocalFrame:616)
       at libunity.0x8e8988()

DllNotFoundException

Testing out bugsnag for Unity right now. I'm getting an error on launch though:

DllNotFoundException: bugsnag
Bugsnag.Awake () (at Assets/Standard Assets/Bugsnag.cs:113)

Any ideas?

Duplicate symbols for architecture arm64

Description

Updating Bugsnag to 4.0 in our Unity project

Issue

Bugsnag library conflicts with other libraries when trying to build xcodeproj to iPhone

Environment

  • bugsnag-unity version: 4.0
  • Unity version: 2017.2.0p1
  • Operating system name and version: macOS High Sierra 10.13.6
  • Target platform names and versions: iPhone 7, 12.1
  • Initializing bugsnag via the Unity UI or in code? code

Xcode Error

ld: warning: arm64 function not 4-byte aligned: _unwind_tester from ...Libraries/libiPhone-lib.a(unwind_test_arm64.o)
duplicate symbol _OBJC_CLASS_$_AFImageCache in:
    ...Libraries/Plugins/iOS/libiOS_AFNetworkingUnity.a(UIImageView+AFNetworking.o)
duplicate symbol _OBJC_METACLASS_$_AFImageCache in:
   ...Libraries/Plugins/iOS/libiOS_AFNetworkingUnity.a(UIImageView+AFNetworking.o)
ld: 3 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

AndroidJavaException on Android with Unity 2019.2.6

I get AndroidJavaException error on android with Unity 2019.2.6

I use Bugsnag.unitypackage

It show this error when i change to another scene

09-22 22:13:55.948 9128 9155 E Unity : AndroidJavaException: java.lang.UnsatisfiedLinkError: com.bugsnag.android.ndk.NativeBridge
09-22 22:13:55.948 9128 9155 E Unity : java.lang.UnsatisfiedLinkError: com.bugsnag.android.ndk.NativeBridge
09-22 22:13:55.948 9128 9155 E Unity : at com.bugsnag.android.NativeInterface.configureClientObservers(NativeInterface.java:199)
09-22 22:13:55.948 9128 9155 E Unity : at com.bugsnag.android.Client.(Client.java:247)
09-22 22:13:55.948 9128 9155 E Unity : at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
09-22 22:13:55.948 9128 9155 E Unity : at com.unity3d.player.UnityPlayer.c(Unknown Source)
09-22 22:13:55.948 9128 9155 E Unity : at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source)
09-22 22:13:55.948 9128 9155 E Unity : at android.os.Handler.dispatchMessage(Handler.java:98)
09-22 22:13:55.948 9128 9155 E Unity : at android.os.Looper.loop(Looper.java:150)
09-22 22:13:55.948 9128 9155 E Unity : at com.unity3d.player.UnityPlayer$e.run(Unknown Source)
09-22 22:13:55.948 9128 9155 E Unity : at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in <00000000000000000000000000000000>:0
09-22 22:13:55.948 9128 9155 E Unity : at UnityEngine.AndroidJNISafe.NewObject (System.IntPtr clazz, System.IntPtr methodID, UnityEngine.jvalue[] args) [0x00000] in <00000000000000000000000000000000>:0
09-22 22:13:55.948 9128 9155 E Unity : at UnityEngine.AndroidJavaObject._AndroidJavaObject (System.String className, System.Object[] args) [0x000
09-22 22:14:13.905 9128 9155 E Unity : AndroidJavaException: java.lang.UnsatisfiedLinkError: com.bugsnag.android.ndk.NativeBridge

Duplicate symbol when linking with Unity + ARKit

Expected behavior

Bugsnag is able to be added without needing code modification

Observed behavior

Bugsnag library conflicts with Unity ARKit plugin (StartSession)

Steps to reproduce

New Unity Project
Import ARKit plugin
Open Example Scene
Add Bugsnag
Run for iOS

  • Xcode build fails with duplicate symbol linker error

Can't comment on Issues?

While not technically a blocking issue, this is definitely a friction point for on boarding new apps. Worked around by prefixing StartSession with BS_ in BugsnagUnity.mm and Bugsnag.cs - although a more elegant naming scheme may be better...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.