JavaFXPorts没有加载第二个活动

时间:2017-12-11 16:57:24

标签: android javafxports

我修改了javafxports和android的项目kokos以在android上创建一个javafx应用程序,当我尝试加载第二个活动时,它关闭并返回到主活动。调试文件中没有编译错误:

29 18829 V DalvikLauncher:preloader class:[null]

12-11 17:49:36.031 18829 18829 V DalvikLauncher:javafx应用程序类:[class javafx.application.Application]

12-11 17:49:36.031 18829 18829 V DalvikLauncher:javafx启动器类:[class com.sun.javafx.application.LauncherImpl]

12-11 17:49:36.031 18829 18829 V DalvikLauncher:启动应用程序方法:[public static void com.sun.javafx.application.LauncherImpl.launchApplication(java.lang.Class,java.lang.Class,java。 lang.String [])]

12-11 17:49:36.031 18829 18829 V FXEntity:被叫表面改变[1280,727],格式4

12-11 17:49:36.031 18829 18829 V FXEntity:需要调用表面重绘

12-11 17:49:36.051 18829 18829 V FXEntity:需要表面重绘

12-11 17:49:36.071 18829 18856 I System.out:Prism管道初始化顺序:es2

12-11 17:49:36.071 18829 18856 I System.out:使用基于原生的双鱼座光栅化器

12-11 17:49:36.071 18829 18856 I System.out:使用脏区优化

12-11 17:49:36.071 18829 18856 I System.out:对基元使用系统大小的掩码

12-11 17:49:36.071 18829 18856 I System.out:不强制纹理的2种尺寸

12-11 17:49:36.071 18829 18856 I System.out:使用硬件CLAMP_TO_ZERO模式

12-11 17:49:36.071 18829 18856 I System.out:选择进行HiDPI像素缩放

12-11 17:49:36.081 18829 18857 I System.out:Prism管道名称= com.sun.prism.es2.ES2Pipeline

12-11 17:49:36.081 18829 18857 I System.out:加载ES2本机库... prism_es2_monocle

12-11 17:49:36.091 18829 18857 E art:dlopen(" /vendor/lib/libprism_es2_monocle.so",RTLD_LAZY)失败:dlopen失败:library" / vendor / lib /libprism_es2_monocle.so"找不到

12-11 17:49:36.091 18829 18857 E art:dlopen(" /system/lib/libprism_es2_monocle.so",RTLD_LAZY)失败:dlopen失败:library" / system / lib /libprism_es2_monocle.so"找不到

12-11 17:49:36.111 573 597 I ActivityManager:显示hidralab.Hidrasmartcm_app_2 / hidralab.hidrasmartcm_app_2.MainActivity:+ 983ms

12-11 17:49:36.111 18829 18857 D houdini:[18857]为Native Bridge为ClassLoader添加了共享库/data/app/hidralab.Hidrasmartcm_app_2-2/lib/arm/libprism_es2_monocle.so。

12-11 17:49:36.111 18829 18857 I System.out:成功。

12-11 17:49:36.111 18829 18857 I System.out:使用com.sun.prism.es2.MonocleGLFactory的GLFactory

12-11 17:49:36.121 18829 18857 E art:dlopen(" /vendor/lib/libglass_monocle.so",RTLD_LAZY)失败:dlopen失败:library" / vendor / lib /libglass_monocle.so"找不到

12-11 17:49:36.131 18829 18857 E art:dlopen(" /system/lib/libglass_monocle.so",RTLD_LAZY)失败:dlopen失败:library" / system / lib /libglass_monocle.so"找不到

12-11 17:49:36.131 573 588 W InputMethodManagerService:获取RemoteException向pid发送setActive(false)通知18792 uid 10301

12-11 17:49:36.131 18829 18857 D houdini:[18857]为Native Bridge为ClassLoader添加了共享库/data/app/hidralab.Hidrasmartcm_app_2-2/lib/arm/libglass_monocle.so。

12-11 17:49:36.141 18829 18848 V FXEntity:在FXActivity中调用notify_glassHasStarted。立即注册设备。

12-11 17:49:36.191 18829 18857 E libEGL:eglMakeCurrent:786 error 3009(EGL_BAD_MATCH)

