Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

plugin.utf8 not working
Started by sam149 Sep 11 2019 02:55 AM

5 replies to this topic
plugin.utf8

Best Answer Rob Miracle , 12 September 2019 - 10:45 AM

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

 

 

 

Rob

[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

sam149

[GLOBAL: userInfoPane.html]
sam149
  • Observer

  • 15 posts
  • Corona SDK

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"

        },

    },

}

 

3. Compile the Android build by: 

./gradlew assembleRelease

 

4. 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  

  

 

 

 

 



[TOPIC: post.html]
#2

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Contributor

  • 893 posts
  • Corona SDK

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



[TOPIC: post.html]
#3

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,068 posts
  • Enterprise

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



[TOPIC: post.html]
#4

sam149

[GLOBAL: userInfoPane.html]
sam149
  • Observer

  • 15 posts
  • Corona SDK

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.

 

 

 

 



[TOPIC: post.html]
#5

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,068 posts
  • Enterprise

  Best Answer

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

 

Attached File  downloadplugin.png   33.35KB   0 downloads

 

 

Rob



[TOPIC: post.html]
#6

sam149

[GLOBAL: userInfoPane.html]
sam149
  • Observer

  • 15 posts
  • Corona SDK

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




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: plugin.utf8