使用模拟器进行测试时,Gluon android apk会生成黑屏

时间:2018-04-21 06:28:16

标签: javafx gluon gluon-mobile javafxports

我按照胶子移动android设置的教程,然而,当创建一个apk并在模拟器上运行它时,黑屏显示并基本上崩溃应用程序。这是我的build.gradle:

buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'org.javafxports:jfxmobile-plugin:1.3.10'
    classpath 'com.google.gms:google-services:3.1.0'
}
}

apply plugin: 'org.javafxports.jfxmobile'

repositories {
jcenter()
maven {
    url 'http://nexus.gluonhq.com/nexus/content/repositories/releases'
}
mavenCentral()
}

mainClassName = 'com.gluonapplication.GluonApplication'

dependencies {

compile 'com.gluonhq:charm:4.4.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.firebase:firebase-admin:5.9.0'
compile 'com.jfoenix:jfoenix:8.0.1'
compile "com.android.support:support-v4:25.1.1"

androidRuntime 'com.gluonhq:charm-down-core-android:3.7.2'



}

jfxmobile {
javafxportsVersion = '8.60.9'
downConfig {
    version = '3.7.2'
    // Do not edit the line below. Use Gluon Mobile Settings in your project context menu instead
    plugins 'display', 'lifecycle', 'statusbar', 'storage', 'pictures'
}
android {
    manifest = 'src/android/AndroidManifest.xml'
    androidSdk = "C:/Android/android-sdk"

    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/INDEX.LIST'
        exclude 'META-INF/io.netty.versions.properties'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/LGPL2.1'
    }


}
ios {
    infoPList = file('src/ios/Default-Info.plist')
    forceLinkClasses = [
            'com.gluonhq.**.*',
            'javax.annotations.**.*',
            'javax.inject.**.*',
            'javax.json.**.*',
            'org.glassfish.json.**.*'
    ]
    }
}

我的adb logcat:

System.err: Exception in Application start method
04-21 01:58:12.247  3694  3718 I System.out: QuantumRenderer: shutdown
04-21 01:58:12.254  3694  3714 W System.err: java.lang.reflect.InvocationTargetException
04-21 01:58:12.255  3694  3714 W System.err:    at java.lang.reflect.Method.invoke(Native Method)
04-21 01:58:12.256  3694  3714 W System.err:    at javafxports.android.DalvikLauncher$1.run(DalvikLauncher.java:188)
04-21 01:58:12.256  3694  3714 W System.err:    at java.lang.Thread.run(Thread.java:761)
04-21 01:58:12.257  3694  3714 W System.err: Caused by: java.lang.RuntimeException: Exception in Application start method
04-21 01:58:12.257  3694  3714 W System.err:    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
04-21 01:58:12.257  3694  3714 W System.err:    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$138(LauncherImpl.java:182)
04-21 01:58:12.257  3694  3714 W System.err:    at com.sun.javafx.application.LauncherImpl.access$lambda$1(LauncherImpl.java)
04-21 01:58:12.257  3694  3714 W System.err:    at com.sun.javafx.application.LauncherImpl$$Lambda$2.run(Unknown Source)
04-21 01:58:12.258  3694  3714 W System.err:    ... 1 more
04-21 01:58:12.270  3694  3714 W System.err: Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Ljava/time/LocalDate;
04-21 01:58:12.271  3694  3714 W System.err:    at javafx.scene.AccessibleAttribute.<clinit>(AccessibleAttribute.java:217)
04-21 01:58:12.271  3694  3714 W System.err:    at javafx.scene.Node$1.invalidated(Node.java:773)
04-21 01:58:12.271  3694  3714 W System.err:    at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:111)
04-21 01:58:12.272  3694  3714 W System.err:    at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:146)
04-21 01:58:12.272  3694  3714 W System.err:    at javafx.scene.Node.setParent(Node.java:720)
04-21 01:58:12.272  3694  3714 W System.err:    at javafx.scene.Parent$1.onChanged(Parent.java:268)
04-21 01:58:12.273  3694  3714 W System.err:    at com.sun.javafx.collections.TrackableObservableList.lambda$new$17(TrackableObservableList.java:44)
04-21 01:58:12.273  3694  3714 W System.err:    at com.sun.javafx.collections.TrackableObservableList.access$lambda$0(TrackableObservableList.java)
04-21 01:58:12.273  3694  3714 W System.err:    at com.sun.javafx.collections.TrackableObservableList$$Lambda$1.onChanged(Unknown Source)
04-21 01:58:12.279  3694  3714 W System.err:    at com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:328)
04-21 01:58:12.280  3694  3714 W System.err:    at com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:72)
04-21 01:58:12.280  3694  3714 W System.err:    at javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:232)
04-21 01:58:12.280  3694  3714 W System.err:    at javafx.collections.ListChangeBuilder.commit(ListChangeBuilder.java:482)
04-21 01:58:12.280  3694  3714 W System.err:    at javafx.collections.ListChangeBuilder.endChange(ListChangeBuilder.java:541)
04-21 01:58:12.280  3694  3714 W System.err:    at javafx.collections.ObservableListBase.endChange(ObservableListBase.java:204)
04-21 01:58:12.281  3694  3714 W System.err:    at javafx.collections.ModifiableObservableListBase.addAll(ModifiableObservableListBase.java:102)
04-21 01:58:12.281  3694  3714 W System.err:    at com.sun.javafx.collections.VetoableListDecorator.addAll(VetoableListDecorator.java:237)
04-21 01:58:12.281  3694  3714 W System.err:    at com.sun.javafx.collections.VetoableListDecorator.addAll(VetoableListDecorator.java:103)
04-21 01:58:12.282  3694  3714 W System.err:    at com.gluonhq.charm.glisten.application.GlassPane.a(SourceFile:145)
04-21 01:58:12.282  3694  3714 W System.err:    at com.gluonhq.charm.glisten.application.MobileApplication.a(SourceFile:229)
04-21 01:58:12.282  3694  3714 W System.err:    at com.gluonhq.charm.glisten.application.MobileApplication.start(SourceFile:224)
04-21 01:58:12.282  3694  3714 W System.err:    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$145(LauncherImpl.java:863)
04-21 01:58:12.282  3694  3714 W System.err:    at com.sun.javafx.application.LauncherImpl.access$lambda$8(LauncherImpl.java)
04-21 01:58:12.283  3694  3714 W System.err:    at com.sun.javafx.application.LauncherImpl$$Lambda$9.run(Unknown Source)
04-21 01:58:12.283  3694  3714 W System.err:    at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$158(PlatformImpl.java:326)
04-21 01:58:12.283  3694  3714 W System.err:    at com.sun.javafx.application.PlatformImpl.access$lambda$6(PlatformImpl.java)
04-21 01:58:12.283  3694  3714 W System.err:    at com.sun.javafx.application.PlatformImpl$$Lambda$7.run(Unknown Source)
04-21 01:58:12.283  3694  3714 W System.err:    at com.sun.javafx.application.PlatformImpl.lambda$null$156(PlatformImpl.java:295)
04-21 01:58:12.284  3694  3714 W System.err:    at com.sun.javafx.application.PlatformImpl.access$lambda$18(PlatformImpl.java)
04-21 01:58:12.284  3694  3714 W System.err:    at com.sun.javafx.application.PlatformImpl$$Lambda$19.run(Unknown Source)
04-21 01:58:12.285  3694  3714 W System.err:    at java.security.AccessController.doPrivileged(AccessController.java:57)
04-21 01:58:12.285  3694  3714 W System.err:    at com.sun.javafx.application.PlatformImpl.lambda$runLater$157(PlatformImpl.java:294)
04-21 01:58:12.285  3694  3714 W System.err:    at com.sun.javafx.application.PlatformImpl.access$lambda$5(PlatformImpl.java)
04-21 01:58:12.286  3694  3714 W System.err:    at com.sun.javafx.application.PlatformImpl$$Lambda$6.run(Unknown Source)
04-21 01:58:12.286  3694  3714 W System.err:    at com.sun.glass.ui.monocle.RunnableProcessor.runLoop(RunnableProcessor.java:93)
04-21 01:58:12.286  3694  3714 W System.err:    at com.sun.glass.ui.monocle.RunnableProcessor.run(RunnableProcessor.java:52)
04-21 01:58:12.286  3694  3714 W System.err:    ... 1 more
04-21 01:58:12.289  3694  3714 W System.err: Caused by: java.lang.ClassNotFoundException: Didn't find class "java.time.LocalDate" on path: DexPathList[[zip file "/data/app/com.gluonapplication-2/base.apk"],nativeLibraryDirectories=[/data/app/com.gluonapplication-2/lib/arm, /data/app/com.gluonapplication-2/base.apk!/lib/armeabi, /system/lib, /vendor/lib]]
04-21 01:58:12.290  3694  3714 W System.err:    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
04-21 01:58:12.290  3694  3714 W System.err:    at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
04-21 01:58:12.290  3694  3714 W System.err:    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
04-21 01:58:12.291  3694  3714 W System.err:    ... 37 more

我甚至尝试过放置一个新的默认项目&apk并将其放入模拟器中,然而,它仍然收到与黑屏相同的错误

1 个答案:

答案 0 :(得分:0)

我在Android 10设备中遇到的同一问题,这里是link

这是一个临时解决方案。