Declined
Last Updated: 27 Mar 2020 11:13 by ADMIN
Art
Created on: 21 Mar 2020 17:21
Category: UI for Xamarin
Type: Bug Report
2
invalid opcode ba - invokedynamic requires --min-sdk-version >= 26 (currently 13) build error after upgrading to version 2020.1.318.1

I have upgraded my Xamarin.Forms to version 4.5 and installed the dependent AndroidX nuget packages.  After upgrading UI for Xamarin to version 2020.1.318.1, I'm getting 3 errors below in my Xamarin Android project that seems to have to do with min SDK version when I try to build:

java/lang/String;Ljava/util/List;)[B :  invalid opcode ba - invokedynamic requires --min-sdk-version >= 26 (currently 13) 

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)

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) 


I'm targeting Android 9 and set the minimum supported SDK to 26.  The error hasn't gone away.

I upgraded to latest Telerik to address a reference issue with AndroidX.RecyclerView but it seems that these new errors are showing up now. 

Is there something I can do to resolve the error or do I just have to wait for the next Telerik UI for Xamarin release?

 

5 comments
ADMIN
Didi
Posted on: 27 Mar 2020 11:13

Hello,

The issue can be reproduced  when latest version of Xamarin.AndroidX 1.2.0 is used. The issue is logged in Xamarin github repo https://github.com/xamarin/AndroidX/issues/78

I have changed the feedback item status to Declined as this issue is not related to the Telerik UI for Xamarin suite.

Solution:

As a workaround I suggest using the d8 dex decompiler or version of AndroidX lower than 1.2.0.

Regards,
Didi
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
ADMIN
Didi
Posted on: 24 Mar 2020 08:56

Hello Art,

I have updated the test project Xamarin.Forms version to 4.5.0.396. I have build and run the app on android in release and debug mode with linker set to SDK Assemblies only and no errors occur. 

I have attached my test project updated, please download it and check whether the issue could be reproduced on your side? Also make sure that you have followed the steps that my colleague Lance provided about Android settings. 

After reviewing the error "java/lang/String;Ljava/util/List;)[B :  invalid opcode ba - invokedynamic requires --min-sdk-version >= 26 (currently 13)"  I have found the following links that describes similar error and how it could be solved: 

https://forums.xamarin.com/discussion/126908/xamarin-aar-library-compiletodalvik-error-on-build

https://stackoverflow.com/questions/49891730/invoke-customs-are-only-supported-starting-with-android-0-min-api-26

Please review the links and give the suggestions a try. Let me know how it goes.

Regards,
Didi
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Attached Files:
ADMIN
Lance | Manager Technical Support
Posted on: 23 Mar 2020 20:48

Hello Art,

While you await Didi's answer, I wanted to pop in and double check on a few things so that she can better assist.

Confirmations

At this time you cannot compile with or set the target SDK to API 29 yet. When we rebuild/migrate the native Android controls on AndroidX, you will be able to make that change as well.

Until then, make sure the following is set in the Android project:

Step 1. Right click on the Android project and select "set as start up project"

Step 2. Right on the Android project and select Clean

Step 3. Open the Android project setting and set the "Compile With" and "Target" versions to Android 9.

Fig. 1 Compile with version

Fig. 2 Target and Min version

While in there, set the min SDK is set to 15 just to to be safe..

Step 4. Make sure the project has all the Required Android Support Libraries set to the 28.0.0.3 version that we have listed in that article. If you miss any, then the Android X version might get pulled in.

Step 5. Double check any other dependencies you have that might be pulling in unsupported/deprecated packages.

Step 6. Once that is complete, right click on the Android project and select Rebuild.

Next Steps

If this doesn't help, please reply back with your project Cleaned and zipped so we can directly investigate. Without the project, it would be difficult to guess as to what the issue is.

Thank you for your understanding and patience.

Regards,
Lance | Team Lead - US DevTools Support
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Art
Posted on: 23 Mar 2020 19:09

Hi, Didi,

 Sorry that I didn't specify the exact version of Xamarin.Forms.  We are actually on XF v4.5.0.396.  Can you please see if you can reproduce the error against that version?

Thanks,

Art 

ADMIN
Didi
Posted on: 23 Mar 2020 15:54

Hello Art,

Thank you for the provided information.

I have created a Blank Xamarin.Forms project using Xamarin.Forms version 4.5.0356 and Telerik UI for Xamarin v 2020.1.218.1. I have installed Xamarin.AndroidX.RecyclerView and Xamarin.Android.V7.RecyclerView. I have reproduced the exception with the missing HasStableIds setter API when SDK Linker is enabled and XF 4.5 is used. This issue is fixed in our latest version 2020.1.318.1.- check the following feedback item https://feedback.telerik.com/xamarin/1456227-xamarin-forms-4-5-or-later-required. So I have updated the Telerik UI for Xamarin to its latest version, build the app for Android in release mode with setting linker to SDK Assemblies Only. I cannot reproduce any errors. 

My Android project properties: the minimum android version is api level 21 and the maximum is api level 28. I have installed Xamarin.AndroidX.Browser nuget package to the android project and still cannot reproduce the error. I have attached my test project to this thread. Could you please download it and test on your side. 

If the issue is not represented in the test project, then could you please modify the attached sample so the error can be reproduced in it, or send us the project where the issue could be reproduced. If you want to send us the project you are working on I suggest you open a support ticket and attach it there, as the support ticketing system is the private channel.  

I look forward to your reply.

Regards,
Didi
Progress Telerik

Attached Files: