xamarin / AndroidX

AndroidX bindings for .NET for Android
MIT License
186 stars 45 forks source link

Xamarin.AndroidX.Browser crashes pipeline when upgraded to 1.2.0 #78

Closed developer9969 closed 3 years ago

developer9969 commented 4 years ago

Xamarin.Android Version (eg: 6.0):

Min Version 6 - Target 10

Operating System & Version (eg: Mac OSX 10.11):

Support Libraries Version (eg: 23.3.0):

Xamarin.AndroidX.Lifecycle.LiveData" Version="2.2.0" /> Xamarin.AndroidX.Browser" Version="1.2.0" /> Xamarin.Google.Android.Material" Version="1.0.0" /> Xamarin.AndroidX.Legacy.Support.V4" Version="1.0.0" /> Xamarin.AndroidX.MediaRouter" Version="1.1.0" /> Xamarin.Forms" Version="4.5.0.396" /> Xamarin.Android.Support.Design" Version="28.0.0.3" /> Xamarin.Android.Support.v7.AppCompat" Version="28.0.0.3" /> "Xamarin.Android.Support.v4" Version="28.0.0.3" /> "Xamarin.Android.Support.v7.CardView" Version="28.0.0.3" /> "Xamarin.Android.Support.v7.MediaRouter" Version="28.0.0.3" />

Describe your Issue:

Upgraded nuget packages for AndroidX and Xamarin.AndroidX.Browser when using 1.2.0 it crashes the azure devops pipeline with an error.

Steps to Reproduce (with link to sample solution if possible):

Upgrade Xamarin.AndroidX.Browser to 1.2.0 and run a pipeline that builds an android project and you get an error that requires a min android version 8!!

Include any relevant Exception Stack traces, build logs, adb logs:

_CompileToDalvikWithDx: Creating directory "obj\Release\100\proguard". C:\Program Files\Java\zulu-8-azure-jdk_8.40.0.25-8.0.222-win_x64\bin\java.exe -Dfile.encoding=UTF8 -Xmx1G -jar "C:\Program Files (x86)\Android\android-sdk\build-tools\28.0.3\lib\dx.jar" --dex --no-strict --input-list=C:\Users\VssAdministrator\AppData\Local\Temp\tmpEAE1.tmp --output obj\Release\100\android\bin WARNING in androidx.browser.trusted.TrustedWebActivityDisplayMode.fromBundle:(Landroid/os/Bundle;)Landroidx/browser/trusted/TrustedWebActivityDisplayMode;: defining a static interface method requires --min-sdk-version >= 24 (currently 13) for interface methods: androidx.browser.trusted.TrustedWebActivityDisplayMode.fromBundle:(Landroid/os/Bundle;)Landroidx/browser/trusted/TrustedWebActivityDisplayMode;

[error]COMPILETODALVIK(0,0): Error : com.android.dx.cf.code.SimException: ERROR in androidx.browser.customtabs.CustomTabsService$1.newSessionInternal:(Landroid/support/customtabs/ICustomTabsCallback;Landroid/app/PendingIntent;)Z: invalid opcode ba - invokedynamic requires --min-sdk-version >= 26 (currently 13)

COMPILETODALVIK : Uncaught translation error : com.android.dx.cf.code.SimException: ERROR in androidx.browser.customtabs.CustomTabsService$1.newSessionInternal:(Landroid/support/customtabs/ICustomTabsCallback;Landroid/app/PendingIntent;)Z: invalid opcode ba - invokedynamic requires --min-sdk-version >= 26 (currently 13) [D:\a\1\s\src\Apps\MyProject.Android\MyProject.Android.csproj]

[error]COMPILETODALVIK(0,0): Error : com.android.dx.cf.code.SimException: ERROR in androidx.browser.trusted.ConnectionHolder.getServiceWrapper:()Lcom/google/common/util/concurrent/ListenableFuture;: invalid opcode ba - invokedynamic requires --min-sdk-version >= 26 (currently 13)

