Sharpie pod bind: unable to parse target sdk - c#

I am creating an Appletvos project in c# using Xamarin and I need to use the VLCKit library, I tried using cocoapod and sharpie to create this project but I Have an error on the
sharpie pod bind
it correctly create a build directory with the file of my VLCKit but after it say
Check dependencies
** BUILD SUCCEEDED **
error: unable to parse target SDK from platform in Podfile
I don't understand since the command
pod install
worked correctly.
this is my podfile:
install! 'cocoapods', :integrate_targets => false
target 'ObjectiveSharpieIntegration' do
platform :tvos, '11.2'
use_frameworks!
pod 'TVVLCKit-unstable', '3.0.0a50'
end
this Is how my terminal look like
Berthiers-MacBook-Air:project berthierhadrien$ pod install
Analyzing dependencies
Downloading dependencies
Installing TVVLCKit-unstable (3.0.0a24)
Generating Pods project
Skipping User Project Integration
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.
Berthiers-MacBook-Air:project berthierhadrien$ sharpie pod bind VLC_Binder
User defaults from command line:
IDEDerivedDataPathOverride = /Users/berthierhadrien/project/Pods/sharpie-build
=== BUILD TARGET Pods-ObjectiveSharpieIntegration OF PROJECT Pods WITH CONFIGURATION Release ===
Check dependencies
Write auxiliary files
write-file /Users/berthierhadrien/project/build/Pods.build/Release-appletvos/Pods-ObjectiveSharpieIntegration.build/Pods-ObjectiveSharpieIntegration-all-non-framework-target-headers.hmap
write-file /Users/berthierhadrien/project/build/Pods.build/Release-appletvos/Pods-ObjectiveSharpieIntegration.build/Pods-ObjectiveSharpieIntegration.hmap
write-file /Users/berthierhadrien/project/build/Pods.build/Release-appletvos/Pods-ObjectiveSharpieIntegration.build/Pods-ObjectiveSharpieIntegration-project-headers.hmap
write-file /Users/berthierhadrien/project/build/Pods.build/Release-appletvos/Pods-ObjectiveSharpieIntegration.build/Pods-ObjectiveSharpieIntegration-generated-files.hmap
write-file /Users/berthierhadrien/project/build/Pods.build/Release-appletvos/Pods-ObjectiveSharpieIntegration.build/Pods-ObjectiveSharpieIntegration-own-target-headers.hmap
write-file /Users/berthierhadrien/project/build/Pods.build/Release-appletvos/Pods-ObjectiveSharpieIntegration.build/Pods-ObjectiveSharpieIntegration-all-target-headers.hmap
/bin/mkdir -p /Users/berthierhadrien/project/build/Pods.build/Release-appletvos/Pods-ObjectiveSharpieIntegration.build/Objects-normal/arm64
write-file /Users/berthierhadrien/project/build/Pods.build/Release-appletvos/Pods-ObjectiveSharpieIntegration.build/Objects-normal/arm64/Pods-ObjectiveSharpieIntegration.LinkFileList
CompileC /Users/berthierhadrien/project/build/Pods.build/Release-appletvos/Pods-ObjectiveSharpieIntegration.build/Objects-normal/arm64/Pods-ObjectiveSharpieIntegration-dummy.o Target\ Support\ Files/Pods-ObjectiveSharpieIntegration/Pods-ObjectiveSharpieIntegration-dummy.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/berthierhadrien/project/Pods
export LANG=en_US.US-ASCII
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/GDAL.framework/Programs"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch arm64 -fmessage-length=137 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -fcolor-diagnostics -std=gnu11 -fobjc-arc -fmodules -fmodules-cache-path=/Users/berthierhadrien/project/Pods/sharpie-build/ModuleCache -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/Users/berthierhadrien/project/Pods/sharpie-build/ModuleCache/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -Os -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wdocumentation -Wunreachable-code -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DPOD_CONFIGURATION_RELEASE=1 -DCOCOAPODS=1 -DNS_BLOCK_ASSERTIONS=1 -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS11.2.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -mtvos-version-min=11.2 -g -Wno-sign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wunguarded-availability -fembed-bitcode-marker -iquote /Users/berthierhadrien/project/build/Pods.build/Release-appletvos/Pods-ObjectiveSharpieIntegration.build/Pods-ObjectiveSharpieIntegration-generated-files.hmap -I/Users/berthierhadrien/project/build/Pods.build/Release-appletvos/Pods-ObjectiveSharpieIntegration.build/Pods-ObjectiveSharpieIntegration-own-target-headers.hmap -I/Users/berthierhadrien/project/build/Pods.build/Release-appletvos/Pods-ObjectiveSharpieIntegration.build/Pods-ObjectiveSharpieIntegration-all-target-headers.hmap -iquote /Users/berthierhadrien/project/build/Pods.build/Release-appletvos/Pods-ObjectiveSharpieIntegration.build/Pods-ObjectiveSharpieIntegration-project-headers.hmap -I/Users/berthierhadrien/project/build/Release-appletvos/include -I/Users/berthierhadrien/project/Pods/Headers/Public -I/Users/berthierhadrien/project/Pods/Headers/Public/TVVLCKit-unstable -I/Users/berthierhadrien/project/build/Pods.build/Release-appletvos/Pods-ObjectiveSharpieIntegration.build/DerivedSources/arm64 -I/Users/berthierhadrien/project/build/Pods.build/Release-appletvos/Pods-ObjectiveSharpieIntegration.build/DerivedSources -F/Users/berthierhadrien/project/build/Release-appletvos -F/Users/berthierhadrien/project/Pods/TVVLCKit-unstable/TVVLCKit-binary -isystem /Users/berthierhadrien/project/Pods/Headers/Public -isystem /Users/berthierhadrien/project/Pods/Headers/Public/TVVLCKit-unstable -MMD -MT dependencies -MF /Users/berthierhadrien/project/build/Pods.build/Release-appletvos/Pods-ObjectiveSharpieIntegration.build/Objects-normal/arm64/Pods-ObjectiveSharpieIntegration-dummy.d --serialize-diagnostics /Users/berthierhadrien/project/build/Pods.build/Release-appletvos/Pods-ObjectiveSharpieIntegration.build/Objects-normal/arm64/Pods-ObjectiveSharpieIntegration-dummy.dia -c /Users/berthierhadrien/project/Pods/Target\ Support\ Files/Pods-ObjectiveSharpieIntegration/Pods-ObjectiveSharpieIntegration-dummy.m -o /Users/berthierhadrien/project/build/Pods.build/Release-appletvos/Pods-ObjectiveSharpieIntegration.build/Objects-normal/arm64/Pods-ObjectiveSharpieIntegration-dummy.o
Libtool /Users/berthierhadrien/project/build/Release-appletvos/libPods-ObjectiveSharpieIntegration.a normal arm64
cd /Users/berthierhadrien/project/Pods
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/GDAL.framework/Programs"
export TVOS_DEPLOYMENT_TARGET=11.2
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only arm64 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS11.2.sdk -L/Users/berthierhadrien/project/build/Release-appletvos -filelist /Users/berthierhadrien/project/build/Pods.build/Release-appletvos/Pods-ObjectiveSharpieIntegration.build/Objects-normal/arm64/Pods-ObjectiveSharpieIntegration.LinkFileList -framework Foundation -o /Users/berthierhadrien/project/build/Release-appletvos/libPods-ObjectiveSharpieIntegration.a
** BUILD SUCCEEDED **
error: unable to parse target SDK from platform in Podfile
Do you know a way to fix this or how to create the bind project I need?
(also can anyone tell me if the instruction for an IOS library and TVOS library are the same I only found documentation for IOS)
(also Can I use IOS, MACOS library in TVOS project in C# using Xamarin)
Thanks

I know it's been a while, but I didn't find this until I end up with the same issue.
It took me a while to figure out, but I got it thanks to the clue of the error message.
What's happening here is Objective Sharpie trying to get a platform SDK from the Podfile.
So, following CocoaPods Syntax Reference at the end of your Podfile, just add:
platform :ios, '14.5' //14.5 or whatever
Now run again
sharpie pod bind
And if everything went good, it should output at the end
Binding...
[write] ApiDefinitions.cs
[write] StructsAndEnums.cs

Related

Blazor proj from scratch+nuget: "There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier 'browser-wasm'"

[Final update 07.12.2020 23:50 --> for everyone seeking for the anwser]
You are probably adding some nuget package which has in fields DEPENDENCIES .NET Core 3.1. For example Serilog.AspNetCore 3.4.0. In this very example you can include Serilog.AspNetCore 3.2.0 because it has in DEPENDENCIES only .NetStandard 2.0. See more explanation in #Ogglas answer.
There is not enough space on earth to ask the one and only question: "Why, o why Microsoft?":) The message is not clearly correlating issue with the solution - this is the lightest euphemism i am capable of making :)
For me, Blazor is very promising but it is still more a beta version. And not only for me. The startblazoring guys are claiming, that Blazor can be fickle sometimes. And I cannot agree more;) I am keeping finger crossed for it. But I suppose it would be a "ready product" only after .NET 6.0.
[Original Topic]
This is so frustrating :)
I hate errors, when I cannot simply interact and understood where it is coming from. I know, I am ignorant, and If I would pay more attention to "how is the blazor app created" I would understand in eye blink.
But for now it is only frustrating. What is? The error message:
Severity Code Description Project File Line Suppression State
Error NETSDK1082 There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier 'browser-wasm'. TestBlazorAppNoRuntimeError.Client C:\Program Files\dotnet\sdk\5.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets 387
Really, what can you fix here?:D Ehhhhh. I understand that .NET 5 is a "new thing". I understand Blazor is a "new thing" But really? It is really easy to "break" ;) (with a message that is saying nothing)
So what did I do?
Did I create very complicated project with hundreds of thousands of files?
No
Did I add hundreds of thousands of nuget packages.
No
All it takes is to create Blazor Webassembly app and add one nuget package to the shared (common) library (FYI: IdentityServer4 package). That is all folks. Kudos if you would now, that this package specificly is causing this issue (because i found out only by mistake):
There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier 'browser-wasm'.
Really, there is a great correlation here: between the error message and the package being added (this was sarcasm if anyone missed it:) )
So if you want to reproduce it create create "Blazor Webassembly":
I don't suppose the options chosen are making the difference. But if this is the case - you can see what option I did choose. Then just add IdentityServer4 nuget package to shared library:
https://www.nuget.org/packages/IdentityServer4/
That is all
If you are too lazy - download this project and check for yourself:
https://ufile.io/751l5wgq
I saw hundreds of SOF topics regarding this message:
There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier 'browser-wasm'.
But none of those was so easy to reproduce.
Why I am creating this topic?
Because I did try to implement (by copy-pasting to my solution) what guys did create in Blazor boilerplate here:
https://github.com/enkodellc/blazorboilerplate
At the beginning, by mistake, I've added Identity4 NuGet instead of Identity4.storage and that is why I did observe such behavior (such error) and did correlate this package with this error. When I rolled back from Identity4 to Identity4.storage everything was correct once again. But after that I did a lot of code transfer from this repository. And once I've ended, right now, everything is compiling but once again I have:
There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier 'browser-wasm'.
And it is driving me crazy. Maybe you would have some idea, how to find out WHAT is causing this error (exactly the same as previously Identity4 nuget package was causing it)
[UPDATE 06.12.2020 12:30]
The question here is more: "Why is it happening and how to locate package causing the issue" I know that I can second guess what is causing this message to appear.
I did a little investigation. This error is showing in this target:
<ResolveRuntimePackAssets FrameworkReferences="#(FrameworkReference)"
ResolvedRuntimePacks="#(ResolvedRuntimePack)"
UnavailableRuntimePacks="#(UnavailableRuntimePack)"
SatelliteResourceLanguages="$(SatelliteResourceLanguages)"
DesignTimeBuild="$(DesignTimeBuild)">
<Output TaskParameter="RuntimePackAssets" ItemName="RuntimePackAsset" />
</ResolveRuntimePackAssets>
<ItemGroup>
<ReferenceCopyLocalPaths Include="#(RuntimePackAsset)"
Condition="'$(CopyLocalLockFileAssemblies)' == 'true' and ('$(SelfContained)' == 'true' or '%(RuntimePackAsset.RuntimePackAlwaysCopyLocal)' == 'true')" />
</ItemGroup>
so I did google ResolveRuntimePackAssets and found this repo and this file:
https://github.com/dotnet/sdk/blob/release/5.0.2xx/src/Tasks/Microsoft.NET.Build.Tasks/ResolveRuntimePackAssets.cs and such code:
foreach (var unavailableRuntimePack in UnavailableRuntimePacks)
{
if (frameworkReferenceNames.Contains(unavailableRuntimePack.ItemSpec))
{
// This is a runtime pack that should be used, but wasn't available for the specified RuntimeIdentifier
// NETSDK1082: There was no runtime pack for {0} available for the specified RuntimeIdentifier '{1}'.
Log.LogError(Strings.NoRuntimePackAvailable, unavailableRuntimePack.ItemSpec,
unavailableRuntimePack.GetMetadata(MetadataKeys.RuntimeIdentifier));
}
}
Looks like the code "causing" the issue (this calls for writing down information in message about: unavailableRuntimePack.ItemSpec - it would be so much easier;))
So right now the only thing is to locate what is filling this: UnavailableRuntimePacks property. I don't see any code doing that so it have to be some reflection. I've located this code which is probably doing it:
https://github.com/dotnet/sdk/blob/release/5.0.2xx/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs
And this method:
private void ProcessRuntimeIdentifier(
string runtimeIdentifier,
KnownRuntimePack selectedRuntimePack,
string runtimePackVersion,
List<string> additionalFrameworkReferencesForRuntimePack,
HashSet<string> unrecognizedRuntimeIdentifiers,
List<ITaskItem> unavailableRuntimePacks,
List<ITaskItem> runtimePacks,
List<ITaskItem> packagesToDownload,
string isTrimmable,
bool addToPackageDownload)
{
var runtimeGraph = new RuntimeGraphCache(this).GetRuntimeGraph(RuntimeGraphPath);
var knownFrameworkReferenceRuntimePackRuntimeIdentifiers = selectedRuntimePack.RuntimePackRuntimeIdentifiers.Split(';');
string runtimePackRuntimeIdentifier = NuGetUtils.GetBestMatchingRid(
runtimeGraph,
runtimeIdentifier,
knownFrameworkReferenceRuntimePackRuntimeIdentifiers,
out bool wasInGraph);
if (runtimePackRuntimeIdentifier == null)
{
if (wasInGraph)
{
// Report this as an error later, if necessary. This is because we try to download
// all available runtime packs in case there is a transitive reference to a shared
// framework we don't directly reference. But we don't want to immediately error out
// here if a runtime pack that we might not need to reference isn't available for the
// targeted RID (e.g. Microsoft.WindowsDesktop.App for a linux RID).
var unavailableRuntimePack = new TaskItem(selectedRuntimePack.Name);
unavailableRuntimePack.SetMetadata(MetadataKeys.RuntimeIdentifier, runtimeIdentifier);
unavailableRuntimePacks.Add(unavailableRuntimePack);
}
else if (!unrecognizedRuntimeIdentifiers.Contains(runtimeIdentifier))
{
// NETSDK1083: The specified RuntimeIdentifier '{0}' is not recognized.
Log.LogError(Strings.RuntimeIdentifierNotRecognized, runtimeIdentifier);
unrecognizedRuntimeIdentifiers.Add(runtimeIdentifier);
}
}
else if (addToPackageDownload)
{
foreach (var runtimePackNamePattern in selectedRuntimePack.RuntimePackNamePatterns.Split(';'))
{
string runtimePackName = runtimePackNamePattern.Replace("**RID**", runtimePackRuntimeIdentifier);
if (runtimePacks != null)
{
TaskItem runtimePackItem = new TaskItem(runtimePackName);
runtimePackItem.SetMetadata(MetadataKeys.NuGetPackageId, runtimePackName);
runtimePackItem.SetMetadata(MetadataKeys.NuGetPackageVersion, runtimePackVersion);
runtimePackItem.SetMetadata(MetadataKeys.FrameworkName, selectedRuntimePack.Name);
runtimePackItem.SetMetadata(MetadataKeys.RuntimeIdentifier, runtimePackRuntimeIdentifier);
runtimePackItem.SetMetadata(MetadataKeys.IsTrimmable, isTrimmable);
if (selectedRuntimePack.RuntimePackAlwaysCopyLocal)
{
runtimePackItem.SetMetadata(MetadataKeys.RuntimePackAlwaysCopyLocal, "true");
}
if (additionalFrameworkReferencesForRuntimePack != null)
{
runtimePackItem.SetMetadata(MetadataKeys.AdditionalFrameworkReferences, string.Join(";", additionalFrameworkReferencesForRuntimePack));
}
runtimePacks.Add(runtimePackItem);
}
TaskItem packageToDownload = new TaskItem(runtimePackName);
packageToDownload.SetMetadata(MetadataKeys.Version, runtimePackVersion);
packagesToDownload.Add(packageToDownload);
}
}
}
After analysing it, the reason why Identity4 (for example) is causing this issue is because runtimePackRuntimeIdentifier is null and wasInGraph was true :) But what does mean, we have to dig a little bit further. The key thing here is the method GetBestMatchingRid:
public static string GetBestMatchingRid(RuntimeGraph runtimeGraph, string runtimeIdentifier,
IEnumerable<string> availableRuntimeIdentifiers, out bool wasInGraph)
{
wasInGraph = runtimeGraph.Runtimes.ContainsKey(runtimeIdentifier);
HashSet<string> availableRids = new HashSet<string>(availableRuntimeIdentifiers);
foreach (var candidateRuntimeIdentifier in runtimeGraph.ExpandRuntime(runtimeIdentifier))
{
if (availableRids.Contains(candidateRuntimeIdentifier))
{
return candidateRuntimeIdentifier;
}
}
// No compatible RID found in availableRuntimeIdentifiers
return null;
}
So here we see that runtimePackRuntimeIdentifier was null because it was not found on: availableRuntimeIdentifiers. And this variable is defined as:
var knownFrameworkReferenceRuntimePackRuntimeIdentifiers = selectedRuntimePack.RuntimePackRuntimeIdentifiers.Split(';');
So let's see how is it defined (in the code below variable runtimePackForRuntimeIDProcessing is selectedRuntimePack from the above mention)
KnownRuntimePack runtimePackForRuntimeIDProcessing;
if (knownFrameworkReference.Name.Equals(knownFrameworkReference.RuntimeFrameworkName, StringComparison.OrdinalIgnoreCase))
{
// Only add runtime packs where the framework reference name matches the RuntimeFrameworkName
// Framework references for "profiles" will use the runtime pack from the corresponding non-profile framework
runtimePackForRuntimeIDProcessing = selectedRuntimePack.Value;
includeInPackageDownload = true;
}
else if (!knownFrameworkReference.RuntimePackRuntimeIdentifiers.Equals(selectedRuntimePack?.RuntimePackRuntimeIdentifiers))
{
// If the profile has a different set of runtime identifiers than the runtime pack, use the profile.
runtimePackForRuntimeIDProcessing = knownFrameworkReference.ToKnownRuntimePack();
includeInPackageDownload = true;
}
else
{
// For the remaining profiles, don't include them in package download but add them to unavaliable if necessary.
runtimePackForRuntimeIDProcessing = knownFrameworkReference.ToKnownRuntimePack();
includeInPackageDownload = false;
}
But this is as far as I can go. I don't understand without further investigation how this selectedRuntimePack.RuntimePackRuntimeIdentifiers should be defined. This is the key thing here. Clearly for some reasons IdentityServer4 doesn't belong to selectedRuntimePack.RuntimePackRuntimeIdentifiers and this is the answer I am looking for :)
IdentityServer4 4.1.1 (latest version) is dependent upon .NETCoreApp 3.1
https://www.nuget.org/packages/IdentityServer4/
If you create a Blazor WebAssembly App using .NET Core 3.1 it will work in the Server App.
However when using .NET Core 3.1 both Client and Shared uses .NET Standard 2.1 and is therefore not compatible. These error messages are a lot clearar though:
Error Package restore failed. Rolling back package changes for
'BlazorApp.Shared'.
Error NU1202 Package IdentityServer4 4.1.1 is not compatible with
netstandard2.1 (.NETStandard,Version=v2.1). Package IdentityServer4
4.1.1 supports: netcoreapp3.1 (.NETCoreApp,Version=v3.1) BlazorApp.Shared
As I mentioned in this link, it seems there is an issue regarding to the following package. So remove the package from your project and every other project that has been referenced by your Blazor project(right-click on project, choose edit project file then remove the following):
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.0" />
In my case (and hopefully in yours too) the only use of this package was the get the constant string "Bearer" with the field member JwtBearerDefaults.AuthenticationScheme. So instead of this just simply use "Bearer" string.
I had the same issue while working on a blazor wasm/server/shared projects. In my case, I narrowed down the issue to the project sdk types:
Client.csproj:
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
Server.csproj:
<Project Sdk="Microsoft.NET.Sdk.Web">
Shared.csproj definition causing the issue:
<Project Sdk="Microsoft.NET.Sdk.Razor">
Shared.csproj definition without issue:
<Project Sdk="Microsoft.NET.Sdk">
The client wasm project did not like that the shared one was declared as Microsoft.NET.Sdk.Razor and had to change it to Microsoft.NET.Sdk in order to get rid of the error in the title.
I still need to dig further in to better understand the full differences between those two project types but I hope this can help anyone else facing this issue.

Unity gradle build failed to transform aar

Unity gradle build fail with error. How can i fix it?
I use
android.useAndroidX = true
android.enableJetifier = true
Build fail with error:
Failed to transform '...\Temp\gradleOut\libs\com.android.support.support-v4-26.1.0.aar' using Jetifier. Reason: The given artifact contains a string literal with a package reference 'android.support.v4' that cannot be safely rewritten. Libraries using reflection such as annotation processors need to be updated manually to add support for androidx.. (Run with --stacktrace for more details.)
That's my dependencies:
<dependencies>
<packages>
<package>com.android.support:appcompat-v7:24.0.+</package>
<package>com.android.support:support-v4:26.1.+</package>
<package>com.google.android.gms:play-services-ads:15.0.1</package>
<package>com.google.games:gpgs-plugin-support:0.9.62</package>
<package>com.sglib.easymobile:easy-mobile:1.+</package>
</packages>
<files>
<file>Assets/Plugins/Android/android.arch.core.common-1.0.0.jar</file>
<file>Assets/Plugins/Android/android.arch.lifecycle.common-1.0.0.jar</file>
<file>Assets/Plugins/Android/android.arch.lifecycle.runtime-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.annotation.annotation-1.0.0.jar</file>
<file>Assets/Plugins/Android/androidx.arch.core.core-common-2.0.0.jar</file>
<file>Assets/Plugins/Android/androidx.arch.core.core-runtime-2.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.asynclayoutinflater.asynclayoutinflater-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.browser.browser-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.collection.collection-1.0.0.jar</file>
<file>Assets/Plugins/Android/androidx.coordinatorlayout.coordinatorlayout-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.core.core-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.cursoradapter.cursoradapter-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.customview.customview-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.documentfile.documentfile-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.drawerlayout.drawerlayout-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.fragment.fragment-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.interpolator.interpolator-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.legacy.legacy-support-core-ui-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.legacy.legacy-support-core-utils-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.lifecycle.lifecycle-common-2.0.0.jar</file>
<file>Assets/Plugins/Android/androidx.lifecycle.lifecycle-livedata-2.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.lifecycle.lifecycle-livedata-core-2.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.lifecycle.lifecycle-runtime-2.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.lifecycle.lifecycle-viewmodel-2.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.loader.loader-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.localbroadcastmanager.localbroadcastmanager-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.print.print-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.slidingpanelayout.slidingpanelayout-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.swiperefreshlayout.swiperefreshlayout-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.versionedparcelable.versionedparcelable-1.0.0.aar</file>
<file>Assets/Plugins/Android/androidx.viewpager.viewpager-1.0.0.aar</file>
<file>Assets/Plugins/Android/com.android.support.animated-vector-drawable-26.1.0.aar</file>
<file>Assets/Plugins/Android/com.android.support.appcompat-v7-26.1.0.aar</file>
<file>Assets/Plugins/Android/com.android.support.support-annotations-26.1.0.jar</file>
<file>Assets/Plugins/Android/com.android.support.support-compat-26.1.0.aar</file>
<file>Assets/Plugins/Android/com.android.support.support-core-ui-26.1.0.aar</file>
<file>Assets/Plugins/Android/com.android.support.support-core-utils-26.1.0.aar</file>
<file>Assets/Plugins/Android/com.android.support.support-fragment-26.1.0.aar</file>
<file>Assets/Plugins/Android/com.android.support.support-media-compat-26.1.0.aar</file>
<file>Assets/Plugins/Android/com.android.support.support-v4-26.1.0.aar</file>
<file>Assets/Plugins/Android/com.android.support.support-vector-drawable-26.1.0.aar</file>
<file>Assets/Plugins/Android/com.google.android.gms.play-services-ads-18.1.0.aar</file>
<file>Assets/Plugins/Android/com.google.android.gms.play-services-ads-base-18.1.0.aar</file>
<file>Assets/Plugins/Android/com.google.android.gms.play-services-ads-identifier-17.0.0.aar</file>
<file>Assets/Plugins/Android/com.google.android.gms.play-services-ads-lite-18.1.0.aar</file>
<file>Assets/Plugins/Android/com.google.android.gms.play-services-auth-16.0.1.aar</file>
<file>Assets/Plugins/Android/com.google.android.gms.play-services-auth-api-phone-16.0.0.aar</file>
<file>Assets/Plugins/Android/com.google.android.gms.play-services-auth-base-16.0.0.aar</file>
<file>Assets/Plugins/Android/com.google.android.gms.play-services-base-16.0.1.aar</file>
<file>Assets/Plugins/Android/com.google.android.gms.play-services-basement-17.0.0.aar</file>
<file>Assets/Plugins/Android/com.google.android.gms.play-services-drive-16.0.0.aar</file>
<file>Assets/Plugins/Android/com.google.android.gms.play-services-games-16.0.0.aar</file>
<file>Assets/Plugins/Android/com.google.android.gms.play-services-gass-18.1.0.aar</file>
<file>Assets/Plugins/Android/com.google.android.gms.play-services-measurement-17.0.0.aar</file>
<file>Assets/Plugins/Android/com.google.android.gms.play-services-measurement-base-17.0.0.aar</file>
<file>Assets/Plugins/Android/com.google.android.gms.play-services-measurement-impl-17.0.0.aar</file>
<file>Assets/Plugins/Android/com.google.android.gms.play-services-measurement-sdk-17.0.0.aar</file>
<file>Assets/Plugins/Android/com.google.android.gms.play-services-measurement-sdk-api-17.0.0.aar</file>
<file>Assets/Plugins/Android/com.google.android.gms.play-services-nearby-16.0.0.aar</file>
<file>Assets/Plugins/Android/com.google.android.gms.play-services-stats-17.0.0.aar</file>
<file>Assets/Plugins/Android/com.google.android.gms.play-services-tasks-16.0.1.aar</file>
<file>Assets/Plugins/Android/com.google.games.gpgs-plugin-support-0.9.62.aar</file>
<file>Assets/Plugins/Android/com.sglib.easymobile.easy-mobile-1.2.0.aar</file>
</files>
</dependencies>
I have update Google Mobile Ads Unity Plugin and problem was solved
Try using the newest SDK version in build.gradle
Ex:
compileSdkVersion 29

How to integrate the unity ios project into native ios swift project?

I've tried most of the online resources including this link too to integrate my unity project into swift 4 native project but unfortunately not helped until now. When I do Linked fix I got into below c++ file error:
No member named 'GetHostByAddr40' in 'il2cpp::icalls::System::System::Net::Dns'; did you mean 'GetHostByAddr'?
Btw I am actually doing a augmented reality project which having some native iOS designs too. Since so I've done those parts using swift 4 with Xcode 9.2. The native part contains the project's start and the end part. In between that, there is augmented reality part which is done by using unity 2018.2.0f2 personal and vofuria 7.2.23.
In the end, now I have an iOS native project and unity project. I wanted to integrate the unity part into iOS native!
After a long search, I get ride the error.
After fixing with this described solutions, I've ended up with Bulk_Mono.Security_1.cpp file not found. So I've started to search for it. Then I've got identified the problem. The problem is with 4.0 Scripting runtime version of .Net. I made the project with 4.0 because of the use of LitJson requires min 4.0. The 4.0 is not generating the Bulk_Mono.Security_1.cpp file for iOS. Then I've removed the LitJson from the project and downgraded the project runtime version to 3.x Equivalent and it started to work fine with the changes on the following 2 files.
Note that just integrate the generated objective-c project as like a framework usually then make following changes and run.
made the change following on DisplayManager.mm generated file which is located in classes/unity. The auto-generated not contains the last line of return deviceUnknown;. So we have to write manually.
elif PLATFORM_TVOS
if (!strncmp(model, "AppleTV5,", 9))
return deviceAppleTV1Gen;
else if (!strncmp(model, "AppleTV6,", 9))
return deviceAppleTV2Gen;
else
return deviceUnknown;
endif
return deviceUnknown
Do the following change on SplashScreen.mm which is located in generated project's classes/ui. Change the bool hasStoryboard = [[NSBundle mainBundle] pathForResource: #"LaunchScreen" ofType: #"storyboardc"] != nullptr; to bool hasStoryboard = [[NSBundle mainBundle] pathForResource: #"LaunchScreen_1" ofType: #"storyboardc"] != nullptr;. The complete method below.
void ShowSplashScreen(UIWindow* window)
{
bool hasStoryboard = [[NSBundle mainBundle] pathForResource: #"LaunchScreen_1" ofType: #"storyboardc"] != nullptr;
if (hasStoryboard)
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:
#"LaunchScreen" bundle: [NSBundle mainBundle]];
_controller = [storyboard
instantiateViewControllerWithIdentifier: #"unitySplashStoryboard"];
}
else
_controller = [[SplashScreenController alloc] init];
[_controller create: window];
[window makeKeyAndVisible];
}
That's all about how I integrated.

How to figure out the changeset a TFS 2015 build was build from?

I am distributing only binaries which were built by one of my TFS build definitions and each build receives a unique version number (1.0.$yy$dayofyear.$rev). The name of the build name contains this version number. The version number is set by a PowerShell script as the assembly version and the file version of the binary. I have only a build result rentention (including the built binaries in my drop folder) of 60 days and now I am wondering: How would I possibly figure out for some version number which is one year old which changeset it was built from so that I can have a look at the source code or rebuild exactly the binary? Do I have to add the changeset info somehow during my build explicitly? Do I have to encode the changeset number in my version number which is set during the build? Both ideas don't seem very ingenious.
I finally came up with a PowerShell script that I hook into my build definition as an additional build step just after a step that is similar to the one proposed here which sets the version attribute in all AssemblyInfo.cs files:
$systDefinitionId = $env:SYSTEM_DEFINITIONID
$buildDefVersion = $env:BUILD_DEFINITIONVERSION
$buildDefName = $env:BUILD_DEFINITIONNAME
$buildSourceVersion = $env:BUILD_SOURCEVERSION
$buildSourceBranch = $env:BUILD_SOURCEBRANCH
$SrcPath = $env:BUILD_SOURCESDIRECTORY
$AllVersionFiles = Get-ChildItem $SrcPath AssemblyInfo.cs -recurse
$AllVersionFilesCount = ($AllVersionFiles | Measure-Object).Count
Write-Verbose "Updating $AllVersionFilesCount AssemblyInfo.cs files in path ""$SrcPath"" with source information." -Verbose
Write-Verbose "ID of build definition: $systDefinitionId" -Verbose
Write-Verbose "Version of build definition: $buildDefVersion" -Verbose
Write-Verbose "Name of build definition: $buildDefName" -Verbose
Write-Verbose "Changeset to build: $buildSourceVersion" -Verbose
Write-Verbose "Branch to build from: $buildSourceBranch" -Verbose
foreach ($file in $AllVersionFiles)
{
(Get-Content $file.FullName) |
%{$_ -replace 'AssemblyProduct\(""\)', "AssemblyProduct(""$buildDefName / $buildSourceVersion"")" } |
%{$_ -replace 'AssemblySourceBranch\(""\)', "AssemblySourceBranch(#""$buildSourceBranch"")" } |
%{$_ -replace 'AssemblySourceChangeset\(0\)', "AssemblySourceChangeset($buildSourceVersion)" } |
%{$_ -replace 'AssemblyBuild\(""\)', "AssemblyBuild(#""$buildDefName / ID: $systDefinitionId / Version: $buildDefVersion"")" } |
Set-Content $file.FullName -Force
}
I am modifying the AssemblyProduct attribute by writing into it the build definition name and the changeset which was used to create the binaries. Later on this info is visible on the properties of the exe or dll in Windows Explorer on the details tab.
Moreover I have defined the custom attributes AssemblySourceBranch, AssemblySourceChangeset and AssemblyBuild to carry more detailed info. They all have the same structure, so for brevity only the source code of AssemblySourceChangeset:
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
public class AssemblySourceChangesetAttribute : Attribute
{
public AssemblySourceChangesetAttribute(uint changeset)
{
Changeset = changeset;
}
public uint Changeset { get; }
}
Should the info in the "publicly" visible product field not be enough to be able to rebuild the binary, one can still result to reflecting upon the exe or dll and read those custom attributes which have info on the source branch, the id and the version of the build definiton stored.
You could add a powershell script or extension task which will generate release notes as part of TFS vNext build. You will get something as below:
And then you could store it, for the source code take a look at this blog
Preface: XAML builds.
You can have visibility into all your build products by creating release/hotfix branches, and having build definitions specific to those branches. It's easy enough to clone a build to a branch, and use version numbers as part of your binary stamps. I prefer to use a branch version number approach, and stamp my binaries with that version number. As long as you're creating unique build definitions for the binaries in each branch, you'll be able to easily view past builds, and see exactly what changesets are associated with it.All you need is the binary's version number, and you'll be able to trace it back to source easily.

How can I use PowerShell to install this service fabric project?

I have the following folder structure once I package my Service Fabric NS1.NS2.MicroServicesTest project (written in C#, using .NET):
pkg
|-NS1.NS2.MicroServicesTest.MicroServiceA
|-NS1.NS2.MicroServicesTest.MicroServiceB
|-NS1.NS2.MicroServicesTest.MicroServiceC
|-NS1.NS2.MicroServicesTest.MicroServiceD
|-ApplicationManifest.xml
I am trying to deploy this package using the following PowerShell script:
Copy-ServiceFabricApplicationPackage pkg -ImageStoreConnectionString file:C:\SfDevCluster\Data\ImageStoreShare -ApplicationPackagePathInImageStore NS1.NS2.MicroServicesTest
Register-ServiceFabricApplicationType NS1.NS2.MicroServicesTest
New-ServiceFabricApplication fabric:/NS1.NS2.MicroServicesTest NS1.NS2.MicroServicesTest 1.0.0
It fails on the last command, New-ServiceFabricApplication, with the following error:
New-ServiceFabricApplication : Application type and version not found
Where have I gone wrong? I have tried to follow this tutorial, albeit it kind of uses a base case in its example, whereas my project has 4 microservices as part of it, and an odd naming convention, which makes it even more confusing...
Edit: When I run the Get-ServiceFabricApplicationType command, I see:
ApplicationTypeName : MicroServicesTestType
ApplicationTypeVersion : 1.0.0
DefaultParameters : { "MicroServiceA_InstanceCount" = "-1";
"MicroServiceB_InstanceCount" = "-1";
"MicroServiceC_Endpoint" = "defaultValue";
"MicroServiceC_InstanceCount" = "-1";
"MicroServiceC_MaxRecords" = "100";
"MicroServiceD_InstanceCount" = "-1" }
(from discussion to answer)
After registering it, validate that your Application Type shows up when calling 'Get-ServiceFabricApplicationType'
Check your Application Type version 1.0.0?
Try using this command: New-ServiceFabricApplication fabric:/ MicroServicesTestType MicroServicesTestType 1.0.0

Categories