plugin.utf8 not working

I have downloaded the Corona-3523 build and start migrating my existing app to 64-bit Android version.

However, I found that  the plugin.utf8.so is not included in the final apk.

Here is a quck test setup. I modified the Corona  Natvie sample code “CustomErrorHandler” with following change:

  1. Add two lines in Corona/main.lua

 

local utf8 = require( “plugin.utf8” )

print( utf8.width( “asdfasdf” ) )

2.  Change  Corona/build.settings :

 

settings =

{

        --[[

        orientation =

        {

                default = “portrait”,

                supported = { “portrait” }

        },

        --]]

 

        iphone =

        {

                xcassets = “Images.xcassets”,

                plist =

                {

                        UILaunchStoryboardName = “LaunchScreen”,

                },

        },

 

plugins =

    {

        [“plugin.utf8”] =

        {

            publisherId = “com.coronalabs”

        },

    },

}

 

  1. Compile the Android build by: 

./gradlew assembleRelease

 

  1. If we unzip the apk file, we check there is no  “libplugin.utf8.so” found in any folder…

  inflating: assets/resource.car     

  inflating: classes.dex             

  inflating: lib/arm64-v8a/libads.so

  inflating: lib/arm64-v8a/libalmixer.so

  inflating: lib/arm64-v8a/libanalytics.so

  inflating: lib/arm64-v8a/libcorona.so

  inflating: lib/arm64-v8a/libgameNetwork.so

  inflating: lib/arm64-v8a/libjnlua5.1.so

  inflating: lib/arm64-v8a/liblicensing.so

  inflating: lib/arm64-v8a/liblua.so

  inflating: lib/arm64-v8a/libmpg123.so

  inflating: lib/arm64-v8a/libopenal.so

  inflating: lib/armeabi-v7a/libads.so

  inflating: lib/armeabi-v7a/libalmixer.so

  inflating: lib/armeabi-v7a/libanalytics.so

  inflating: lib/armeabi-v7a/libcorona.so

  inflating: lib/armeabi-v7a/libgameNetwork.so

  inflating: lib/armeabi-v7a/libjnlua5.1.so

  inflating: lib/armeabi-v7a/liblicensing.so

  inflating: lib/armeabi-v7a/liblua.so

  inflating: lib/armeabi-v7a/libmpg123.so

  inflating: lib/armeabi-v7a/libopenal.so

  inflating: lib/x86/libads.so       

  inflating: lib/x86/libalmixer.so   

  inflating: lib/x86/libanalytics.so

  inflating: lib/x86/libcorona.so    

  inflating: lib/x86/libgameNetwork.so

  inflating: lib/x86/libjnlua5.1.so

  inflating: lib/x86/liblicensing.so

  inflating: lib/x86/liblua.so       

  inflating: lib/x86/libmpg123.so    

  inflating: lib/x86/libopenal.so    

  inflating: lib/x86_64/libads.so    

  inflating: lib/x86_64/libalmixer.so

  inflating: lib/x86_64/libanalytics.so

  inflating: lib/x86_64/libcorona.so

  inflating: lib/x86_64/libgameNetwork.so

  inflating: lib/x86_64/libjnlua5.1.so

  inflating: lib/x86_64/liblicensing.so

  inflating: lib/x86_64/liblua.so    

  inflating: lib/x86_64/libmpg123.so

  inflating: lib/x86_64/libopenal.so

  

 

Have you actually activated the plugin from the marketplace? If I’m not mistaken, simply requiring it in your code isn’t enough.

https://marketplace.coronalabs.com/corona-plugins/utf-8

What happens if you do a simulator build instead of a native build?

What happens if you build from Android Studio instead of doing a command line build?

Are you running the script to download plugins?

Rob

Here is my test result:

What happens if you do a simulator build instead of a native build?

> Yes, if generate apk from simulator , the apk has  “libplugin.utf8.so”.

 

What happens if you build from Android Studio instead of doing a command line build?

> Same result.There is no “libplugin.utf8.so”

 

Are you running the script to download plugins?

> No.

 

 

 

 

You need to run setUpCoronaAppAndPlugins  in the Gradle section of Android Studio:

Rob

Thanks.

Finally work after executing “./gradlew setUpCoronaAppAndPlugins” in Android folder.

This would be nice if you can add this procedure in the document (which is currently missing this important step)

https://docs.coronalabs.com/native/android/index.html