Arduino IDE 2.0 not using Board library

My program for the RTL8720DN(BW16) compiles correctly on Arduino IDE 18.15, but does not when using Ardino IDE 2.0. It uses the Arduino Wifi Library even though I believe the library priority says it should use the board library.

The error is:

int _EXFUN(isxdigit,(int __c));
^
c:\users\mgsec\appdata\local\arduino15\packages\realtek\tools\ameba_d_asdk_toolchain\1.0.1\arm-none-eabi\include\ctype.h:23:5: error: expected ')' before 'int'
Multiple libraries were found for "WiFi.h"
Used: C:\Program Files (x86)\Arduino\libraries\WiFi
Not used: C:\Users\mgsec\AppData\Local\Arduino15\packages\realtek\hardware\AmebaD\3.1.1\libraries\WiFi
Compilation error: exit status 1}

Hi @mgsecord. The reason is explained here:

An additional "Library Name Priority" factor has been added since the version of the classic Arduino IDE you were using. This new factor changes which of the two libraries gets priority.

The reason is that the name value in the metadata file of the library bundled with the "AmebaD ARM (32-bits) Boards" platform is "AmebaWiFi":

whereas the value in the standalone library is "WiFi". So it gets a perfect library name match priority to the #include directive for WiFi.h.

The fix is to change the library name to give a perfect match, which will cause it to tie with the standalone "WiFi" library for "Library Name Priority". After that, the "Architecture Priority" will cause it to get a higher priority.

  1. Open this file in a text editor:
    C:\Users\mgsec\AppData\Local\Arduino15\packages\realtek\hardware\AmebaD\3.1.1\libraries\WiFi\library.properties
    
  2. Change this line:
    name=AmebaWiFi
    
    to this:
    name=WiFi
    
  3. Save the file.

Now try compiling your sketch again.

Thank you @ ptillisch! That worked.

You are welcome. I'm glad to hear it is working now.

I submitted a fix to the "AmebaD ARM (32-bits) Boards" platform so that the manual patch I described above will not be necessary with future releases: