What are the ramifications of non-final resource IDs in Android Gradle Plugin version 5.0 for Android Annotations? - android-annotations

Android Annotations relies heavily on resource IDs as annotation attributes. With each such attribute in code, the latest Android Studio issues a warning saying "Resource IDs will be non-final in Android Gradle Plugin version 5.0, avoid using them as annotation attributes". I know that ButterKnife worked around the problem by generating R2.java that consists all resource IDs from R.java declared as final. What's the suggested solution for Android Annotations?

Related

The current .NET SDK does not support targeting .NET Core 2.1.3

I want to make sure that my application is built against .NET Core 2.1.3, so I installed version 2.1.401 of the SDK and set the TargetFrameworkVersion of the project to 2.1.3.
This gives me the following error message (emphasis mine):
C:\Program Files\dotnet\sdk\2.1.401\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(137,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 2.1.3. Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 2.1.3.
So the interesting thing is that the build seems to use the freshly installed SDK (2.1.401) - which is supposed to support .NET Core 2.1.3 - but it is still complaining that .NET Core 2.1.3 is not supported. This doesn't make sense to me...
What could be wrong here?
(For my answer I will assume that you're building a framework-dependent application and not a self-contained application.)
You cannot set 2.1.3 directly as the <TargetFramework> in the .csproj because it's just the patch version that's different.
Only the following entries are allowed: https://learn.microsoft.com/en-us/dotnet/standard/frameworks
So in your case the .csproj needs to have <TargetFramework>netcoreapp2.1</TargetFramework>.
But as Damir pointed out in the comment, you can force the version if you also add <RuntimeFrameworkVersion>2.1.3</RuntimeFrameworkVersion> to the <PropertyGroup>.
You can check the effect of this change if you open the "Manage NuGet Packages" dialog and look at the version of the metapackage Microsoft.NETCore.App that is implicitly being used.
Without the <RuntimeFrameworkVersion> it's 2.1.0, otherwise it should be 2.1.3.
But aside from that there are sometimes other factors as well that will implicitly determine the version that's being used.
For example, if you want to build a self-contained application you have to specify the <RuntimeIdentifier> which will also force the framework version to 2.1.3 because it will publish the highest patch runtime on your machine automatically.
That said, I wouldn't recommend to set any <RuntimeFrameworkVersion> manually for the most part.
Starting with .NET Core 2.1 all framework-dependent applications (that are built using .NET Core 2.0 or later) will automatically roll forward to the latest minor version that is installed if the original version of the runtime isn't present on the system.
So if you only have .NET Core 2.1.3 installed on the target system, your framework-dependent .NET Core 2.1.0 application will automatically use that runtime and framework.
You can read a bit more about the .NET Core version selection mechanism here.
I had the same issue and and was at the time using visual studio 2017 and had latest .net sdk installed(which at time of the post 2.2.401). Installing sdk 2.2.107 and adding it to the global.json file (I have it my project root) solved
the problem for me.
{
"sdk": {
"version": "2.2.107"
}
}
Also see this related post on the visual studio developer community forum.

Xamarin Android use “Bundle assemblies into native code” and "obfuscation"

I am trying to combine obfuscating my xamarin android project and then bundle the assemblies into native code with the Visuals Studio 2017 Pro option.
I was able to obfuscate my assemblies with this tutorial https://blog.noser.com/xamarin-android-code-obfuscation/
Unfortunately the obfuscated assemblies does not find its way into the native bundle.
Likely i intercepted the build proccess at the wrong place.
<Target Name="Obfuscate" AfterTargets="_CopyIntermediateAssemblies" Condition="'$(Configuration)' == 'Release'">
Does anyone know how to merge the obfuscated assemblies into the native bundle? Thx for help in advance.
I help develop another .NET obfuscation/protection tool, Dotfuscator.
We've written a Xamarin build integration that automatically handles protection as part of the normal build process, so you don't have to manually write your own MSBuild targets or copy files around.
The official Xamarin docs recommend using Dotfuscator to protect Android builds, but this integration also works for iOS and UWP.
As Dotfuscator's Community Edition is included in Visual Studio, you can try this integration out for free.
I wrote a guest post for the Xamarin Blog that explains how to do this.
Edit regarding the setting in the question: I did some limited testing and Dotfuscator works fine with the "Bundle assemblies into native code" setting. I installed the latest version of Visual Studio 2017 Enterprise, version 15.7.2, but found out that version has a bug related to this setting. To work around it, I used the unofficial VSIX install mentioned at that link. Then I opened a Dotfuscator-Xamarin sample app and enabled the native code setting. I also added code to the sample to show the name of a class used by the application. Then I deployed the app to an emulator. The app ran normally and the logging statement showed an obfuscated name for the class, indicating that Dotfuscator correctly protected the app before it was bundled into native code.

Are the controls needed to create Team Explorer extensions available via NuGet?

As of the VS 2015 SDK, they seem to have switched to NuGet as the source of the SDK reference assemblies, in order to make extension solutions more portable (i.e. developers don't need the whole SDK installed to work on extensions). However, I'm attempting to build a Team Explorer extension, which, according to the only tutorial I could find on the subject, requires objects from the Microsoft.TeamFoundation.Controls assembly. Is there some version of this available from NuGet, so I can continue to avoid referencing the Reference Assemblies directly?
Yes, there is one. You need to run the command: Install-Package Microsoft.TeamFoundation.ReferenceAssemblies . Check this.
You can also install it via Package Manager, see:
However, as you checked, there is only 12.0 version, no 14.0 version available.

Location of Resharper SDK project template and samples

I am trying to write a plugin for Resharper 8.1. The online SDK documentation makes reference to a Visual Studio project template and list of sample projects. I cannot seem to locate them. They are not downloaded as part of the Resharper 8.1 SDK NuGet package, and although I have found several links that claim to take you to the download page for the Resharper SDK, they only take you here:
https://www.jetbrains.com/resharper/download/
This has a link to the Resharper SDK on this page, but that only takes you to the NuGet repository (and once again the NuGet package does not appear to contain the project templates or samples).
You can download the old 8.x SDKs from this site. The SDKs include the old samples projects.
I haven't updated the samples to 9.0 yet - they'll be uploaded to JetBrains' GitHub page once I've done it.

Code Analysis with FXCop (issue after upgrading to 4.5)

I am using static code analysis and have my own custom rules.
Recently I migrated the project to VS2013 and after that when I am running the build from Team City its throwing the error saying it cannot load the ruleset...
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information
what could be the reason, also how can I tell the project to use the latest version of FXCOP?
Regards
Amal Thomas

Resources