четвер, 11 лютого 2021 р.

zipalign issue

 (_Sign target) ->
 

  /usr/lib/mono/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2457,2): error ANDZA0000: W/zip     (24714): copy of 'assemblies/Xamarin.Android.Support.Compat.dll' failed [..../Droid/App.Droid.csproj]
 

  /usr/lib/mono/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2457,2): error ANDZA0000: zipalign: failed rewriting '..../Droid/obj/Debug/android/bin/com.example.app.apk' to 'bin/Debug//com.example.app-Signed.apk' [..../Droid/CentroForms.Droid.csproj]


Solution: delete apk files and run build.sh again
cd Droid/bin/Debug
rm *.apk

P.S. Today, 2021.03.23 it works without errors (after Android SDK update).

Mono: 6.12.0.122    VS Code: 1.54.2    Android/Sdk/build-tools/29.0.2/

середа, 4 листопада 2020 р.

вівторок, 3 листопада 2020 р.

Guid should contain 32 digits with 4 dashes

Just in case: beware those "-" in the .sln file, when you have this failure in the VSCode ...


[fail]: OmniSharp.WorkspaceInitializer
        The project system 'OmniSharp.MSBuild.ProjectSystem' threw exception during initialization.
System.FormatException: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).


-        {12345678-1234-1234-1234-123456789012}.Production|Any CPU.ActiveCfg = Production|Any CPU
-        {12345678-1234-1234-1234-123456789012}.Production|Any CPU.Build.0 = Production|Any CPU
        {12345678-1234-1234-1234-123456789012}.Production|iPhone.ActiveCfg = Production|iPhone
        {12345678-1234-1234-1234-123456789012}.Production|iPhone.Build.0 = Production|iPhone


четвер, 9 липня 2020 р.

Optimize, AndroidLinkMode, big project and fast deployment

1. Set Optimize = false for Debug
otherwise I have
run-as: package not debuggable

If you have a large project and [INSTALL_FAILED_CONTAINER_ERROR]

2. Copy assemblies (dlls) to .__override__ if you need AndroidLinkMode = SdkOnly.
3. Alternatively to SdkOnly we may set AndroidUseAapt2 = true

субота, 28 грудня 2019 р.

This project is currently disabled (12.2019)

Project xamarin-android-linux
Xamarin.Android master Linux build

This project is currently disabled, because I don't see any new builds after Apr 2019
(although I see some strange new pipelines for Linux, xamarin-android-linux-pr-pipeline for example, but without artifacts).

https://jenkins.mono-project.com/view/Xamarin.Android/job/xamarin-android-linux/

Last version that I've tried: #2194 Apr 17, 2019
xamarin.android-oss_9.2.99.172.tar.xz

I've spent a lot of time but it doesn't work for me to compile and run a complex project. I don't have more time to try.

But it was possible to compile and run a simple application on an Android 4.4 device and on the emulator: template-3.1.0.637273-8.1-ns2.0 based on Xamarin.Forms 3.1

Also it has an unfixed issue for Android 4.4:
https://github.com/xamarin/xamarin-android/issues/3314
so it is necessary to insert into Debug/Release csproj section:
<AndroidAapt2LinkExtraArgs>--no-version-vectors</AndroidAapt2LinkExtraArgs>


P.S. I wasn't able to run some new templates because of this issue:https://github.com/xamarin/Xamarin.Forms/issues/7602
But it is possible to run 4.3.0.851321-pre3 based template.

P.P.S. updated fast.sh for new versions of Xamarin.Forms and Android:

ANDROID_OVERRIDE_DIR=/data/user/0/com.example.sampleresources/files/.__override__

https://github.com/igorkovalchuk/xamarin-forms-android-linux-project-templates/blob/master/template-4.3.0.851321-pre3/fast.sh

- - -

Mono JIT compiler version 6.6.0.161 (tarball Tue Dec 10 10:37:10 UTC 2019)

msbuild version 16.3.0-ci for Mono

NuGet Version: 5.2.0.6090

dotnet version 2.2.402

вівторок, 8 січня 2019 р.

build #1475

xamarin-android-linux build #1475 (Dec 6, 2018)

Debian 10
Mono JIT compiler version 5.18.0.225
Microsoft (R) Build Engine version 16.0.0.0 for Mono
NuGet Version: 4.7.0.5148
.NET Command Line Tools (2.1.502)
VSCode 1.30.1
C# extension 1.17.1

nuget issue:
The reference assemblies for framework "MonoAndroid,Version=v1.0" were not found.

solution: as usually, add TargetFrameworkRootPath to the csproj file (or add the symbolic link to the MonoAndroid folder into /usr/lib/mono/xbuild-frameworks ).

<PropertyGroup>
  <AndroidSdkDirectory>/home/.../my_sdk_dir</AndroidSdkDirectory>
  <TargetFrameworkRootPath>/usr/lib/mono/xbuild-frameworks/</TargetFrameworkRootPath>
</PropertyGroup>


Also it asks to remove "armeabi" from AndroidSupportedAbis

Then it builds TheLittleThingsPlayground project.

P.S. Monodevelop 7.7 shows all files twice in the project tree for Android, and needs a hack (Sdk tag) to remove the MonoAndroid error (there should be a normal way to do it, but I don't know how to do it today):

    <Sdk Name="Microsoft.NET.Sdk" />
<!--
    <ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
-->
    <ProjectTypeGuids>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>