12-11 17:49:36.201 18829 18857 I System.out:(X)得到了class = class com.sun.prism.es2.ES2Pipeline

12-11 17:49:36.201 18829 18857 I System.out:初始化的棱镜管道:com.sun.prism.es2.ES2Pipeline

12-11 17:49:36.251 18829 18857 I System.out:支持的最大纹理尺寸:4096

12-11 17:49:36.251 18829 18857 I System.out:最大纹理大小限制为2048

12-11 17:49:36.261 18829 18857 I System.out:两个纹理支持的非幂= true

12-11 17:49:36.261 18829 18857 I System.out:顶点属性的最大数量= 16

12-11 17:49:36.261 18829 18857 I System.out:均匀顶点分量的最大数量= 1024

12-11 17:49:36.261 18829 18857 I System.out:均匀片段组件的最大数量= 1024

12-11 17:49:36.261 18829 18857 I System.out:变化组件的最大数量= 48

12-11 17:49:36.261 18829 18857 I System.out:顶点着色器中可用的最大纹理单位数= 0

12-11 17:49:36.261 18829 18857 I System.out:片段着色器中可用的最大纹理单元数= 8

12-11 17:49:36.261 18829 18857 I System.out:图形供应商:ARM

12-11 17:49:36.261 18829 18857 I System.out:Renderer:Mali-450 MP

12-11 17:49:36.261 18829 18857 I System.out:Version:OpenGL ES 2.0

12-11 17:49:36.271 18829 18848 I System.out:注册设备已完成

12-11 17:49:36.281 18829 18859 W System.err:vsync:false vpipe:true

12-11 17:49:36.281 18829 18859 I System.out:[MON]创建设备

12-11 17:49:36.291 18829 18859 I System.out:[MON]创建设备完成,添加完成

12-11 17:49:36.451 18829 18842我是艺术:背景粘性并发标记扫描GC释放4094(153KB)AllocSpace对象,1(40KB)LOS对象,3%免费,7MB / 7MB,暂停6.418ms总计26.688 MS

12-11 17:49:36.501 18829 18842我是艺术:背景部分并发标记扫描GC释放3710(130KB)AllocSpace对象,6(534KB)LOS对象,35%免费,7MB / 11MB,暂停6.120ms 48.173 MS

12-11 17:49:36.581 18829 18859 E art:dlopen(" /vendor/lib/libjavafx_font.so",RTLD_LAZY)失败:dlopen失败:library" / vendor / lib /libjavafx_font.so"找不到

12-11 17:49:36.581 18829 18859 E art:dlopen(" /system/lib/libjavafx_font.so",RTLD_LAZY)失败:dlopen失败:library" / system / lib /libjavafx_font.so"找不到

12-11 17:49:36.581 18829 18859 D houdini:[18859]为Native Bridge为ClassLoader添加了共享库/data/app/hidralab.Hidrasmartcm_app_2-2/lib/arm/libjavafx_font.so。

12-11 17:49:36.591 18829 18859 W System.err:正在加载FontFactory com.sun.javafx.font.freetype.FTFactory

12-11 17:49:36.591 18829 18859 W System.err:Subpixel:enabled

12-11 17:49:36.601 18829 18859 E art:dlopen(" /vendor/lib/libjavafx_font_freetype.so",RTLD_LAZY)失败:dlopen失败:library" / vendor / lib /libjavafx_font_freetype.so"找不到

12-11 17:49:36.601 18829 18859 E art:dlopen(" /system/lib/libjavafx_font_freetype.so",RTLD_LAZY)失败:dlopen失败:library" / system / lib /libjavafx_font_freetype.so"找不到

12-11 17:49:36.601 18829 18859 D houdini:[18859]为Native Bridge为ClassLoader添加了共享库/data/app/hidralab.Hidrasmartcm_app_2-2/lib/arm/libjavafx_font_freetype.so。

12-11 17:49:36.611 18829 18859 W System.err:Freetype2已加载(版本2.5.0)

12-11 17:49:36.611 18829 18859 W System.err:LCD支持已启用

12-11 17:49:36.671 18829 18859艺术:在Android 4.1之前,方法void com.sun.javafx.scene.transform.TransformUtils $ ImmutableTransform.ensureCanTransform2DPoint()会错误地覆盖javafx中的package-private方法.scene.transform.Transform

