Giter Site home page Giter Site logo

Build Errors for Android Unity "D8: Program type already present: com.microsoft.appcenter.analytics.Analytics" about appcenter-sdk-unity HOT 10 CLOSED

microsoft avatar microsoft commented on May 18, 2024
Build Errors for Android Unity "D8: Program type already present: com.microsoft.appcenter.analytics.Analytics"

from appcenter-sdk-unity.

Comments (10)

olmisa avatar olmisa commented on May 18, 2024 2

@MugOfPaul I was able to reproduce the issue. I have found the following interesting thing Azure/azure-spatial-anchors-samples#31 . 'Azure Spatial Anchors' has a dependency on 'AppCenter.Analytics'. That is why the error appears. I have found that 'mainTemplate.gradle' file was added by 'Azure Spatial Anchors' to the 'Assets/Plugins/Android' folder. In this file, I have found the following code

Screenshot 2019-11-27 at 00 49 22

I have added a new excluded group ('com.microsoft.appcenter')

Screenshot 2019-11-27 at 00 53 09

After that, I was able to build my test project. Maybe it solves your problem.

from appcenter-sdk-unity.

MugOfPaul avatar MugOfPaul commented on May 18, 2024 1

@olmisa That did the trick! I am now able to build Android with the Distribute SDK installed.

I would have never figured that out. Thank you so much for your effort. I'm excited to be able to use App Center to share iOS and Android Unity AR apps.

from appcenter-sdk-unity.

Jamminroot avatar Jamminroot commented on May 18, 2024

Hey, @MugOfPaul, thanks for bringing this to our sight. What's your Unity version?

from appcenter-sdk-unity.

Jamminroot avatar Jamminroot commented on May 18, 2024

Also, is there a chance to have a look at gargle file you get, and know the gradle version you are using?
Can I also have a look at project structure - to make sure there are no duplicates
And just to make sure - have you tried to remove AC, clean project, and re-implement SDK? Seems like one of aars got stuck somewhere.

from appcenter-sdk-unity.

MugOfPaul avatar MugOfPaul commented on May 18, 2024

Unity 2019.2.11f1

I should mention I had this problem with just Distribute installed as well. When I upgraded to 2.5.1 to try and resolve the issue, I went ahead and turned on Analytics and Crashes. I couldn't find a distinct Gradle log but I'm attaching the full Editor log which shows the Gradle output.

image

image

Editor.log

from appcenter-sdk-unity.

russelarms avatar russelarms commented on May 18, 2024

Hi, it seems to be an error with code duplication, could you try solutions from this thread?

from appcenter-sdk-unity.

MugOfPaul avatar MugOfPaul commented on May 18, 2024

Hi @russelarms as far as I could tell, the solution there was to delete the contents of the Library directory which did not help.

Given the error is D8: Program type already present: com.microsoft.appcenter.analytics.Analytics$10 Is there anything wrong with this jar set up? I suppose I could try a full removal of App Center and try again.

image

from appcenter-sdk-unity.

MugOfPaul avatar MugOfPaul commented on May 18, 2024

An update: I removed the SDK via the Editor Extension and the Android project builds succesfully. Re-installing 2.5.1 (all packages) and the error comes back. I removed all of the packages except Distribute and the error remained.

As an aside, the Editor extension is very well done but you are generating quite a few "Coroutiner" objects in the Scene. I would recommend hiding them from the hierarchy.

from appcenter-sdk-unity.

russelarms avatar russelarms commented on May 18, 2024

@MugOfPaul could you try to build this sample:
https://github.com/olmisa/AndroidBuildSample
Do you have the same problem?

As an aside, the Editor extension is very well done but you are generating quite a few "Coroutiner" objects in the Scene. I would recommend hiding them from the hierarchy.

Thanks for pointing this out, I'll discuss it with the team.

from appcenter-sdk-unity.

MugOfPaul avatar MugOfPaul commented on May 18, 2024

@russelarms That project built with no issues – using the same instance and version of Unity that is causing issues in my own project.

from appcenter-sdk-unity.

Related Issues (20)

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.