Coder Social home page Coder Social logo

microsoft / appcenter-sdk-unity Goto Github PK

View Code? Open in Web Editor NEW
77.0 23.0 45.0 17.22 MB

Development repository for the App Center SDK for Unity platforms, including Android, iOS, and UWP

License: Other

C# 85.02% C 0.46% Objective-C++ 5.88% Objective-C 3.39% PowerShell 1.64% Shell 0.96% Java 1.97% Makefile 0.10% CMake 0.31% C++ 0.26%

appcenter-sdk-unity's Introduction

Visual Studio App Center SDK for Unity

App Center is your continuous integration, delivery and learning solution for iOS, Android, and UWP apps. Get faster release cycles, higher-quality apps, and the insights to build what users want.

The App Center SDK uses a modular architecture so you can use any or all of the following services:

  1. App Center Analytics: App Center Analytics helps you understand user behavior and customer engagement to improve your app. The SDK automatically captures session count, device properties like model, OS version, etc. You can define your own custom events to measure things that matter to you. All the information captured is available in the App Center portal for you to analyze the data.

  2. App Center Crashes: App Center Crashes will automatically generate a crash log every time your app crashes. The log is first written to the device's storage and when the user starts the app again, the crash report will be sent to App Center. Collecting crashes works for both beta and live apps, i.e. those submitted to the App Store. Crash logs contain valuable information for you to help fix the crash.

  3. App Center Distribute: App Center Distribute will let your users install a new version of the app when you distribute it via the App Center. With a new version of the app available, the SDK will present an update dialog to the users to either download or postpone the new version. Once they choose to update, the SDK will start to update your application.

    Google Play considers the in-app update code as malicious behavior even if it isn’t used at runtime. Please remove this code before submitting your app to Google Play. Failure to not remove the in-app update code can lead to noncompliance and removal of the app from Google Play. See Remove in-app updates for Google Play builds documentation for details.

Getting Started

1. Prerequisites

Before you begin, make sure that your project is set up in Unity 2018.1 or later.

The App Center SDK for Unity supports the following platforms:

  • iOS (9.0 or later)
  • Android (5.0/API 21 or later)
  • UWP (Build 16299 or later)

.NET 3.5 scripting runtime version and .NET scripting backend are no longer supported on the UWP platform.

Also note that the App Center SDK for Unity is only available in C#.

2. Create your app in the App Center Portal to obtain the App Secret

If you have already created your app in the App Center portal, you can skip this step.

  1. Head over to appcenter.ms.
  2. Sign up or log in and click the blue button on the top right corner of the portal that says Add new and select Add new app from the dropdown menu.
  3. Enter a name and an optional description for your app.
  4. Select the appropriate OS and platform depending on your project as described above.
  5. Click the Add new app button in the bottom-right of the page.

Once you have created an app, you can obtain its App Secret on the Getting Started or Manage App sections of the App Center Portal.

3. Add the App Center SDK to your project

The App Center SDK is integrated by importing Unity Packages into your project.

The easiest way to get started is to use our Editor Extensions plugin. This plugin provides a clean UI for automatically downloading, installing and upgrading the App Center SDK.

Alternatively you can install the latest Asset Packages directly. Please follow instructions below if you would like to install packages manually:

3.1 Download the package(s)

The App Center Unity packages are downloaded from the releases tab. Download the package(s) that you want to use, from the latest release.

3.2 Import the package

Open your Unity project, then double-click each of the Unity packages you downloaded. A pop-up window should appear in your Unity project containing a list of files. Select Import, and the SDK will be added to your project. Do this for each package you downloaded and plan to use with your project.

4. Enable the SDK

4.1 Create an empty Game Object

App Center works as a component that you attach to a game object in the scene that your game launches into. Navigate to this scene and add an empty game object. Give it a descriptive name, such as "App Center".

4.2 Attach the App Center script

In the Project window, navigate to the "AppCenter" folder that was added to your project. Locate the script whose icon is the App Center logo, named AppCenterBehavior, and drag it onto your newly created game object in the Hierarchy window.

Note: You do not need to add App Center to every scene in which you wish to use it. Adding it to the first loaded scene is enough.

4.3 Configure App Center settings

Click on the new "App Center" object and add your app secrets to the corresponding fields in the Inspector window. Make sure to also check the "Use {service}" boxes for each App Center service you intend to use

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

appcenter-sdk-unity's People

Contributors

achocron avatar alex-oreshko avatar anastasiakubova avatar anatolypristensky avatar andenavya avatar andreishilkin avatar cloudwu1 avatar dhei avatar dmitriykirakosyan avatar dtrabo avatar evgeny-pol avatar guperrot avatar huyuyao0924 avatar jaeklim avatar jomcclan avatar kojinakamaru avatar kostya-zhidovinov avatar matkovivan avatar microsoftopensource avatar msftgits avatar olmisa avatar owlstronaut avatar robertrypuchuuuge avatar shadyabarada avatar thewulf7 avatar thyeggman avatar valtrain avatar vvechkanov avatar yuqche avatar yuyaohu 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

Watchers

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

appcenter-sdk-unity's Issues

Allow other directories than Assets/AppCenter

I'm working on a rather big and complex project. We're mainly trying to put Thirdparty components into a subdirectory of Assets. Today I wanted to integrate AppCenter and found that it is not working when not stored exactly in Assets/AppCenter. It would help a lot to structure bigger projects if it was possible to have AppCenter located in a different directory than the default one.

AppSecretDenied Error

Hi!
I'm using Unity 2019.1 and AppCenter 2.0.0.

I'm trying to generate a build with App Center, but it is failing to initialize with this error :

I checked the resulting Android Project, and appcenter-settings.xml is there with the correct appcenter_app_secret.

What Can I try to fix this?

E/AppCenter: Sending logs groupName=group_push id=5067df12-bfb6-4182-b18a-d4bdb394dcf0 failed
com.microsoft.appcenter.http.HttpException: 401 - CorrelationId: 77276558-1020-43d8-9135-39a8934bc94a ReasonCode: AppSecretDenied
at com.microsoft.appcenter.http.DefaultHttpClientCallTask.doHttpCall(DefaultHttpClientCallTask.java:305)
at com.microsoft.appcenter.http.DefaultHttpClientCallTask.doInBackground(DefaultHttpClientCallTask.java:319)
at com.microsoft.appcenter.http.DefaultHttpClientCallTask.doInBackground(DefaultHttpClientCallTask.java:47)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)

AppCenterDemoApp test instructions.

Hi i downloaded demo app and replace app's secret it with my own.
But after build & run, i cannot check "app center enabled" .
Do we have any instructions to follow to run it properly?
Thanks
image

Push: Catch missing Firebase SDK early

Please add a verification that the Firebase SDK exists when enabling Push. Right now if Push is enabled and the SDK is missing the App crashes on startup.

Make DontDestroyOnLoad optional

Hi, can you please make this optional? I run a single scene setup and don't have the App Center Behavior in the scene root which causes a warning.

Allow reporting custom errors to AppCenter

I'd like to report app errors to AppCenter, even ones that do not cause a crash.

Currently this can be "hacked" by calling Crashes.TrackError, but this is not so convenient as we're not always dealing with an exception object.

The workaround is to "wrap" every message i'd like to report in an Exception object, but this is not convenient to use and simply adds unneeded overhead.

Crashes SDK support for Unity UWP

At the moment, AppCenter Crashes SDK 2.2.0 does not support Unity UWP platform. It would really help to have this feature.

As an alternative, Microsoft Partner Center provides crash report tracking through Analytics Health section. But it does not help a lot, as it usually registers crashes as 'unknown' due to storage or privacy constrains. In some occasions, it does register crashes with system API calls, but it is not that helpful in comparison to Unity script calls stack-traces.

For exceptions, we can also use Unity Cloud Diagnostics, but it is also restricted and does not support crashes on UWP due to some platform limitation related to crash report interception.

In addition to that, it would be great to have not only crashes supported in the SDK, but also exceptions, errors and even custom logs tracking with AppCenter Diagnostics.

