Unity (Android Studio) duplicate entry error - c#

After I export my Unity project to Android Studio I cannot create release build (but it works perfectly for debug build)
I have next error:
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':transformClassesWithJarMergingForRelease'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: io/fabric/unity/android/BuildConfig.class
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
It caused by this two lines in my build.gradle file:
compile project(':fabric-init')
compile project(':fabric')
So, if I comment one of them it works good, but I need both of them
in 'fabric' I have io/fabric/unity/android package name
in 'fabric-init' I have io/fabric/sdk/android package name
So, package names are different.
So why I have an error when using both? Can someone help me, please?

I got the same problem and when I add "minSdkVersion 19" to build.gradle it worked for me, but this means %73.9 of Android devices can run the app.
android {
defaultConfig {
minSdkVersion 19
targetSdkVersion 25
multiDexEnabled true
}
}

Related

DLLExport 'NSBin.bat' is not recognized as an internal or external command

I was trying to move a build to a new build server and I was getting the following error:
..\packages\DllExport.1.5.2\tools\net.r_eg.DllExport.targets(70,7): error MSB3073: The command "NSBin.bat "" "SPDbUtil" "true"" exited with code 9009.
'NSBin.bat' is not recognized as an internal or external command, (TaskId:52)
The project has a reference to the following DllExport:
In looking at the following .targets file, it appears when running the Exec command the $(DllExportMetaLibFullPath), where the NSBin.bat file lives, is blank at the time it is called:
When I checked out the project and try and build it, it fails the first time and succeeds on consecutive builds.
If I add "echo $(DllExportMetaLibFullPath)" to the <PreBuildEvent> of the project- it builds successfully the first time.
Does anyone know why this happens? Am I missing something? BTW: this is an older project that I was trying to move to a new build system. The previous builds were completing because the build defs "Clean" option was "false". I can keep the echo in there but would be nice to know the correct way to handle this or have a definitive answer for the devs.
Thanks

Error Metadata file dll could not be found CSC when publishing

