Gluon Sample Project with JDBC doesn't work on iOS Device

孤者浪人 提交于 2019-11-29 13:11:45

It seems there's a change in the encoding used in the connector.

This is the latest version that works for me on iOS:

dependencies {
    compile 'mysql:mysql-connector-java:3.1.12'
}

For newer versions (3.1.13+), I find the same exception you see:

java.sql.SQLException: Unsupported character encoding 'Cp1252'.
at com.mysql.jdbc.StringUtils.getBytes(StringUtils.java)

Finally, there is a typo on your build.gradle file:

jfxmobile {
    android {
        manifest = 'src/android/AndroidManifest.xml'
        packagingOptions {
            exclude 'META-INF/INDEX.LIST'
        }
        // typo!! iOS should be outside android!
        ios {
            infoPList = file('src/ios/Default-Info.plist')
            forceLinkClasses = ['com.mtt8.**.*', 'com.mysql.**.*']
        }
    }

}

Make sure this is how you set your options:

jfxmobile {
    android {
        manifest = 'src/android/AndroidManifest.xml'
        packagingOptions {
            exclude 'META-INF/INDEX.LIST'
        }
    }

    ios {
        forceLinkClasses = [ 'com.gluonhq.**.*', 'com.mysql.**.*']
        infoPList = file('src/ios/Default-Info.plist')
    }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!