The function appcenter_unity_ns_string_to_cstr copies an NSString to char* incorrectly

Description

The function appcenter_unity_ns_string_to_cstr in NSStringHelper will, in some circumstances, incorrectly copy an NSString to a char* array. The function uses [nsstring length] + 1 to calculate the length of the char* array to allocate. It then converts the NSString from UTF-16 to UTF-8 and copies it into the newly created array.

The problem is that [nsstring length] is NOT the same as the length of the string after converting to UTF-8. Certain characters require a longer representation in UTF-8 than they do in UTF-16. This means that the allocated array can be shorter than the space required to store the full UTF-8 string.

Furthermore, the string copy is done using the function strncpy which does not guarantee that the copied string is null-terminated. If the specified length is less than the source string, the destination string will not be null terminated. This may lead to code reading past the end of the returned string.

The function should either use NSString's lengthOfBytes or perform a strlen on the UTF-8 string.

Repro Steps

Please list the steps used to reproduce your issue.

  1. Pass the following string into the function: @"what a fast 🐌!"
  2. Notice that the returned C# has dropped the exclamation mark

Details

  1. Which SDK version are you using?
    2.5.3
  2. Which platform did you experience the issue on?
    iOS
  3. What device version did you see this error on? Were you using an emulator or a physical device?
    N/A
  4. What third party plugins are you using?
    N/A
  5. Please enable verbose logging for your app using Initial Log Level setting and include the logs here:
    N/A
  6. Please share a screenshot of App Center Settings (without app secrets)
    N/A
  7. Please share a screenshot of Build and Player Settings.
    N/A

Rename Crashes.ReportUnhandledExceptions

I care about 2 different use cases:

  • Reporting app crashes
  • Reporting custom errors / exceptions (non-crashing)

The 1st use case i guess gets handled automatically after initializing the SDK (e.g: adding a GameObject with the AppCenterBehaviour componentin the scene).

As for the 2nd scenario: the name "ReportUnhandledExceptions" suggests that what this does is reporting exceptions to AppCenter, but digging into the code i could see that it actually registers to Unity's logMessageReceived event and logs any message that's an error, exception or assertion.

These are not unhandled exceptions at all, so i believe the best way would be to communicate this better to developers by renaming that method (and documentation) to reflect that.

AppCenterStarter.m not included in the iOS build

Hi,

I ran into an issue when integrating the SDK in my project for iOS. The C# methods in Unity were called when running the build on an iOS device but the native plugin wasn't reacting to them (no native logs were appearing even in verbose mode). If I understand well, the SDK is generating a file called AppCenterStarter.m that is used to launch the SDK. In my case it is generated but that file isn't included in the generated XCode project. After including the file manually, it worked well.

I'm not sure why it does that but I think the issue is linked to the build process in my team. We're developing on Windows and we use Jenkins to launch a build for iOS on a Mac Mini. Each time it is built, the project folder is cleared, the last commit of a specific branch is pulled from a Git repository and the build for iOS is launched on Unity by using CLI.

Maybe it could also be the Unity version. We're using the version 2017.4.12f1. I have seen some defines (UNITY_2018_1_OR_NEWER) in AppCenterPostBuild.cs so I guess that some parts of the build post process may not run correctly.

Sorry I don't have time to investigate more. Thanks in advance for the help!

[ISSUE] Namespace missing or not in the same mold

Hello Microsoft devs !
I found one script named "AndroidUtility" with a namespace convention different from any others scripts.
namespace Assets.AppCenter.Plugins.Android.Utility
whereas in any other script it's :
namespace Microsoft.AppCenter.Unity.Internal.Utility

so I think the logical thing for Android could be :
namespace Microsoft.AppCenter.Android.Utility

In some others scripts there is no namespace at all like those :
AppCenterBehavior
AppCenterBehaviorAdvanced
AppCenterSettings
AppCenterSettingsAdvanced

Could it be possible to fix this ?

PC and standalone builds support

Hi,

I would like to use this SDK in a Unity project targeting PC and standalone builds (now UWP). Are there any plans for this?

Thanks,
Davide

Unity iOS crash is not caught/reported

Description

I have a problem with detecting iOS crashes.
Logs tell that SDK is configured successfully, Analytics and crashes are enabled.
Errors are shown in the dashboard if I set Crashes.ReportUnhandledExceptions(true);
But still can't see any crash reported.
Bitcode is disabled. Symbols are uploaded. Unsymbolicated tab is empty too.
Crash initiated with Crashes.GenerateTestCrash();

Repro Steps

Please list the steps used to reproduce your issue.

  1. Import AppCenter SDK via AppCenter Editor Extensions into an empty Unity iOS project.
  2. Build for iOS and run on a physical device without debugger being attached
  3. Generate a test crash

Details

  1. Which SDK version are you using?

    • 2.5.1
  2. Which platform did you experience the issue on?

    • iOS 12.0.1 & iOS 13.1.2
  3. What device version did you see this error on? Were you using an emulator or a physical device?

    • iPhone 8 & iPad Air 3rd gen both physical
  4. What third party plugins are you using?

    • none in the test project
  5. Please enable verbose logging for your app using Initial Log Level setting and include the logs here:
    XCode output: AppCenter verbose logs.txt
    Console output:
    Logs.txt

  6. Please share a screenshot of App Center Settings (without app secrets)
    Screen Shot 2019-11-26 at 13 03 27

  7. Please share a screenshot of Build and Player Settings.
    Scripting Runtime version - .Net 4.x Equivalent
    Scripting Backend - IL2CPP
    Api Compatibility Level - .NET Standard 2.0

AppCenterDemoApp build setting

Hi I followed read me document to test AppCenterDemoApp in unity.
The app has default build setting in unity as windows standalone.
Is this recommended build setting? Or do we have other documentation to change the build setting like UWP
Thanks

Crashes service is not started on iOS when managed stripping level is set to medium or high

Description

Crashes service is not started on iOS when managed stripping level is set to medium or high.
The reason for this is that as part of managed bytecode stripping (See https://docs.unity3d.com/2019.3/Documentation/Manual/ManagedCodeStripping.html) UnityLinker determines that Crashes.StartCrashes is not called from anywhere and can be safely removed.

Repro Steps

  1. Create new Unity project and add and configure App Center SDK + Crashes package to the project
  2. Go to iOS player settings and change Managed Stripping Level to Medium
  3. Create and run iOS build and observe crashes service not starting

How to Fix This

Unity provides two ways (link.xml files or Preserve attribute) to instruct the UnityLinker that something is accessed by reflection and should not be stripped away. See https://docs.unity3d.com/2019.3/Documentation/Manual/ManagedCodeStripping.html.

Since the SDK is not using assembly definitions, preserving the whole assembly is probably not a good idea and the least intrusive solution would be to add [UnityEngine.Scripting.Preserve] attribute to Crashes.StartCrashes -method.

Looking at the AppCenterBehavior.cs (see following snippet), it seems likely that on iOS the Push service is affected as well and Push.StartPush may require similar treatment.

#if UNITY_IOS || UNITY_ANDROID
        else
        {
            foreach (var service in services)
            {
#if UNITY_IOS || UNITY_ANDROID
                // On iOS and Android we start crash service here, to give app an opportunity to assign handlers after crash and restart in Awake method
                var startCrashes = service.GetMethod("StartCrashes");
                if (startCrashes != null)
                    startCrashes.Invoke(null, null);
#endif
#if UNITY_IOS
                var startPush = service.GetMethod("StartPush");
                if (startPush != null)
                    startPush.Invoke(null, null);
#endif
            }
        }
#endif

Details

  1. Which SDK version are you using?
    • 2.5.1
  2. Which platform did you experience the issue on?
    • iOS 13
    • Android is likely affected as well when IL2CPP and managed bytecode stripping are being used.
  3. What device version did you see this error on? Were you using an emulator or a physical device?
    • iPhone 11

settings

Migrating from HockeyApp to MS App Center with Unity

Hi, we are transitioning our apps from HockeyApp o MS App Center. Using the steps here with the Unity SDK :
https://docs.microsoft.com/en-us/appcenter/sdk/getting-started/unity

The issue is that after the app is downloaded we can not get in-app updates to work it always returns this message even though the app is downloaded from https://install.appcenter.ms and is not side-loaded or in a browser in private mode.

Can you provide some assistance and insight in how to resolve this issue as having in-app updates is something we expect for Adhoc releases, this we could do in HockeyApp before the migration.

Here is a screenshot of the message we get in app, as I described above:

unnamed message

[ISSUE] On iOS, your device class generates ambiguous statement with Unity's one

Hello,
In our project we have this code :

if (float.TryParse(Device.systemVersion, out versionAsFloat))

But with your plugin integrated in this class now there is an ambiguous definition on this one because Unity already have this class definition.

Maybe it could be good to add something to avoid this cause due to this I have to specified at this particular place what we need to use, so in our case I must do :

if (float.TryParse(UnityEngine.iOS.Device.systemVersion, out versionAsFloat))

P.S : It could be a side effect from using asmdef. I don't know if you already try to call your class in another with unity's one already there ?
But generally (here at least) we just avoid to declare classes with exact same name than Unity's one (even if sometimes it's painful :/)