COMPILETODALVIK : Uncaught translation error : com.android.dx.cf.code.SimException: ERROR in androidx.browser.trusted.ConnectionHolder.getServiceWrapper:()Lcom/google/common/util/concurrent/ListenableFuture;: invalid opcode ba - invokedynamic requires --min-sdk-version >= 26 (currently 13) [D:\a\1\s\src\Apps\MyProject.Android\MyProject.Android.csproj] Uncaught translation error: com.android.dx.cf.code.SimException: ERROR in androidx.browser.trusted.TokenContents.createToken:(Ljava/lang/String;Ljava/util/List;)[B: invalid opcode ba - invokedynamic requires --min-sdk-version >= 26 (currently 13) Uncaught translation error: com.android.dx.cf.code.SimException: ERROR in androidx.browser.trusted.TrustedWebActivityServiceConnectionPool.connect:(Landroid/net/Uri;Ljava/util/Set;Ljava/util/concurrent/Executor;)Lcom/google/common/util/concurrent/ListenableFuture;: invalid opcode ba - invokedynamic requires --min-sdk-version >= 26 (currently 13) 4 errors; aborting

[error]C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2613,3): Error : java/lang/String;Ljava/util/List;)[B : invalid opcode ba - invokedynamic requires --min-sdk-version >= 26 (currently 13)

C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2613,3): error : java/lang/String;Ljava/util/List;)[B : invalid opcode ba - invokedynamic requires --min-sdk-version >= 26 (currently 13) [D:\a\1\s\src\Apps\MyProject.Android\MyProject.Android.csproj] Done Building Project "D:\a\1\s\src\Apps\MyProject.Android\MyProject.Android.csproj" (default targets) -- FAILED. Done Building Project "D:\a\1\s\src\Apps\MyProject.Android.sln" (default targets) -- FAILED.

thanks in advance for your prompt response

moljac commented 4 years ago

@developer9969 Thanks for the feedback.

Are we saying that Xamarin.AndroidX.Browser 1.2.0 should not be used if your min target is android ver 6 (Marshmallow)?

Well, yes (kind of). A lot of times we repeat what google says:

AndroidX browser is afaik a replacement / androidX version of Chrome Custom Tabs which had required minSdk 16, maybe this explains the sdk requirement.

https://developer.android.com/jetpack/androidx/releases/browser

https://androidx.tech/artifacts/browser/browser/1.0.0

minSdkVersion: 15

https://androidx.tech/artifacts/browser/browser/1.2.0

minSdkVersion: 16
targetSdkVersion: 28

Also i see all these androidX libraries do not follow the same convention in versioning as the old > ones , what I mean is should they all have the same version number?

Nope. Again. google.

please check versions here:

https://maven.google.com/web/index.html

I have reverted to previous version and pipeline now builds.

is "previous version" 1.0.0 (AndroidX) version or did you migrate back to Android.Support (legacy)?

developer9969 commented 4 years ago

Hi moljac, Thank you very much for your time in answering.I will keep it brief.

This is what I did

  1. Upgraded to AndroidX and added references as below suggested by Visual studio to make compile.(exception output)

    Xamarin.AndroidX.Lifecycle.LiveData" Version="2.1.0" Xamarin.AndroidX.Browser" Version="1.0.0" Xamarin.AndroidX.Legacy.Support.V4" Version="1.0.0" Xamarin.AndroidX.MediaRouter" Version="1.0.0"

  2. Build project and published to AppCenter to make sure all good.

  3. New Version of AndroidX become available and I updated nugets as follows:

    Xamarin.AndroidX.Lifecycle.LiveData" Version="2.2.0" Xamarin.AndroidX.Browser" Version="1.2.0" Xamarin.Google.Android.Material" Version="1.0.0" Xamarin.AndroidX.Legacy.Support.V4" Version="1.1.0"

  4. Now Pipeline is NOT building and complaining about Xamarin.AndroidX.Browser 1.2.0

  5. Reverted it back to Xamarin.AndroidX.Browser 1.0.0

  6. Pipeline building and all good again.

We have to support a min Version 6 with target of 10X from what I gather I cannot upgrade this version of AndroidX.Browser to the latest as is not compatible with my min target.

I guess now I have to be very careful when I upgrade any androidX nuget package.

I could not find what AndroidX.Browser 1.0.0 Min version support?

clintonrocksmith commented 4 years ago

We also encountered this problem, so we downgraded AndroidX.Browser to 1.0.0, it seems version 1.2.0 requires API>=26.

Julien-Mialon commented 4 years ago

Encountered the same issue, same workaround. But AndroidX.Browser should have a min sdk of 16 (like the provided lib by google) not 26 like it is now. (Maybe a mistype in package configuration ?)

moljac commented 4 years ago

@developer9969 @clintonrocksmith @Julien-Mialon

Xamarin.AndroidX.Browser.nuspec itself does not specify minimum API.

Our tool (binderator) that generates *.csproj files and solution from config.json

<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
  <metadata>
    <id>Xamarin.AndroidX.Browser</id>
    <version>1.2.0</version>
    <title>Xamarin AndroidX - browser</title>
    <authors>Microsoft</authors>
    <owners>Microsoft</owners>
    <requireLicenseAcceptance>true</requireLicenseAcceptance>
    <license type="file">LICENSE.md</license>
    <licenseUrl>https://aka.ms/deprecateLicenseUrl</licenseUrl>
    <projectUrl>https://go.microsoft.com/fwlink/?linkid=2113238</projectUrl>
    <iconUrl>https://go.microsoft.com/fwlink/?linkid=2099392</iconUrl>
    <description>Xamarin.Android bindings for AndroidX - browser</description>
    <copyright>© Microsoft Corporation. All rights reserved.</copyright>
    <tags>Xamarin AndroidX Xamarin.AndroidX Support Google browser</tags>
    <repository type="git" url="https://github.com/xamarin/AndroidX.git" branch="refs/tags/20200318-stable-release" commit="eb71b4db3aa6728bc2093add189d98c5089e3752" />
    <dependencies>
      <group targetFramework="MonoAndroid9.0">
        <dependency id="Xamarin.AndroidX.Annotation" version="1.1.0" include="All" />
        <dependency id="Xamarin.AndroidX.Core" version="1.2.0" include="All" />
        <dependency id="Xamarin.Google.Guava.ListenableFuture" version="1.0.0.2" include="All" />
      </group>
    </dependencies>
    <frameworkAssemblies>
      <frameworkAssembly assemblyName="Java.Interop" targetFramework="MonoAndroid9.0" />
    </frameworkAssemblies>
  </metadata>
</package>

and the AndroidManifest.xml from artifact itself:

<?xml version="1.0" encoding="utf-8"?>
<!--
 Copyright 2015 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="androidx.browser" >

    <uses-sdk
        android:minSdkVersion="16"
        android:targetSdkVersion="28" />

</manifest>
<Project Sdk="MSBuild.Sdk.Extras/2.0.54">
  <PropertyGroup>
    <TargetFramework>MonoAndroid90</TargetFramework>
    <IsBindingProject>true</IsBindingProject>
    <AssemblyName>Xamarin.AndroidX.Browser</AssemblyName>
    <MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
    <MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
    <AndroidUseLatestPlatformSdk>False</AndroidUseLatestPlatformSdk>
    <AndroidUseIntermediateDesignerFile>True</AndroidUseIntermediateDesignerFile>
    <AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
    <RootNamespace>AndroidX.Browser</RootNamespace>
    <EnableProguard>true</EnableProguard>
    <AndroidEnableMultiDex>true</AndroidEnableMultiDex>
    <AndroidUseAapt2>true</AndroidUseAapt2>
    <AndroidDexTool>d8</AndroidDexTool>
    <AndroidLinkTool>r8</AndroidLinkTool>
    <!--
      No warnings for:
       - CS0618: 'member' is obsolete: 'text'
       - CS0109: The member 'member' does not hide an inherited member. The new keyword is not required
       - CS0114: 'function1' hides inherited member 'function2'. To make the current method override that implementation, add the override keyword. Otherwise add the new keyword.
       - CS0628: 'member' : new protected member declared in sealed class
       - CS0108: 'member1' hides inherited member 'member2'. Use the new keyword if hiding was intended.
       - CS0809: Obsolete member 'member' overrides non-obsolete member 'member'
    -->
    <NoWarn>0618;0109;0114;0628;0108;0809</NoWarn>
  </PropertyGroup>

  <PropertyGroup>
    <PackageId>Xamarin.AndroidX.Browser</PackageId>
    <Title>Xamarin AndroidX - browser</Title>
    <Summary>Xamarin.Android bindings for AndroidX - browser</Summary>
    <Description>Xamarin.Android bindings for AndroidX - browser</Description>
    <PackageTags>Xamarin AndroidX Xamarin.AndroidX Support Google browser</PackageTags>
    <Authors>Microsoft</Authors>
    <Owners>Microsoft</Owners>
    <Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
    <PackageProjectUrl>https://go.microsoft.com/fwlink/?linkid=2113238</PackageProjectUrl>
    <PackageLicenseFile>LICENSE.md</PackageLicenseFile>
    <PackageIconUrl>https://go.microsoft.com/fwlink/?linkid=2099392</PackageIconUrl>
    <PackageVersion>1.2.0$(PackageVersionSuffix)</PackageVersion>
    <PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
    <!-- Include symbol files (*.pdb) in the built .nupkg -->
    <AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
  </PropertyGroup>

  <PropertyGroup>
    <AndroidClassParser>class-parse</AndroidClassParser>
    <AndroidCodegenTarget>XAJavaInterop1</AndroidCodegenTarget>
  </PropertyGroup>

  <ItemGroup>
      <TransformFile Include="..\..\externals\androidx.browser\browser-paramnames.xml" Condition="Exists('..\..\..\externals\androidx.browser\browser-paramnames.xml')" />
  </ItemGroup>

  <ItemGroup>
    <_AndroidDocumentationPath Include="..\..\externals\androidx.browser\browser-paramnames.txt" Condition="Exists('..\..\..\externals\androidx.browser\browser-paramnames.txt')" />
  </ItemGroup>

  <ItemGroup>
    <None Include="Xamarin.AndroidX.Browser.targets" Pack="True" PackagePath="build\$(TargetFramework)" />
    <None Include="Xamarin.AndroidX.Browser.targets" Pack="True" PackagePath="buildTransitive\$(TargetFramework)" />
    <None Include="..\..\LICENSE.md" Pack="True" PackagePath="LICENSE.md" />
  </ItemGroup>

  <ItemGroup>
  </ItemGroup>

  <ItemGroup>
    <Folder Include="Additions\" />
    <Folder Include="Jars\" />
    <Folder Include="Transforms\" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="..\..\source\AssemblyInfo.cs" />
    <Compile Include="..\..\source\androidx.browser\browser\additions\*.cs">
        <Link>Additions/%(RecursiveDir)/%(Filename)%(Extension)</Link>
    </Compile>
  </ItemGroup>

  <ItemGroup>
    <TransformFile Include="..\..\source\Metadata.common.xml" >
      <Link>Transforms/Metadata.common.xml</Link>
    </TransformFile>
    <TransformFile Include="..\..\source\androidx.browser\browser\transforms\*.xml">
        <Link>Transforms/%(RecursiveDir)/%(Filename)%(Extension)</Link>
    </TransformFile>
    <AndroidJavaSource 
      Condition="Exists('..\..\source\androidx.browser\browser\java\*.java')"
      Include="..\..\source\androidx.browser\browser\java\*.java"
      >
      <Link>Java/%(RecursiveDir)/%(Filename)%(Extension)</Link>
    </AndroidJavaSource>
  </ItemGroup>

  <ItemGroup>
    <None Include="..\..\externals\androidx.browser\browser.aar" Pack="True" PackagePath="aar\androidx.browser.browser.aar" />
  </ItemGroup>

  <ItemGroup>
    <InputJar Include="..\..\externals\androidx.browser\browser\classes.jar" />
    <!-- For those artifacts with lib/ folder -->
    <InputJar 
      Condition="Exists('..\..\externals\androidx.browser\browser\libs\')"
      Include="..\..\externals\androidx.browser\browser\libs\*.jar" 
      />
    <InputJar Remove="..\..\externals\androidx.browser\browser\lint.jar" />
    <InputJar Remove="..\..\externals\androidx.browser\browser\**\lint.jar" />
  </ItemGroup>

  <ItemGroup>
    <!-- ProjectReference -->
        <ProjectReference Include="..\..\generated\androidx.core.core\androidx.core.core.csproj" PrivateAssets="none" />
        <ProjectReference Include="..\..\generated\androidx.annotation.annotation\androidx.annotation.annotation.csproj" PrivateAssets="none" />
    <!-- some additional fixes -->
      </ItemGroup>

  <ItemGroup>
    <!-- PackageReference -->
      <PackageReference Include="Xamarin.Google.Guava.ListenableFuture" Version="1.0.0.2" PrivateAssets="none" />
  </ItemGroup>

</Project>

Might be that manifest merging is not right, that Xamarin.Android.ManifestMerger package might be needed.

https://www.nuget.org/packages/Xamarin.Android.ManifestMerger/1.0.0-preview03

moljac commented 4 years ago

AndroidManifest.xml from 'nupkg's:

1.2.0:

<?xml version="1.0" encoding="utf-8"?>
<!--
 Copyright 2015 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="androidx.browser" >

    <uses-sdk
        android:minSdkVersion="16"
        android:targetSdkVersion="28" />

</manifest>

1.0.0

<?xml version="1.0" encoding="utf-8"?>
<!--
 Copyright (C) 2015 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="androidx.browser" >

    <uses-sdk android:minSdkVersion="15" />

</manifest>
moljac commented 4 years ago

@developer9969

I guess now I have to be very careful when I upgrade any androidX nuget package.

Normally this should not be the case.

I could not find what AndroidX.Browser 1.0.0 Min version support?

It is in the nuget within the aar. If you want to check unzip nuget, unzip aar and there is AndroidManifest.xml with android:minSdkVersion, but I did it for investigating. Check my previous comment.

@developer9969 @clintonrocksmith @Julien-Mialon

  1. Did you try adding ManifestMerger package? Does it solve the issue
  2. If not can you provide minimal sample please? So I can test this case.
developer9969 commented 4 years ago

@moljac hi thanks for your reply. I did not try adding ManifestMerger because is in preview and where I work we cannot add nugets that are in preview as a company policy, but I will try to see if solves the issue, so that it will give you something to go on...

I guess any project that has a Min version of marshmallow and references Androidx.Browser 1.2 will fail against an azure pipeline build.

let you know.

moljac commented 4 years ago

@developer9969

I did not try adding ManifestMerger because is in preview and where I work we cannot add nugets that are in preview as a company policy,

I know it is preview, but test would help us (me) to promote it to stable.

Thanks for the feedback.

developer9969 commented 4 years ago

@moljac hi there, quick update. I cannot replicate this issue anymore on the pipeline. It all works and no longer receive the error. makes no sense unless something has been updated in azure devops...

@clintonrocksmith @Julien-Mialon wonder if the others still get the error

moljac commented 4 years ago

@developer9969

Glad it works for you.

Yes. Our tooling is moving target and updates on Azure DevOps might have fixed this issue.

@clintonrocksmith @Julien-Mialon Guys some feedback would be nice. Otherwise I will close this issue soon.

EmilAlipiev commented 4 years ago

it still fails for me on VS2019 build, here is the full stacktrace i have. How to resolve it?


7>COMPILETODALVIK : Uncaught translation error : com.android.dx.cf.code.SimException: ERROR in androidx.browser.customtabs.CustomTabsService$1.newSessionInternal:(Landroid/support/customtabs/ICustomTabsCallback;Landroid/app/PendingIntent;)Z: invalid opcode ba - invokedynamic requires --min-sdk-version >= 26 (currently 13)
7>COMPILETODALVIK : Uncaught translation error : com.android.dx.cf.code.SimException: ERROR in androidx.browser.trusted.ConnectionHolder.getServiceWrapper:()Lcom/google/common/util/concurrent/ListenableFuture;: invalid opcode ba - invokedynamic requires --min-sdk-version >= 26 (currently 13)
7>  Uncaught translation error: com.android.dx.cf.code.SimException: ERROR in androidx.browser.trusted.TokenContents.createToken:(Ljava/lang/String;Ljava/util/List;)[B: invalid opcode ba - invokedynamic requires --min-sdk-version >= 26 (currently 13)
7>  Uncaught translation error: com.android.dx.cf.code.SimException: ERROR in androidx.browser.trusted.TrustedWebActivityServiceConnectionPool.connect:(Landroid/net/Uri;Ljava/util/Set;Ljava/util/concurrent/Executor;)Lcom/google/common/util/concurrent/ListenableFuture;: invalid opcode ba - invokedynamic requires --min-sdk-version >= 26 (currently 13)
7>  4 errors; aborting
7>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.DX.targets(79,5): error : java/lang/String;Ljava/util/List;)[B :  invalid opcode ba - invokedynamic requires --min-sdk-version >= 26 (currently 13)
EmilAlipiev commented 4 years ago

Problem is probably related to this post https://stackoverflow.com/questions/45862140/invokedynamic-requires-min-sdk-version-26

it says that something to do with Guava and JDK version comparability. version 1.0.0 doesnt have Guava included. thats why problem is not occurring. Your pipeline started working suddenly because probably your VM you are using to build was upgraded with JDK. i dont actually know which JDK is correct because i am using microsoft_dist_openjdk_1.8.0.25. It should be working probably but it doesnt when i build using latest version of VS 2019. So how to solve this now?

EmilAlipiev commented 4 years ago

Finally i could reproduce in a test project. Problem seems to be with proguard. When I enabled proguard, i am able to get this error. Please find the attached test project. AndroidX.zip

moljac commented 4 years ago

@EmilAlipiev Thanks a lot for the repro sample.

Is it a proguard or R8?

Try switching to D8 and R8.

I know I could have looked in the zip...

moljac commented 4 years ago

In Debug it is dex + proguard.

    <AndroidUseAapt2>true</AndroidUseAapt2>
    <AndroidPackageFormat>apk</AndroidPackageFormat>
    <AndroidLinkTool>proguard</AndroidLinkTool>
    <AndroidDexTool>dx</AndroidDexTool>

Let me see if I can reproduce.

EmilAlipiev commented 4 years ago

I could make that working with d8 and r8 but it doesn't work with proguard and dex.

moljac commented 4 years ago

@EmilAlipiev

I could make that working with d8 and r8 but it doesn't work with proguard and dex.

AndroidX (and everything new - depending on it) should use new tools (D8 and R8) old tools (proguard and dex) are being obsoleted, not by us, but by google.

moljac commented 4 years ago

@developer9969

I cannot replicate this issue anymore on the pipeline. It all works and no longer receive the error. makes no sense unless something has been updated in azure devops...

yes. This happens. Usually when Azure DevOps switch/bump Xamarin(Android) SDK version. Google's and Xamarin tooling do change all the time.

nichojo89 commented 3 years ago

This happens when compiling an Android project with Androidx.Browser 1.2.0 installed. Set dx as Dex compiler and code shrinker to progaurd

moljac commented 3 years ago

Please use new tools for AndroidX D8 and R8 instead of DX and Proguard.

Closing this one

MitchBomcanhao commented 3 years ago

I've started getting this issue when building the app locally in visual studio since xamarin nuget packages got updated to depend on androidx.browser version 1.3.0. I've never used DX and proguard. depending on configuration we use D8 or D8+R8...

as a sidenote, I tried bumping up the minimum api to 24, and building the app failed again on another component, now requiring minimum version 26.

interestingly, the proper build works fine, but it fails when doing a local debug one :(