当我使用 IntelliJ 运行应用程序时,图像是可见的,但在移植到 Android(6.0 和 4.4.2)时却不是。Image 对象使用 URL(网站)实例化。
日志猫
W/linker: /data/app/com.xxxx.xxxx.scan.application.scanner-2/lib/arm/libjavafx_iio.so: is missing DT_SONAME will use basename as a replacement: "libjavafx_iio.so"
W/System.err: java.io.IOException: Improper call to JPEG library in state 200
//##The error below is thrown at the new Image(url) operation
W/System.err: at com.xxxx.xxxx.scan.application.scanner.controllers.ProductController.updateImageView(ProductController.java:117)
加载图像的方法
private synchronized void updateImageView(ProductEntry product) {
if (product.getExtraInfo() != null && product.getExtraInfo().size() > 0) {
ExtraInfo extraInfo = product.getExtraInfo().get(0);
figLabel.setText(extraInfo.getInfo());
image = new Image(extraInfo.getUrl());
imageView.fitHeightProperty().bind(pane.heightProperty());
imageView.fitWidthProperty().bind(pane.widthProperty());
imageView.setPreserveRatio(true);
// imageView.setSmooth(true);
// imageView.setCache(true);
imageView.setImage(image);
}
}
构建.gradle
buildscript {
repositories {
jcenter()
maven {
url 'http://xxxx.xxxx.com:8080/artifactory/plugins-release'
}
}
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:1.0.8'
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:+"
}
}
apply plugin: 'org.javafxports.jfxmobile'
apply plugin: "com.jfrog.artifactory"
artifactory {
contextUrl = "${artifactory_contextUrl}"
publish {
repository {
repoKey = 'libs-release-local'
maven = true
}
}
resolve {
repository {
repoKey = 'libs-release'
maven = true
}
}
}
repositories {
jcenter()
mavenLocal()
}
mainClassName = 'com.essers.pxl2016.scan.application.scanner.MainApplication'
dependencies {
compile(group: 'com.essers.pxl2016', name: 'scan-server-definition', version: '0.0.1-SNAPSHOT')
compile(group: 'com.xxxx.xxxx', name: 'client', version: '1.0-SNAPSHOT')
compile('com.google.code.gson:gson:2.2.4')
testCompile "junit:junit:4.12"
}
jfxmobile {
javafxportsVersion = '8.60.7'
ios {
forceLinkClasses = ['com.xxxx.xxxx.scan.**.*']
}
android {
applicationPackage = 'com.xxxx.xxxx.scan.application.scanner'
}
}
test {
exclude 'com/xxxx/xxxx/scan/application/scanner/**'
}
src/main/resources/java.custom.properties
# Solves crash when clicking the menu.
monocle.stackSize=128000
亲切的问候