12-11 17:49:37.351 18829 18859 W art:在Android 4.1之前,方法double javafx.scene.text.TextFlow.computeChildPrefAreaHeight(javafx.scene.Node,javafx.geometry.Insets)会错误地覆盖包javafx.scene.layout.Region中的-private方法

12-11 17:49:37.351 18829 18859 W art:在Android 4.1之前,方法double javafx.scene.text.TextFlow.computeChildPrefAreaWidth(javafx.scene.Node,javafx.geometry.Insets)会错误地覆盖包javafx.scene.layout.Region中的-private方法

12-11 17:49:37.521 662 662 D wpa_supplicant:wlan0:控制界面命令' SIGNAL_POLL'

12-11 17:49:37.681 18829 18857 I System.out:max rectangle texture cell size = 62

12-11 17:49:37.731 18829 18857 I System.out:wrap rectangle texture = 2 x 2

12-11 17:49:37.741 18829 18857 I System.out:ES2ResourceFactory:Prism - createStockShader:AlphaTexture_Color.frag

12-11 17:49:37.761 18829 18857 I System.out:ES2ResourceFactory:Prism - createStockShader:FillRoundRect_Color.frag

12-11 17:49:37.781 18829 18857 I System.out:ES2ResourceFactory:Prism - createStockShader:FillRoundRect_LinearGradient_PAD.frag

12-11 17:49:37.801 18829 18857 I System.out:ES2ResourceFactory:Prism - createStockShader:Solid_TextureRGB.frag

12-11 17:49:37.811 18829 18857 I System.out:ES2ResourceFactory:Prism - createStockShader:Mask_TextureSuper.frag

12-11 17:49:40.531 662 662 D wpa_supplicant:wlan0:控制界面命令' SIGNAL_POLL'

我修改项目的部分位于存储库中: https://github.com/MarianLN/Pruebas-JAVAFXPORTS-ANDROID/tree/master

项目文件夹的一部分和项目的build.gradle。

它会出现什么错误?提前谢谢。

1 个答案:

答案 0 :(得分:0)

根据我在系统中安装的第25版,我刚刚修改了build.gradle文件。

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'me.tatarka:gradle-retrolambda:3.7.0'
        classpath 'com.android.tools.build:gradle:2.2.3'
        classpath 'org.javafxports:jfxmobile-plugin:1.3.10'
    }
}
repositories {
    jcenter()
}
apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion '25.0.3'
    dexOptions {
        preDexLibraries = false
        additionalParameters = ['--core-library']
    }
    defaultConfig {
        applicationId "hidralab.Hidrasmartcm_app_2"
        minSdkVersion 16
        targetSdkVersion 16
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }

    sourceSets {
        main {
            jniLibs.srcDir file("/Users/.../.gradle/caches/modules-2/files-2.1/org.javafxports/dalvik-sdk/8.60.8/.../unpacked/dalvik-sdk/rt/lib")
            assets.srcDirs = ['assets']
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

dependencies {
    compile "com.android.support:appcompat-v7:25.3.1"
    compile 'com.android.support:design:25.3.1'
    testCompile 'junit:junit:4.12'
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile fileTree(include: ['*.jar'], dir: '/Users/.../.gradle/caches/modules-2/files-2.1/org.javafxports/dalvik-sdk/8.60.8/.../unpacked/dalvik-sdk/rt/lib/ext')
    compile 'com.google.android.gms:play-services-maps:11.0.4'
}

使用Android 7.1.1部署到Nexus 6后,第二项活动显示正常,并且一直保持。

由于您使用的是主JavaFX活动和纯粹的原生Android活动,因此返回的唯一方法是使用后退按钮,这也有效。

作为一个可能的建议:您是否考虑过使用Gluon Mobile来正确管理不同的视图?它可以与Gluon Maps轻松组合(通过OpenStreetMap),也可以在iOS上使用。

'kokos'项目更像是一个概念证明,我认为从长远来看,在Android项目中在移动设备上创建JavaFX应用程序并不容易。如果您真的需要JavaFX,那么请考虑使用JavaFXPorts / Gluon Mobile的纯JavaFX应用程序。现有的Android和iOS本机框架可以轻松组合(请参阅Charm Down库以获取现有服务here)。