Why "unhandled exceptions" on android tracked in coroutine?

Can someone explain history of that code?

UnityCoroutineHelper.StartCoroutine(SendUnhandledExceptionReports);

I was seeing in git blame:

at some point, coroutine was creating in subscription to unhandled exceptions, then in this commit #187 coroutine creation was moved to exception handling

And now we produce new coroutines for each exception... any reasons for that?

And main question is coroutine creation and execution does not works in multithreaded application, which purpose of using queue with locking?
Why exception handling tracked in coroutine and only for android?

This behaviour complicates solutions like #242.

In teory we want set some properties in some place before exception throwing and clear them after. But async exception tracking make that painfull.

[Bug] Job failed with exception: System.IO.IOException

Summary

Job failed with exception: System.IO.IOException

Environment

  • macOS 10.14.4
  • Unity 2019.1.2f1
  • AppCenterEditorExtensions-v1.1.2.unitypackage

Steps to Reproduce

  1. Create new project in Unity3D.
  2. Install the App Center Unity Editor Extensions plugin.
  3. Open the Editor Extensions via the Unity menu and select "Install App Center SDK".
  4. Error occurred whenever play in Unity Editor.
Job failed with exception: System.IO.IOException: Write fault on path /Users/vkimone/Documents/UnityProject/P5-iOS-2019.1.2f1/[Unknown]
  at System.IO.FileStream.WriteInternal (System.Byte[] src, System.Int32 offset, System.Int32 count) [0x00077] in <1f0c1ef1ad524c38bbc5536809c46b48>:0 
  at System.IO.FileStream.Write (System.Byte[] array, System.Int32 offset, System.Int32 count) [0x00090] in <1f0c1ef1ad524c38bbc5536809c46b48>:0 
  at System.IO.StreamWriter.Flush (System.Boolean flushStream, System.Boolean flushEncoder) [0x00042] in <1f0c1ef1ad524c38bbc5536809c46b48>:0 
  at System.IO.StreamWriter.set_AutoFlush (System.Boolean value) [0x00010] in <1f0c1ef1ad524c38bbc5536809c46b48>:0 
  at System.Console.SetupStreams (System.Text.Encoding inputEncoding, System.Text.Encoding outputEncoding) [0x0009c] in <1f0c1ef1ad524c38bbc5536809c46b48>:0 
  at System.Console.set_OutputEncoding (System.Text.Encoding value) [0x00006] in <1f0c1ef1ad524c38bbc5536809c46b48>:0 
  at GooglePlayServices.CommandLine.RunViaShell (System.String toolPath, System.String arguments, System.String workingDirectory, System.Collections.Generic.Dictionary`2[TKey,TValue] envVars, GooglePlayServices.CommandLine+IOHandler ioHandler, System.Boolean useShellExecution, System.Boolean stdoutRedirectionInShellMode) [0x00026] in /Users/smiles/dev/src/unity-jar-resolver/source/PlayServicesResolver/src/CommandLine.cs:543 
  at Google.IOSResolver.RunCommandsAsync (Google.IOSResolver+CommandItem[] commands, Google.IOSResolver+CommandItemCompletionHandler completionDelegate, System.Boolean displayDialog, System.String summaryText) [0x0022c] in /Users/smiles/dev/src/unity-jar-resolver/source/IOSResolver/src/IOSResolver.cs:1831 
  at Google.IOSResolver.RunCommandAsync (System.String command, System.String commandArgs, GooglePlayServices.CommandLine+CompletionHandler completionDelegate, System.String workingDirectory, System.Boolean displayDialog, System.String summaryText) [0x0000d] in /Users/smiles/dev/src/unity-jar-resolver/source/IOSResolver/src/IOSResolver.cs:1854 
  at Google.IOSResolver.RunCommand (System.String command, System.String commandArgs, System.String workingDirectory, System.Boolean displayDialog) [0x00019] in /Users/smiles/dev/src/unity-jar-resolver/source/IOSResolver/src/IOSResolver.cs:1877 
  at Google.IOSResolver.ReadGemsEnvironment () [0x00000] in /Users/smiles/dev/src/unity-jar-resolver/source/IOSResolver/src/IOSResolver.cs:1621 
  at Google.IOSResolver.FindPodTool () [0x00067] in /Users/smiles/dev/src/unity-jar-resolver/source/IOSResolver/src/IOSResolver.cs:1674 
  at Google.IOSResolver.InstallCocoapods (System.Boolean interactive, System.String workingDirectory, System.Boolean displayAlreadyInstalled) [0x00051] in /Users/smiles/dev/src/unity-jar-resolver/source/IOSResolver/src/IOSResolver.cs:1254 
  at Google.IOSResolver.InstallCocoapodsInteractive (System.Boolean displayAlreadyInstalled) [0x0003c] in /Users/smiles/dev/src/unity-jar-resolver/source/IOSResolver/src/IOSResolver.cs:1190 
  at Google.IOSResolver.AutoInstallCocoapods () [0x00000] in /Users/smiles/dev/src/unity-jar-resolver/source/IOSResolver/src/IOSResolver.cs:1174 
  at Google.IOSResolver.<IOSResolver>m__0 () [0x00000] in /Users/smiles/dev/src/unity-jar-resolver/source/IOSResolver/src/IOSResolver.cs:548 
  at Google.RunOnMainThread.ExecuteNext () [0x0003d] in /Users/smiles/dev/src/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:363 
UnityEngine.Debug:LogError(Object)
Google.RunOnMainThread:ExecuteNext() (at /Users/smiles/dev/src/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:365)
Google.RunOnMainThread:<ExecuteAll>m__6() (at /Users/smiles/dev/src/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:394)
Google.RunOnMainThread:RunAction(Action) (at /Users/smiles/dev/src/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:234)
Google.RunOnMainThread:ExecuteAll() (at /Users/smiles/dev/src/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:392)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

[BUG][ANDROID][OTHERS?] Crashes lib seems to not work on 2.3.0 ?

Hello,
I'm trying to make AppCenter plugin's working with our project since yesterday. Today all seems to be configured correctly but the crash library doesn't work.
I supposed it was due to all my modification from your project (as you can see in my 3 previous posts issues @AnastasiaKubova ;) ).

But then, I tried to download your sample puppet project from this repository with my Android lib download from your 2.3.0 release. And it seems I have the same behaviour than my project.

Each time I tried to access to Crashes projects throw this in my Android Monitor :

For example with your puppet project when I press "Crashes Enabled" to activate or deactivate the feature I get :
09-24 16:10:19.012: E/AppCenter(7860): Crashes needs to be started before it can be used.

And I get this each time I try to reach any Crashes feature :/

The app seems to be initialized correctly with the Use Crashes set to "true".

Any hint / tip is welcomed !

P.S : I never tried others versions from AppCenter I start with this one.

Documentation for HockeyApp transition

Hi,

I ran into an issue with app secrets when doing the migration from HockeyApp to AppCenter. I have existing apps on HockeyApp but I want to start using the AppCenter SDK. There's no mention in the documentation that the app secret for HockeyApp is different than the one for AppCenter. It took me a while to realise that, as it's not displayed directly in AppCenter like for a new app. Could you please add some precisions in the documentation while the migration is still ongoing? Like for example that the secrets for apps still on HockeyApp can only be accessed with the 3 dots at the top right corner of the Settings page. Thanks in advance!

Otherwise, thanks for your work on the Unity SDK! It's really easier to use than the one for HockeyApp!

Unity sdk does not send errors or crashes to AppCenter on iOS devices

Unity sdk does not send errors or crashes to AppCenter on iOS devices.

On Android devices everything works fine.

The App Center Behavior has the correct iOS app secret.
Analytics and Crashes are checked.
iOS build is a debug build.

Set these 2 functions in the Start() function of a monobehaviour.
Microsoft.AppCenter.Unity.Crashes.Crashes.ReportUnhandledExceptions(true);
Microsoft.AppCenter.Unity.Crashes.Crashes.SetEnabledAsync(true);

Checked traffic with Charles and no calls are made to AppCenter.

Errors are not reported to AppCenter (Android)

I have added the Crashes unityPackage and set up the integration as required, but could not get any reports showing up on our app's dashboard.

Also, it is unclear whether the Analytics package is required as well if all i'm interested in is crashes / errors data.

[Bug] D3D build failure on basic project Unity 2019.1f1.

Bug
Visual studio project fails to compile when AppCenter SDK for unity is added to project.
(Error report included at end of this report)

Setup
Windows 10 Version 10.0.17763 Build 17763
Unity 2019.1.1f1
Visual Studio 2017 & 2019
Latest windows 10 SDK etc

Steps to Reproduce
Create new project in unity 2019.1.1f1
Add App-center SDK
Install analytics package.
Create a D3D Build
Open the Visual Studio project and build it

The following error is output:

il2cpp.exe didn't catch exception: Unity.IL2CPP.Building.BuilderFailedException: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\bin\HostX64\x64\link.exe /out:"R:\Source\UWP-Test\uwptest14\build\obj\il2cppOutputProject\x64\Debug\linkresult_300AEDD81259B9FA3DFCD48212B67285\GameAssembly.dll" /DEBUG:FASTLINK /INCREMENTAL:NO /LARGEADDRESSAWARE /NXCOMPAT /DYNAMICBASE /NOLOGO /TLBID:1 /HIGHENTROPYVA /DLL /NODEFAULTLIB:uuid.lib "Shcore.lib" "WindowsApp.lib" "Crypt32.lib" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\um\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64" /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\lib\x64\store" /APPCONTAINER /SUBSYSTEM:WINDOWS /NODEFAULTLIB:ole32.lib /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:msvcrt.lib @"C:\Users\shane\AppData\Local\Temp\tmp45C2.tmp"
1>
1>Creating library R:\Source\UWP-Test\uwptest14\build\obj\il2cppOutputProject\x64\Debug\linkresult_300AEDD81259B9FA3DFCD48212B67285\GameAssembly.lib and object R:\Source\UWP-Test\uwptest14\build\obj\il2cppOutputProject\x64\Debug\linkresult_300AEDD81259B9FA3DFCD48212B67285\GameAssembly.exp
1>DAAFDDB530D7D20E60516F17CA95E7E7.obj : error LNK2019: unresolved external symbol "public: static struct Il2CppString * __cdecl il2cpp::icalls::mscorlib::System::IO::MonoIO::GetCurrentDirectory(int *)" (?GetCurrentDirectory@MonoIO@IO@System@mscorlib@icalls@il2cpp@@SAPEAUIl2CppString@@PEAH@Z) referenced in function MonoIO_GetCurrentDirectory_m58052285E84A0379331FF2FE78A663C9F5C64C21
1>R:\Source\UWP-Test\uwptest14\build\obj\il2cppOutputProject\x64\Debug\linkresult_300AEDD81259B9FA3DFCD48212B67285\GameAssembly.dll : fatal error LNK1120: 1 unresolved externals
1>
1>   at Unity.IL2CPP.Building.CppProgramBuilder.PostprocessObjectFiles(HashSet`1 objectFiles, CppToolChainContext toolChainContext)
1>   at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
1>   at il2cpp.Program.DoRun(String[] args)
1>   at il2cpp.Program.Run(String[] args)
1>   at il2cpp.Program.Main(String[] args)
1>
1>Unhandled Exception: Unity.IL2CPP.Building.BuilderFailedException: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\bin\HostX64\x64\link.exe /out:"R:\Source\UWP-Test\uwptest14\build\obj\il2cppOutputProject\x64\Debug\linkresult_300AEDD81259B9FA3DFCD48212B67285\GameAssembly.dll" /DEBUG:FASTLINK /INCREMENTAL:NO /LARGEADDRESSAWARE /NXCOMPAT /DYNAMICBASE /NOLOGO /TLBID:1 /HIGHENTROPYVA /DLL /NODEFAULTLIB:uuid.lib "Shcore.lib" "WindowsApp.lib" "Crypt32.lib" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\um\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64" /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\lib\x64\store" /APPCONTAINER /SUBSYSTEM:WINDOWS /NODEFAULTLIB:ole32.lib /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:msvcrt.lib @"C:\Users\shane\AppData\Local\Temp\tmp45C2.tmp"
1>
1>Creating library R:\Source\UWP-Test\uwptest14\build\obj\il2cppOutputProject\x64\Debug\linkresult_300AEDD81259B9FA3DFCD48212B67285\GameAssembly.lib and object R:\Source\UWP-Test\uwptest14\build\obj\il2cppOutputProject\x64\Debug\linkresult_300AEDD81259B9FA3DFCD48212B67285\GameAssembly.exp
1>DAAFDDB530D7D20E60516F17CA95E7E7.obj : error LNK2019: unresolved external symbol "public: static struct Il2CppString * __cdecl il2cpp::icalls::mscorlib::System::IO::MonoIO::GetCurrentDirectory(int *)" (?GetCurrentDirectory@MonoIO@IO@System@mscorlib@icalls@il2cpp@@SAPEAUIl2CppString@@PEAH@Z) referenced in function MonoIO_GetCurrentDirectory_m58052285E84A0379331FF2FE78A663C9F5C64C21
1>R:\Source\UWP-Test\uwptest14\build\obj\il2cppOutputProject\x64\Debug\linkresult_300AEDD81259B9FA3DFCD48212B67285\GameAssembly.dll : fatal error LNK1120: 1 unresolved externals
1>
1>   at Unity.IL2CPP.Building.CppProgramBuilder.PostprocessObjectFiles(HashSet`1 objectFiles, CppToolChainContext toolChainContext)
1>   at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
1>   at il2cpp.Program.DoRun(String[] args)
1>   at il2cpp.Program.Run(String[] args)
1>   at il2cpp.Program.Main(String[] args)
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(44,5): error MSB3073: The command ""R:\Source\UWP-Test\uwptest14\Il2CppOutputProject\\IL2CPP\build\il2cpp.exe" --libil2cpp-static --compile-cpp -architecture=x64 -configuration=Debug -platform=winrt -outputpath="R:\Source\UWP-Test\uwptest14\\build\bin\x64\Debug\GameAssembly.dll" --data-folder="R:\Source\UWP-Test\uwptest14\\build\bin\x64\Debug\\" -cachedirectory="R:\Source\UWP-Test\uwptest14\\build\obj\il2cppOutputProject\x64\Debug\\" -generatedcppdir="R:\Source\UWP-Test\uwptest14\Il2CppOutputProject\\Source"  --profiler-report --additional-defines=WINDOWS_UWP --additional-defines=UNITY_UWP --additional-defines=UNITY_WSA_10_0 --additional-defines=UNITY_WSA --additional-defines=UNITY_WINRT --additional-defines=PLATFORM_WINRT -dotnetprofile=unityaot -verbose --map-file-parser="R:\Source\UWP-Test\uwptest14\Il2CppOutputProject\\IL2CPP\MapFileParser\MapFileParser.exe"" exited with code -532462766.
1>Done building project "Il2CppOutputProject.vcxproj" -- FAILED.

Allow to include properties for any exception/error reported

This is a feature that is really important to be able to handle some tricky bugs. Sometimes the stacktrace is not enough to fix the issue or the stacktrace is really too short like the ones that are sent by release builds when using IL2CPP. Having some context about the state of the game at the time of the crash is always useful in those cases. Would it be possible to implement a callback or an event that is called just before the exception/error is tracked? I implemented it that way in my project:

Crashes.cs

public static event Action<IDictionary<string, string>> AddCrashMetadataEvent;

private static void TrackErrorInternal(WrapperException exceptionWrapper)
{
	Dictionary<string, string> properties = new Dictionary<string, string>();
	if (AddCrashMetadataEvent != null)
	{
		AddCrashMetadataEvent(properties);
	}
	if (properties == null || properties.Count == 0)
	{
		CrashesInternal.TrackException(exceptionWrapper.GetRawObject());
	}
	else
	{
		CrashesInternal.TrackException(exceptionWrapper.GetRawObject(), properties);
	}
}

And I replaced the calls to CrashesInternal.TrackException() in that file by calls to TrackErrorInternal.

Game.cs

void Start()
{
        Crashes.AddCrashMetadataEvent += OnCrash;
}

private void OnCrash(IDictionary<string, string> properties)
{
        properties.Add("matchId", matchId);
        ....
}

It works fine for my use but maybe there's a better way to integrate it into the SDK. Thanks in advance for the feedback!

Coroutiner not destroyed due to 403 responses to GET requests editor extensions make

Description

For the last week I am getting exceptions inside the editor due to the editor extensions.
There is a GET request to https://api.github.com/repos/Microsoft/AppCenter-SDK-Unity-Extension/git/refs/tags which returns HTTP/1.1 403 Forbidden
So the Coroutiner is not destroyed and there are always those errors when you run the game inside the editor:

Some objects were not cleaned up when closing the scene. (Did you spawn new GameObjects from OnDestroy?)
The following scene GameObjects were found:
Coroutiner

[App Center EdEx MSG334] App Center Editor Extensions: HTTP/1.1 403 Forbidden

Maybe there should be a flag in the AppCenter window that turns off all those unnecessary requests?

Repro Steps

Please list the steps used to reproduce your issue.

  1. Import AppCenter Editor Extensions into an empty Unity project.
  2. Run inside the editor

Details

  1. Which SDK version are you using?

    • 2.5.1
  2. Which platform did you experience the issue on?

    • Unity Editor OSX
  3. What device version did you see this error on? Were you using an emulator or a physical device?

  4. What third party plugins are you using?

    • none in the test project
  5. Please enable verbose logging for your app using Initial Log Level setting and include the logs here:

  6. Please share a screenshot of App Center Settings (without app secrets)
    Screen Shot 2019-11-26 at 13 03 27

  7. Please share a screenshot of Build and Player Settings.
    Scripting Runtime version - .Net 4.x Equivalent
    Scripting Backend - IL2CPP
    Api Compatibility Level - .NET Standard 2.0

Android Obsolete Plugin setup

Description

When I build my app, I'm seeing the following warning:
OBSOLETE - Providing Android resources in Assets/Plugins/Android/res is deprecated, please move your resources to an AAR or an Android Library. See "AAR plug-ins and Android Libraries" section of the Manual for more details.
UnityEditor.EditorApplication:Internal_CallGlobalEventHandler() (at /Users/builduser/buildslave/unity/build/Editor/Mono/EditorApplication.cs:432)

This is caused by this file:
Assets/Plugins/Android/res/value/appcenter-settings.xml

https://support.unity3d.com/hc/en-us/articles/115005875443-Providing-Android-resources-in-Assets-Plugins-Android-res-is-deprecated

Repro Steps

Please list the steps used to reproduce your issue.

  1. Add sdk to project
  2. Set up sdk properly
  3. Build an android build

Details

  1. Which SDK version are you using?
    2.4.0
  2. Which platform did you experience the issue on?
    • Android 8.0
  3. What device version did you see this error on? Were you using an emulator or a physical device?
    • Editor
  4. What third party plugins are you using?
  5. Please enable verbose logging for your app using Initial Log Level setting and include the logs here:
  6. Please share a screenshot of App Center Settings (without app secrets)
  7. Please share a screenshot of Build and Player Settings.

Settings not save in prefab

Description

If I am manualy spawning AppCenterBehavior object from prefab it dose not have setting value. Your code is setting it after each time when I am focusing on prafab - but unity is not see any changes it.

Repro Steps

  1. Create empty gameobject in scene add AppCenterBehavior script
  2. Create prefab from this gameobject
  3. Remove this prefab from scene.
  4. Add reference to prefab in some class that will spawn it on game start
  5. Remove setting
  6. Create new setting by focusing on prefab
  7. Restart editor (in this point prefab will lose new reference to setting)
  8. run editor and game
  9. You will get error that setting are null

How to fix this

Add 2 lines when you are setting settings in AppCenterBehaviorEditor.cs:
Original code:
if (behaviour.Settings == null) { behaviour.Settings = AppCenterSettingsContext.SettingsInstance; }

to:
if (behaviour.Settings == null) { behaviour.Settings = AppCenterSettingsContext.SettingsInstance; EditorUtility.SetDirty(behaviour); EditorSceneManager.MarkSceneDirty(behaviour.gameObject.scene); }
then unity will see changes in files.

Details

  1. Which SDK version are you using?
    • 2.4.0
  2. Which platform did you experience the issue on?
    • Window, Mac, Android, iOS
  3. What device version did you see this error on? Were you using an emulator or a physical device?
    • editor and all builds

In-app updates disabled

Description

I get this error message when i distribute my iOS app. I am trying to enable Distribution updates. AS fas as i understand i just tick the checkbox in AppCenterBehaviour game object.
I receive the email, download the app, then AppCenter asks me to log in, which result in an error message and then to a "In-app updates disabled" message box.
I attach the images which show the workflow.

Repro Steps

Please list the steps used to reproduce your issue.

Details

  1. Which SDK version are you using?
    2.3.0, Unity 2018.1.1
  2. Which platform did you experience the issue on?
    IOS 11
  3. What device version did you see this error on? Were you using an emulator or a physical device?
    iPad Air 3rd gen
  4. What third party plugins are you using?
    Google AWS
  5. Please enable verbose logging for your app using Initial Log Level setting and include the logs here:
  6. Please share a screenshot of App Center Settings (without app secrets)
  7. Please share a screenshot of Build and Player Settings.

2019-09-30 17 02 53

2019-09-30 17 15 40

2019-09-30 17 22 43

2019-09-30 17 22 51

2019-09-30 17 22 56

[BUG] When AppCenter directory is not in "Assets" Unity can't build

Hello devs !

In our pipeline, every plugin must be in Assets/Plugins. So we have to change a little bit some plugin hierarchy (yours for example). Every time we do this, it's ok or barely ok. But with your plugin, it requires to be in "Assets/AppCenter" cause if the folder doesn't exist, it can't generate AppCenterSettings.asset and throw this error :
Player build failed: Parent directory must exist before creating asset at Assets/AppCenter/AppCenterSettings.asset.

A cleaner way to do this, would be to generate it locally to your AppCenter folder location instead of a static path named "Assets/AppCenter".

Thanks in advance for your answers.

AppCenterAuthPackage 404 when installing SDKs

Description

When doing a fresh install of the AppCenter SDK 3.1.0, the editor pane throws an HTTP 404 error when downloading the associated packages. Digging into it, it seems that the AppCenterAuthPackage is still trying to be pulled down but doesn't have a published release for 3.1.0

Repro Steps

Please list the steps used to reproduce your issue.

  1. Install AppCenter-SDK-Unity package
  2. Click on Install SDKs in editor pane

Details

  1. Which SDK version are you using?
    • 3.1.0
  2. Which platform did you experience the issue on?
    • MacOS

[FEATURE] Add asmdef logic in your package.

Hello,
could it be possible to add the asmdef logic as Unity package does currently ?
We do this in our project too, and when we add a third party package (like yours) into our project, if it doesn't contains asmdef it couldn't work.
So we have to create 2 folders basically to keep things clean :

  • Editor containing one asmdef file for editor stuff
  • Runtime containing one asmdef file for runtime stuff.

FYI : Add this logic to your package won't break non asmdef project ;)

thanks in advance.

Error on importing the package

System.Exception: Package directory not found:

"C:\Users\Mark\.nuget\packages\Microsoft.CSharp\4.0.1".
  at UnityEditor.Scripting.Compilers.NuGetPackageResolver.Resolve () [0x000dd] in <3f368bacb6c34f4db5fe7e90570f303a>:0 
  at AssemblyUpdater.Core.AssemblyUpdaterContext.AddFrameworkFolderToSearchPath (Mono.Cecil.AssemblyDefinition assemblyDefinition, Mono.Cecil.DefaultAssemblyResolver resolver, APIUpdater.Framework.Log.IAPIUpdaterListener listener) [0x000eb] in <3f368bacb6c34f4db5fe7e90570f303a>:0 
  at AssemblyUpdater.Core.AssemblyUpdaterContext.ReadAssembly (System.String assemblyPath, APIUpdater.Framework.Log.IAPIUpdaterListener listener, System.IO.FileAccess mode, System.String[] searchPaths) [0x0007a] in <3f368bacb6c34f4db5fe7e90570f303a>:0 
  at AssemblyUpdater.Core.AssemblyUpdaterContext.From (System.String assemblyPath, APIUpdater.Framework.Configuration.IConfigurationProvider configuration, System.String[] assemblySearchPaths, AssemblyUpdater.Core.UpdaterMode mode, APIUpdater.Framework.Log.IAPIUpdaterListener listener) [0x0002b] in <3f368bacb6c34f4db5fe7e90570f303a>:0 
  at AssemblyUpdater.Core.AssemblyUpdaterContext.From (System.String assemblyPath, System.String[] assemblySearchPaths, AssemblyUpdater.Core.UpdaterMode mode, APIUpdater.Framework.Log.IAPIUpdaterListener listener) [0x00001] in <3f368bacb6c34f4db5fe7e90570f303a>:0 
  at AssemblyUpdater.Application.Program.CheckForObsoleteAPIUsage (AssemblyUpdater.Application.CommandLineSpec config) [0x00013] in <3f368bacb6c34f4db5fe7e90570f303a>:0 
  at AssemblyUpdater.Application.Program.Main (System.String[] args) [0x00057] in <3f368bacb6c34f4db5fe7e90570f303a>:0 
UnityEditor.Scripting.APIUpdaterHelper:DoesAssemblyRequireUpgrade(String)

Update Newtonsoft.Json to newer version

The version of Newtonsoft.Json used in this project is rather old, it appears to be based on version 8.0.3 from this Asset Store entry. It's also only available in the Asset Store.

There is another port of Newtonsoft.Json available in a public Github Repo: SaladLab/Json.Net.Unity3D. Using this version has a few advantages:

  • Its based on Newtonsoft.Json v9.0.1. Not the latest and greatest, but certainly more advanced than 8.0.3.
  • As the package is FOSS it's easy to provide fixes and see what's wrong when issues arise
  • It's under MIT license, a broadly accepted license for free and commercial projects. Packages in the Asset Store fall under the Asset Store ToS which is a special license by Unity. Though I dont think there will be any legal issues arising it's a bit cleaner to go with the broadly accpeted license.

[IMPROVEMENTS] Possibility to skip native patching

Hello,
on our integration path we found some others dark spot during your native patching.
When people would start themselves your plugin has we do with the AppCenterBehaviorAdvanced and your 2 booleans I think it's pointless to try to patch Android native files like the xml patch based on the AppCenterSettings and the AppCenterStarter.m based on the same file.
Doing this just had some building time whereas it will be not used at all during the start of the app because some devs just doesn't provide the app secret id at this time but just at runtime (as we do).

I think adding one scripting define symbols that could be activated by some devs (like us :D) would be something good.

To keep your behavior and not break any project in use with your system. You could add something like :

#if !DONT_USE_NATIVE_STARTER
//All your editor code for patching each Android & iOS starter/loader file
#endif

In this way, only rare devs case as you said yesterday ;) could activate this feature by settings a
DONT_USE_NATIVE_STARTER in there project settings in the Scripting Define Symbols part.

We use this a lot for our build by profiles cause this allow use to build many different case based on the same initial code.

[QUESTION] Breakpad support / usage

Hello,

Did someone in your team succeed to use breakpad for Android build ?
For me it's something that could definietly be useful for Android build witgh IL2CPP (which is our case) I didn't dig a lot on this point (I have to take time for this).
I saw a BreakpadSupport folder in your puppet project that's why I asked for this :)

Thanks.

Build Errors for Android Unity "D8: Program type already present: com.microsoft.appcenter.analytics.Analytics"

Description

When attempting to build for Android, the build fails. The iOS build for the same project works fine. I get an alert dialog with this massive wall of text:

com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: /Users/paul/Projects/torch-topo/unity/Temp/gradleOut/build/intermediates/transforms/dexBuilder/release/0.jar, /Users/paul/Projects/torch-topo/unity/Temp/gradleOut/build/intermediates/transforms/dexBuilder/release/1.jar, /Users/paul/Projects/torch-topo/unity/Temp/gradleOut/build/intermediates/transforms/dexBuilder/release/2.jar, /Users/paul/Projects/torch-topo/unity/Temp/gradleOut/build/intermediates/transforms/dexBuilder/release/3.jar, /Users/paul/Projects/torch-topo/unity/Temp/gradleOut/build/intermediates/transforms/dexBuilder/release/4.jar, /Users/paul/Projects/torch-topo/unity/Temp/gradleOut/build/intermediates/transforms/dexBuilder/release/5.jar, /Users/paul/Projects/torch-topo/unity/Temp/gradleOut/build/intermediates/transforms/dexBuilder/release/6.jar, /Users/paul/Projects/torch-topo/unity/Temp/gradleOut/build/intermediates/transforms/dexBuilder/release/7.jar, /Users/paul/Projects/torch-topo/unity/Temp/gradleOut/build/intermediates/transforms/dexBuilder/release/8.jar, /Users/paul/Projects/torch-topo/unity/Temp/gradleOut/build/intermediates/transforms/dexBuilder/release/10.jar, /Users/paul/Projects/torch-topo/unity/Temp/gradleOut/build/intermediates/transforms/dexBuilder/release/11.jar, /Users/paul/Projects/torch-topo/unity/Temp/gradleOut/build/intermediates/transforms/dexBuilder/release/12.jar, /Users/paul/Projects/torch-topo/unity/Temp/gradleOut/build/intermediates/transforms/dexBuilder/release/13.jar, /Users/paul/Projects/torch-topo/unity/Temp/gradleOut/build/intermediates/transforms/dexBuilder/release/14.jar, /Users/paul/Projects/torch-topo/unity/Temp/gradleOut/build/intermediates/transforms/dexBuilder/release/15.jar, /Users/paul/Projects/torch-topo/unity/Temp/gradleOut/build/intermediates/transforms/dexBuilder/release/16.jar, /Users/paul/Projects/torch-topo/unity/Temp/gradleOut/build/intermediates/transforms/dexBuilder/release/17.jar, /Users/paul/Projects/torch-topo/unity/Temp/gradleOut/build/intermediates/transforms/dexBuilder/release/18.jar, /Users/paul/Projects/torch-topo/unity/Temp/gradleOut/build/intermediates/transforms/dexBuilder/release/19.jar See the Console for details.

The console log (edited for brevity, relevant statements in bold):

`Archive: Assets/AppCenter/Plugins/Android/appcenter-loader-release.aar
inflating: appcenter-loader-release/AndroidManifest.xml
inflating: appcenter-loader-release/R.txt
inflating: appcenter-loader-release/classes.jar
creating: appcenter-loader-release/libs/
inflating: appcenter-loader-release/libs/appcenter-push-release.aar
inflating: appcenter-loader-release/libs/appcenter-crashes-release.aar
inflating: appcenter-loader-release/libs/appcenter-analytics-release.aar
inflating: appcenter-loader-release/libs/appcenter-distribute-release.aar
inflating: appcenter-loader-release/libs/appcenter-auth-release.aar
inflating: appcenter-loader-release/libs/appcenter-release.aar
creating: appcenter-loader-release/res/
creating: appcenter-loader-release/res/values/
inflating: appcenter-loader-release/res/values/values.xml
creating: appcenter-loader-release/values/

adding: AndroidManifest.xml (deflated 55%)
adding: R.txt (deflated 82%)
adding: classes.jar (deflated 8%)
adding: libs/ (stored 0%)
adding: libs/appcenter-push-release.aar (deflated 64%)
adding: libs/appcenter-crashes-release.aar (deflated 64%)
adding: libs/appcenter-analytics-release.aar (deflated 64%)
adding: libs/appcenter-distribute-release.aar (deflated 64%)
adding: libs/appcenter-auth-release.aar (deflated 64%)
adding: libs/appcenter-release.aar (deflated 64%)
adding: res/ (stored 0%)
adding: res/values/ (stored 0%)
adding: res/values/values.xml (deflated 15%)
adding: values/ (stored 0%)

Refreshing native plugins compatible for Editor in 1.58 ms, found 0 plugins.
Preloading 0 native plugins for Editor in 0.00 ms.
Android PostProcess task "Checking prerequisites" took 38.1947 ms
Android PostProcess task "Detect Java Development Kit (JDK)" took 6.8848 ms
Android PostProcess task "Detecting Android SDK" took 80.4402 ms
Android PostProcess task "Detect Android NDK" took 0.0041 ms
Android PostProcess task "Trying to find a suitable Android device" took 0.0017 ms

Welcome to Gradle 5.1.1.
BUILD SUCCESSFUL in 0s
1 actionable task: 1 executed
Android PostProcess task "Preparing Managed resources" took 1409.0367 ms
Android PostProcess task "Splitting assets" took 12.1892 ms
Android PostProcess task "Processing OBB assets" took 0.0036 ms
Android PostProcess task "Preparing Unity libraries" took 62.6513 ms
OBSOLETE - Providing Android resources in Assets/Plugins/Android/res is deprecated, please move your resources to an AAR or an Android Library. See "AAR plug-ins and Android Libraries" section of the Manual for more details.

Android PostProcess task "Processing resources" took 11.2137 ms
Android PostProcess task "Preparing APK resources" took 7.4156 ms
Android PostProcess task "Processing plugins" took 61.4096 ms
Android PostProcess task "Processing Android libraries" took 6.6288 ms
Android PostProcess task "Checking Graphics API compatibility" took 15.4085 ms
Android PostProcess task "Creating Android manifest" took 94.0535 ms
Unloading 109 Unused Serialized files (Serialized files now loaded: 0)
System memory in use before: 413.0 MB.
System memory in use after: 412.8 MB.

Unloading 151 unused Assets to reduce memory usage. Loaded Objects now: 2376.
Total: 349.365667 ms (FindLiveObjects: 0.550747 ms CreateObjectMapping: 0.130050 ms MarkObjects: 347.374034 ms DeleteObjects: 1.309617 ms)

Android PostProcess task "Compiling resources" took 440.1081 ms
Android PostProcess task "IL2CPP" took 0.0064 ms
Android PostProcess task "Build native Unity binary" took 0.0012 ms
Android PostProcess task "Zipping symbols" took 0.001 ms
Android PostProcess task "Performance Reporting Symbol Upload" took 0.0013 ms
Android PostProcess task "Preparing streaming assets" took 8.2939 ms
Android PostProcess task "Creating APK expansion package (OBB)" took 0.0068 ms
Android PostProcess task "Exporting project" took 194.5325 ms
D8: Program type already present: com.microsoft.appcenter.analytics.Analytics$10

FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':transformDexArchiveWithExternalLibsDexMergerForRelease'.
Program type already present: com.microsoft.appcenter.analytics.Analytics$10

Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.`

Details

  1. Which SDK version are you using?
    2.5.1

  2. Which platform did you experience the issue on?
    Unity Android

  3. What device version did you see this error on? Were you using an emulator or a physical device?
    n/a

  4. What third party plugins are you using?
    Azure Spatial Anchors

  5. Please enable verbose logging for your app using Initial Log Level setting and include the logs here:

  6. Please share a screenshot of App Center Settings (without app secrets)
    image

  7. Please share a screenshot of Build and Player Settings.
    image

Unity 2019.3.0b9 iOS Xcode Project: Use of undeclared identifier 'MSAppCenter'

Description

When trying to build the Xcode project it fails with:
Use of undeclared identifier 'MSAppCenter'
and
Use of undeclared identifier 'MSAnalytics'

Repro Steps

  1. Create App on AppCenter
  2. Import AppCenter SDK and enable Analytics and Crash
  3. Create GameObject with AppCenter Behaviour and enter iOS App Secret
  4. Build xcode project
  5. Get build errors

Details

  1. Which SDK version are you using?
    • AppCenterEditorExtensions-v1.2.0.unitypackage
  2. Which platform did you experience the issue on?
    • iOS
  3. What device version did you see this error on?
    • Mac
  4. What third party plugins are you using?
    • None
  5. Please enable verbose logging for your app using Initial Log Level setting and include the logs here:
/Users/username/Development/companyname/gamename/builds/iOS/gamebuild/Libraries/AppCenter/Plugins/iOS/Core/AppCenterStarter.m:10:1: error: use of '@import' when modules are disabled
@import AppCenter;
^
/Users/username/Development/companyname/gamename/builds/iOS/gamebuild/Libraries/AppCenter/Plugins/iOS/Core/AppCenterStarter.m:13:1: error: use of '@import' when modules are disabled
@import AppCenterCrashes;
^
/Users/username/Development/companyname/gamename/builds/iOS/gamebuild/Libraries/AppCenter/Plugins/iOS/Core/AppCenterStarter.m:22:1: error: use of '@import' when modules are disabled
@import AppCenterAnalytics;
^
/Users/username/Development/companyname/gamename/builds/iOS/gamebuild/Libraries/AppCenter/Plugins/iOS/Core/AppCenterStarter.m:68:4: error: use of undeclared identifier 'MSAppCenter'
  [MSAppCenter setLogLevel:(MSLogLevel)kMSLogLevel];
   ^
/Users/username/Development/companyname/gamename/builds/iOS/gamebuild/Libraries/AppCenter/Plugins/iOS/Core/AppCenterStarter.m:77:6: error: use of undeclared identifier 'MSAppCenter'
    [MSAppCenter setMaxStorageSize:maxStorageSize
     ^
/Users/username/Development/companyname/gamename/builds/iOS/gamebuild/Libraries/AppCenter/Plugins/iOS/Core/AppCenterStarter.m:95:22: error: use of undeclared identifier 'MSAnalytics'
  [classes addObject:MSAnalytics.class];
                     ^
/Users/username/Development/companyname/gamename/builds/iOS/gamebuild/Libraries/AppCenter/Plugins/iOS/Core/AppCenterStarter.m:125:6: error: use of undeclared identifier 'MSAppCenter'
    [MSAppCenter setLogUrl:customLogUrl];
     ^
/Users/username/Development/companyname/gamename/builds/iOS/gamebuild/Libraries/AppCenter/Plugins/iOS/Core/AppCenterStarter.m:135:8: error: use of undeclared identifier 'MSAppCenter'
      [MSAppCenter start:customAppSecretValue withServices:classes];
       ^
/Users/username/Development/companyname/gamename/builds/iOS/gamebuild/Libraries/AppCenter/Plugins/iOS/Core/AppCenterStarter.m:138:8: error: use of undeclared identifier 'MSAppCenter'
      [MSAppCenter start:[NSString stringWithFormat:@"target=%@", kMSTargetToken] withServices:classes];
       ^
/Users/username/Development/companyname/gamename/builds/iOS/gamebuild/Libraries/AppCenter/Plugins/iOS/Core/AppCenterStarter.m:141:8: error: use of undeclared identifier 'MSAppCenter'
      [MSAppCenter start:[NSString stringWithFormat:@"appsecret=%@;target=%@", customAppSecretValue, kMSTargetToken] withServices:classes];
       ^
/Users/username/Development/companyname/gamename/builds/iOS/gamebuild/Libraries/AppCenter/Plugins/iOS/Core/AppCenterStarter.m:144:8: error: use of undeclared identifier 'MSAppCenter'
      [MSAppCenter startWithServices:classes];
       ^
11 errors generated.
  1. Please share a screenshot of App Center Settings (without app secrets)

image

  1. Please share a screenshot of Build and Player Settings.

image

image

[QUESTION] Start AppCenter manually

Hello again (sorry for those tickets),
In our projects, we have what we called profiles that we use to build our application with different skins etc...

Each profile can have a different bundle ID and so a different HockeyApp ID. So in your case different secret app id.
So we can't have the component directly on an object in our scene so the AppCenterBehavior doesn't exist before build and soo the AppCenterSettings that could be create or already present in the "AppCenter" folder doesn't have any information when we build.
We try to instantiate it at runtime and so we fill it with information retrieve from our profile file.

If we do this it seems to be mandatory to add the AppCenterBehaviorAdvanced component with
StartAndroidNativeSDKFromAppCenterBehavior set to true otherwise it doesn't work am I correct ?
Because when the AppCenter can't start from the native side on Start, it won't succeed to start the AppCenter when the component is added with an AddComponent by code.

AppCenterPostBuild.GetAppFilePath should use Application.productName

Hi guys,

We recently imported the AppCenter SDK Unity into our project and could not build the UWP build. turns our the problem was coming from the follow method GetAppFilePath in AppCenterPostBuild.cs, specifically the line:
var candidate = Path.Combine(pathToBuiltProject, PlayerSettings.WSA.tileShortName);

This should be
var candidate = Path.Combine(pathToBuiltProject, Application.productName);

The reason is because Unity will always use the productName to generate the sub folder in the output path, but the titleShortName is up to the developers discretion (in our case the Title Short name was different from the Product name and had spaces in it).

Also for the method AppCenterPostBuild.InjectCodeToFile, there should be a safe check for when GetAppFilePath fails for whatever reason and returns null:

I put this at the top of the function to avoid the null exception from File.ReadAllText during the build process:

if(string.IsNullOrEmpty(appFilePath))
{
// TODO Update documentation link
Debug.LogError("Unable to automatically modify file '" + appFilePath + "'. For App Center Push to work properly, " +
"please follow troubleshooting instructions at https://docs.microsoft.com/en-us/mobile-center/sdk/troubleshooting/unity");

        return;
    }

If you guys can make me a contributor (or show me how, I can make a pull request with my changes).

Cheers,

Async methods can't be awaited using built in c# await operator

Base on the Asynchronous APIs in the Unity SDK documentation, it is expected that the App Center SDK's async methods support built-in await operator in case of a codebase has access to .NET 4.6 or above.

But currently, the following code can't be compiled:

private async void Start()
{
    bool isEnabled = await AppCenter.IsEnabledAsync();
}

The reported error is:

error CS1061: 'AppCenterTask<bool>' does not contain a definition for 'GetAwaiter' and no accessible extension method 'GetAwaiter' accepting a first argument of type 'AppCenterTask<bool>' could be found (are you missing a using directive or an assembly reference?)

Steps to reproduce

  • Open App Center Demo project
  • Update player settings configuration to use the following values:
    Scripting Runtime Version -> .Net 4x Equivalent
    Api Compatability Level -> .Net Standard 2.0
  • Try to consume SDK's async methods using built-in c# features as in code example above.

Actual: failed to compile with error described above
Expected: async method should be awaited or documentation should be updated to remove misleading information.

Scripting runtime .NET 3.5 is not supported

Currently you cannot use the majority of the crashes API due to a dependency on async/await code which is not supported in C#4 (the only stable version in 2017.4)

To use later versions of C# you have to upgrade to .Net 4.6, this is not recommend as it is unstable/experimental in 2017.4. For large projects the upgrade to 2018.4 is non trivial.

Synchronous versions (or coroutine implementations) of these methods should be provided in the API.

Error on Building for iOS in Unity 2019.3

Using Unity 2019.3b8 fails to build project with AppCenter for iOS.

Exception: Calling TargetGuidByName with name='Unity-iPhone' is deprecated. There are two targets now, call GetUnityMainTargetGuid() - for app or GetUnityFrameworkTargetGuid() - for source/plugins to get Guid instead. UnityEditor.iOS.Xcode.PBXProject.TargetGuidByName (System.String name) (at /Users/builduser/buildslave/unity/build/External/XcodeAPI/Xcode/PBXProject.cs:168) System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0) Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation. System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0) System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <437ba245d8404784b9fbab9b439ac908>:0) PBXProjectWrapper.AddBuildProperty (System.String name, System.String value) (at Assets/AppCenter/Editor/PBXProjectWrapper.cs:70) AppCenterPostBuild.OnPostprocessProject (PBXProjectWrapper project) (at Assets/AppCenter/Editor/AppCenterPostBuild.cs:434) AppCenterPostBuild.OnPostprocessBuild (UnityEditor.BuildTarget target, System.String pathToBuiltProject) (at Assets/AppCenter/Editor/AppCenterPostBuild.cs:74) AppCenterPostBuild.OnPostprocessBuild (UnityEditor.Build.Reporting.BuildReport report) (at Assets/AppCenter/Editor/AppCenterPostBuild.cs:42) UnityEditor.Build.BuildPipelineInterfaces+<>c__DisplayClass17_0.<OnBuildPostProcess>b__1 (UnityEditor.Build.IPostprocessBuildWithReport bpp) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:433) UnityEditor.Build.BuildPipelineInterfaces.InvokeCallbackInterfacesPair[T1,T2] (System.Collections.Generic.List1[T] oneInterfaces, System.Action1[T] invocationOne, System.Collections.Generic.List1[T] twoInterfaces, System.Action1[T] invocationTwo, System.Boolean exitOnFailure) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:391) UnityEditor.BuildPipeline:BuildPlayer(BuildPlayerOptions) GameConfigEditor:PerformiOSBuild(SerializedObject, String) (at Assets/_Game/Scripts/Game/Editor/GameConfigEditor.cs:725) GameConfigEditor:OnInspectorGUI() (at Assets/_Game/Scripts/Game/Editor/GameConfigEditor.cs:208) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:187)

AppCenterStarter.m not included in the iOS build

Hi,

I'm trying to reopen the issue #241 , as we're facing the same problem: iOS builds do not send any crash reports.

I've imported the AppCenterCrashes-v2.4.0.unitypackage into our project on Unity v2018.3.6f1, configured as per the guidelines and tested the Android build that worked flawlessly.
Unfortunately iOS didn't go that well and after some testing I've came to the aforementioned issue, just to prove it's our case. We're running builds on the Jenkins server which cleans up the workspace, so the reproduction will be the same, as running the build for the 1st time.

  1. Create clean project;
  2. Import the plugin;
  3. Configure the plugin;
  4. Add some test crashing code;
  5. Build for iOS;
  6. Check that reports are missing.

The build will work the second time, as the AppCenterStarter.m will already be present before the build is initiated.

image
Build settings won't make much sense, as we have a build script triggering the pipeline.

Here's a screen of the missing file in the generated xcode project:
image

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.