I have a Visual studio solution with several projects in it, specifically a DotNet5 asp.net app, that has several netstandard 2.0 references on it. it builds and runs fine in the debugger but continuously throws the metadata errors. It keeps specifically referencing its looking for a net5 folder in the netstandard2 project. I cannot find where its getting this from, the problematic one used to be a multitargeted project against framework 4.7, 4.8, and net5.0, but i got annoyed with the multiple dll's and just migrated it to standard2.0 and had no issues till i want to publish it.
I've tried what a few other questions referenced, cleaning, rebuilding, remove and re add references to other projects, deleted the obj and bin folders out of the solution, the removing the sou file, tried VS 2019 (16.9.0 preview 2) preview vs 2019 (16.8.3) release, different computer (pulled back down from a lan git repository) and got the same error.... also tried searching the entire solution for references to net5.0 and didn't find it outside of the expected locations like the csproj for the asp.net project and its respective pubxml. And just for fun, I temporarily retargeted the library project back to net5.0 and it still threw the same error even when the exact file and path listed did exist.
Using enters for the error below for the different columns in the error message, and removed the "sensitive" info. There is no error code provided by Visual Studio. Anyone else got any more ideas on what to try?
Error
Metadata file 'C:\Users\UserName\source\repos\Solution\Project 2\bin\Release\net5.0\ref\Project 2.dll' could not be found.
Project 1
CSC
0
Edit: adding a couple other sections of the error messages:
1/2/2021 7:38:55 PM
System.AggregateException: One or more errors occurred. ---> Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed. Check the Output window for more details.
--- End of inner exception stack trace ---
---> (Inner Exception #0) Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed. Check the Output window for more details.<---
Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed. Check the Output window for more details.
===================
And the end of the output window since full thing is a bit too long. still can't figure out where its getting the net5.0 for the one project reference
/reference:C:\Users\UserName\.nuget\packages\system.xml.xpath.xmldocument\4.0.1\ref\netstandard1.3\System.Xml.XPath.XmlDocument.dll /reference:C:\Users\UserName\.nuget\packages\mysql.data\8.0.22\lib\net5.0\Ubiety.Dns.Core.dll /reference:"C:\Users\UserName\source\repos\CheckNotes\Project 3\bin\Release\netstandard2.0\Project 3.dll" /reference:"C:\Users\UserName\source\repos\CheckNotes\Project 2\bin\Release\net5.0\ref\Project 2.dll" /reference:C:\Users\UserName\source\repos\CheckNotes\Project 4\bin\Release\netstandard2.0\Project 4.dll /reference:"C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\5.0.0\ref\net5.0\WindowsBase.dll" /reference:C:\Users\UserName\.nuget\packages\mysql.data\8.0.22\lib\net5.0\Zstandard.Net.dll /debug+ /debug:portable /filealign:512 /optimize+ /out:"obj\Release\net5.0\CheckNotes Web - Core.dll" /refout:"obj\Release\net5.0\ref\CheckNotes Web - Core.dll" /target:exe /warnaserror- /utf8output /deterministic+ /langversion:9.0 /analyzerconfig:"obj\Release\net5.0\CheckNotes Web - Core.GeneratedMSBuildEditorConfig.editorconfig" /analyzerconfig:"C:\Program Files\dotnet\sdk\5.0.200-preview.20601.7\Sdks\Microsoft.NET.Sdk\analyzers\build\config\AnalysisLevel_5_Default.editorconfig" /analyzer:"C:\Program Files\dotnet\sdk\5.0.200-preview.20601.7\Sdks\Microsoft.NET.Sdk.Web\analyzers\cs\Microsoft.AspNetCore.Analyzers.dll" /analyzer:"C:\Program Files\dotnet\sdk\5.0.200-preview.20601.7\Sdks\Microsoft.NET.Sdk.Web\analyzers\cs\Microsoft.AspNetCore.Mvc.Analyzers.dll" /analyzer:"C:\Program Files\dotnet\sdk\5.0.200-preview.20601.7\Sdks\Microsoft.NET.Sdk.Web\analyzers\cs\Microsoft.AspNetCore.Components.Analyzers.dll" /analyzer:"C:\Program Files\dotnet\sdk\5.0.200-preview.20601.7\Sdks\Microsoft.NET.Sdk\targets\..\analyzers\Microsoft.CodeAnalysis.CSharp.NetAnalyzers.dll" /analyzer:"C:\Program Files\dotnet\sdk\5.0.200-preview.20601.7\Sdks\Microsoft.NET.Sdk\targets\..\analyzers\Microsoft.CodeAnalysis.NetAnalyzers.dll" Controllers\AssemblyController.cs Controllers\CheckNotesController.cs Controllers\ContactsController.cs Controllers\CustomerController.cs Controllers\HomeController.cs Controllers\ImageController.cs Controllers\OperatorPagesController.cs Controllers\PalletsController.cs Controllers\SharedController.cs Controllers\StatisticsController.cs Models\ControllerClass\ctrlrAssembly.cs Models\ControllerClass\CtrlrCheckNotes.cs Models\ControllerClass\ctrlrContacts.cs Models\ControllerClass\CtrlrCustomer.cs Models\ControllerClass\CtrlrOperatorPages.cs Models\ControllerClass\CtrlrPallet.cs Models\ControllerClass\ctrlrStats.cs Models\DataClass\AppSettings.cs Models\ErrorViewModel.cs Models\renderAction.cs Program.cs Startup.cs "obj\Release\net5.0\.NETCoreApp,Version=v5.0.AssemblyAttributes.cs" "obj\Release\net5.0\CheckNotes Web - Core.AssemblyInfo.cs" "obj\Release\net5.0\CheckNotes Web - Core.RazorAssemblyInfo.cs" /warnaserror+:NU1605
CSC(0,0): Error CS0006: Metadata file 'C:\Users\UserName\source\repos\CheckNotes\Project 2\bin\Release\net5.0\ref\Project 2.dll' could not be found
10>Build failed. Check the Output window for more details.
========== Build: 9 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========
Got it to publish but I am so confused....something to do with the publish profile. If i delete that and generate a new one, works fine. as soon as i edit it using the GUI, broken....generate it again. So far seems ok to edit it manually but TBD. not sure if the "fix" will survive restarting Visual studio or not.
Edit - Scratch that, found the difference.
Remove the following line in Properties/FolderProfile.pubxml and it's fine.
<TargetFramework>net5.0</TargetFramework>

MdilXapCompile.exe failed with error code 2001

Release/Debug ARM deploy to device isn't possible. But the build succeeds.
I get following exception:
Severity Code Description Project File Line Error Error : DEP6810 :
MdilXapCompile.exe failed with error code 2001. See log file
'C:\Users..\obj\ARM\Debug\MDIL\MDILXapCompileLog.txt' for more
details.
MDILXapCompileLog.txt:
CrossGen failed Error processing assembly
C:\Users...\obj\ARM\Debug\MSIL\Microsoft.Band.dll Raw error code:
2148733978
Google lead me to following solution:
Close Visual Studio
Navigate to YourSolution/Packages/
Delete everything except packages.config
Reopen the solution in Visual Studio
Right click on solution and select "Manage Nuget Packages"
Click the "Restore" button that appears at the top of the dialog
window
Doesn't work for me. Any other suggestions?
Thanks in advance
If WP 8.1, uninstall the app and run deploy, it worked for me.
When you deploy the Device make sure to select Debug instead of Release. If you set to Release the app will not be deployed and the above error will occur.
Select Debug and set the deployment destination as Device. Unlock the phone and run. It will work.

Upgrading wp8 to wp8.1 silverlight, debugger cannot be launched

I have now had an error with VS2013 and WP8.1 silverlight for a couple of days.
I get a couple of different errors, ..Ensure unlocked screen.., AgHost.exe could not be launched, port is in use by another program and ensure the device is unlocked.
These errors came suddenly after I retarged the solution. I have no compiling errors.
Solution Attempts
Restart PC
Restart program
unregister and reregister the phone
reinstall Update 3
reinstall VS2013
Windows Phone 8 Application crash once its launched AgHost.exe' has exited with code -532265403
Install VS2015 with no luck.
reinstall VS2013 Update 4
Nothing worked. The error is also the same for emulator as well as different devices. I can however get the release mode installed. Break points can be used when using release mode, but I have to Clean, Rebuild and then deploy for every time I want to deploy the application. Further the deploy time has gone up exponentially. Before upgrading I used a maximum of 10 seconds. Now it is above a minute in wait time. :/
Anyone has a solution for this ?
Extra
If I run the solution before upgrade on device or Emulator It spins up with debugger. If then go to the updated WP81, I get a popup with info Something is taking longer then normal and then it crashes with ..Ensure unlocked screen.. :/
Could it be an issue with the differen SDKS?
During a repair of all the SDKs, I found an issue with the event log, which I cleared based on The Event Log File is full
Still no success.
Extra
I cannot spin up the emulator from VS2013, when using the WP8.1 solution, but the wp8.0 solution in the same VS works :S
I found an error in a log file, from:
The errors are:
[0F08:14A8][2015-07-23T09:11:44]: Applying execute package: silverlight5_DRT, action: Repair, path: C:\ProgramData\Package Cache\DEB5078B60B74431E2830831EB48DF129CB32932\packages\Silverlight\5.0_DRT\Silverlight_Developer.exe, arguments: '"C:\ProgramData\Package Cache\DEB5078B60B74431E2830831EB48DF129CB32932\packages\Silverlight\5.0_DRT\Silverlight_Developer.exe" /q /ignorewarnings'
[0F08:14A8][2015-07-23T09:11:45]: Error 0x800705de: Process returned error: 0x5de
[0F08:14A8][2015-07-23T09:11:45]: Error 0x800705de: Failed to execute EXE package.
[0550:0E74][2015-07-23T09:11:45]: Error 0x800705de: Failed to configure per-machine EXE package.
[0550:0E74][2015-07-23T09:11:45]: MUX: Installation size in bytes for package: silverlight5_DRT MaxAppDrive: 0 MaxSysDrive: 0 AppDrive: 0 SysDrive: 0
AND
[0F08:14A8][2015-07-23T09:16:16]: Applying execute package:
{312d9252-c71c-4c84-b171-f4ad46e22098}, action: Repair, path:
C:\ProgramData\Package
Cache{312d9252-c71c-4c84-b171-f4ad46e22098}\VS2012.4.exe, arguments:
'"C:\ProgramData\Package
Cache{312d9252-c71c-4c84-b171-f4ad46e22098}\VS2012.4.exe" -repair
-quiet -burn.related.patch' [0F08:14A8][2015-07-23T09:16:23]: Error 0x80048bc7: Process returned error: 0x80048bc7
[0F08:14A8][2015-07-23T09:16:23]: Error 0x80048bc7: Failed to execute
EXE package. [0550:0E74][2015-07-23T09:16:23]: Error 0x80048bc7:
Failed to configure per-machine EXE package.
Anybody knows what to do with this? The error is coming when I repair Windows Phone SDK 8.0
There was a post-VS2013 update for the Windows Phone 8.1 SDK, some odds that you don't have it installed since you did not need it before. The download location is here.
Getting error messages like "port is in use" when there's no obvious reason why it should be in use and seeing excessive download times is also a very strong selector for your installed anti-malware product getting in the way. No specific advice on how to configure it when we don't know what it might be. You definitely first want to try to temporarily disable it so you can identify it as the source of the problem.
I have no Idea of what is the issue, but creating a new solution and importing the existing projects into a new solution has solved all the issues regarding emulator and debugger an AgHost.
Seems like the upgrade function integrated in the solution did not work properly.

exclude project from solution when running sonar-runner

I have installed and configured SonarQube 3.7.1 and sonar-runner 2.3.
While trying to run sonar-runner on a c# solution I got the error:
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Error occured while reading Visual Studio files.
ERROR: Caused by: Error while processing the project C:\root\MPS\MPA\Main\Source\MPA.Build\MPA.Build.csproj : assemblyName not defined
My sonar-project.properties looks like
sonar.projectKey=CompanyName:MPA.Android
sonar.projectName=MPA
sonar.projectVersion=1.0
sonar.sources=.
sonar.language=cs
sonar.sourceEncoding=UTF-8
\#sonar.dotnet.key.generation.strategy=safe
sonar.dotnet.visualstudio.solution.file=MPA.sln
sonar.skippedModules=MPA.Build
I would like to exclude the project MPA.Build. But it's not working.
In the MPA.sln file the MPA.Build project is defined as
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MPA.Build", "MPA.Build\MPA.Build.csproj", "{A8B400F6-A5C5-4843-96CA-92B25A2E6483}"
EndProject
Anyone knows how to solve this error?
when running sonar-runner -X the output is:
ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
at org.sonar.runner.api.Runner.execute(Runner.java:90)
at org.sonar.runner.Main.executeTask(Main.java:70)
at org.sonar.runner.Main.execute(Main.java:59)
at org.sonar.runner.Main.main(Main.java:41) Caused by: org.sonar.api.utils.SonarException: Error occured while reading Visual
Studio files.
at org.sonar.plugins.dotnet.core.VisualStudioProjectBuilder.createVisualStudioSolution(VisualStudioProjectBuilder.java:190)
at org.sonar.plugins.dotnet.core.VisualStudioProjectBuilder.build(VisualStudioProjectBuilder.java:82)
at org.sonar.api.batch.bootstrap.ProjectBuilder.build(ProjectBuilder.java:67)
at org.sonar.batch.scan.ProjectReactorReady.start(ProjectReactorReady.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110)
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89)
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
at org.picocontainer.behaviors.Stored.start(Stored.java:110)
at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1015)
at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1008)
at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:766)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:91)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:57)
at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:45)
at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:82)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.bootstrap.BootstrapContainer.executeTask(BootstrapContainer.java:156)
at org.sonar.batch.bootstrap.BootstrapContainer.doAfterStart(BootstrapContainer.java:144)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.bootstrapper.Batch.startBatch(Batch.java:92)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:74)
at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
... 9 more Caused by: org.sonar.plugins.dotnet.api.DotNetException: Error while processing
the project C:\root\MPS\MPA\Main\Source\MPA.Build\MPA.Build.csproj :
assemblyName not defined
at org.sonar.plugins.dotnet.api.microsoft.ModelFactory.getProject(ModelFactory.java:364)
at org.sonar.plugins.dotnet.api.microsoft.ModelFactory.getProjects(ModelFactory.java:274)
at org.sonar.plugins.dotnet.api.microsoft.ModelFactory.getSolution(ModelFactory.java:198)
at org.sonar.plugins.dotnet.core.VisualStudioProjectBuilder.createVisualStudioSolution(VisualStudioProjectBuilder.java:185)
... 44 more
"assemblyName not defined" => You just have to fix the MPA.Build.csproj file that is not correct because tag "AssemblyName" is missing. See https://github.com/SonarSource/sonar-examples/blob/master/projects/languages/csharp/Example.Core/Example.Core.csproj for example.
The properties file syntax you have appears to be correct. When you run sonar-runner, you should see lines like this close to the beginning of the run:
INFO - Apply project exclusions
INFO - Exclude project: MPA.Build [SomePrefix:MPA.Build]
If you don't, I would suggest running sonar-runner with the -X argument, which will print debug statements to the console. (You'll likely want to redirect/capture the console to a log file.) This may present some additional information that could help understand why it's not seeing your exclusion.
Also, in the SonarQube web UI, while looking at the project, click the "Components" link in the left-hand navigation bar. This will list the "models" for the solution. Double-check that the name showing in this view matches MBA.Build.
I face the same issu today with sonarqube 5.0.
I tried the "sonar.skippedModules" but this is deprecated now.
Instead, you have to use the following expression provided by the visual studio bootstraper :
sonar.visualstudio.skippedProjectPattern =

Categories