Here's the build.gradle I have used in my project , am getting this Exception after including Datafx as dependancy in my project.This is the github link to my project.The Tasks that I have tried
1.gradle clean
2.clearing cache
3.I have reffered this post
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:1.3.5'
}
}
apply plugin: 'org.javafxports.jfxmobile'
repositories {
jcenter()
maven {
url 'http://nexus.gluonhq.com/nexus/content/repositories/releases'
}
}
mainClassName = 'com.appliction.Main'
dependencies {
compile 'com.gluonhq:glisten-afterburner:1.2.0'
compile 'de.jensd:fontawesomefx-materialicons:2.2.0-5'
compileNoRetrolambda 'com.jfoenix:jfoenix:1.5.0'
compile 'io.datafx:datafx:8.0.1'
compile 'io.datafx:flow:8.0.1'
compile 'io.datafx:injection:8.0.1'
}
jfxmobile {
downConfig {
version = '3.2.4'
plugins 'display', 'lifecycle', 'local-notifications', 'runtime-args', 'statusbar', 'storage'
}
android {
minSdkVersion '3'
compileSdkVersion '26'
targetSdkVersion '26'
manifest = 'src/android/AndroidManifest.xml'
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
}
ios {
infoPList = file('src/ios/Default-Info.plist')
forceLinkClasses = [
'com.application.**.*',
'com.gluonhq.**.*',
'javax.annotations.**.*',
'javax.inject.**.*',
'javax.json.**.*',
'org.glassfish.json.**.*'
]
}
}
Am getting this Exception at performing this task gradle:android
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':apkDebug'.
> com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/services/io.datafx.controller.context.resource.AnnotatedControllerResourceType
File 1: C:\Users\guru\.gradle\caches\modules-2\files-2.1\io.datafx\flow\8.0.1\eb5efe930962872fd9f27c7c751b806ab3965bca\flow-8.0.1.jar
File 2: C:\Users\guru\.gradle\caches\modules-2\files-2.1\io.datafx\flow\8.0.1\eb5efe930962872fd9f27c7c751b806ab3965bca\flow-8.0.1.jar
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Based on the answers provided to the previous questions,I tried this one that is
android
{
manifest = 'src/android/AndroidManifest.xml'
packagingOptions {
exclude 'META-INF/services/io.datafx.controller.context.resource.AnnotatedControllerResourceType'
}
}
and the task gradle:android
is completed successfully, but when installing this app to my phone am getting the problem .On opening the App it gives a Blank screen and no more.
And here's adb logcat
result I got on start of the Application.
891 I System.out: Init
10-02 11:42:16.160 8868 8891 W System.err: io.datafx.controller.flow.FlowException: io.datafx.controller.FxmlLoadException: java.lang.reflect.InvocationTargetException
10-02 11:42:16.164 8868 8891 W System.err: at io.datafx.controller.flow.FlowHandler.start(FlowHandler.java:143)
10-02 11:42:16.165 8868 8891 W System.err: at com.application.Main.start(Main.java:38)
10-02 11:42:16.165 8868 8891 W System.err: at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$145(LauncherImpl.java:863)
10-02 11:42:16.165 8868 8891 W System.err: at com.sun.javafx.application.LauncherImpl.access$lambda$8(LauncherImpl.java)
10-02 11:42:16.165 8868 8891 W System.err: at com.sun.javafx.application.LauncherImpl$$Lambda$9.run(Unknown Source)
10-02 11:42:16.165 8868 8891 W System.err: at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$158(PlatformImpl.java:326)
10-02 11:42:16.165 8868 8891 W System.err: at com.sun.javafx.application.PlatformImpl.access$lambda$6(PlatformImpl.java)
10-02 11:42:16.165 8868 8891 W System.err: at com.sun.javafx.application.PlatformImpl$$Lambda$7.run(Unknown Source)
10-02 11:42:16.165 8868 8891 W System.err: at com.sun.javafx.application.PlatformImpl.lambda$null$156(PlatformImpl.java:295)
10-02 11:42:16.165 8868 8891 W System.err: at com.sun.javafx.application.PlatformImpl.access$lambda$18(PlatformImpl.java)
10-02 11:42:16.165 8868 8891 W System.err: at com.sun.javafx.application.PlatformImpl$$Lambda$19.run(Unknown Source)
10-02 11:42:16.165 8868 8891 W System.err: at java.security.AccessController.doPrivileged(AccessController.java:52)
10-02 11:42:16.165 8868 8891 W System.err: at com.sun.javafx.application.PlatformImpl.lambda$runLater$157(PlatformImpl.java:294)
10-02 11:42:16.165 8868 8891 W System.err: at com.sun.javafx.application.PlatformImpl.access$lambda$5(PlatformImpl.java)
10-02 11:42:16.165 8868 8891 W System.err: at com.sun.javafx.application.PlatformImpl$$Lambda$6.run(Unknown Source)
10-02 11:42:16.165 8868 8891 W System.err: at com.sun.glass.ui.monocle.RunnableProcessor.runLoop(RunnableProcessor.java:93)
10-02 11:42:16.165 8868 8891 W System.err: at com.sun.glass.ui.monocle.RunnableProcessor.run(RunnableProcessor.java:52)
10-02 11:42:16.165 8868 8891 W System.err: at java.lang.Thread.run(Thread.java:818)
10-02 11:42:16.165 8868 8891 W System.err: Caused by: io.datafx.controller.FxmlLoadException: java.lang.reflect.InvocationTargetException
10-02 11:42:16.166 8868 8891 W System.err: at io.datafx.controller.ViewFactory.createByController(ViewFactory.java:180)
10-02 11:42:16.166 8868 8891 W System.err: at io.datafx.controller.flow.FlowHandler.start(FlowHandler.java:140)
10-02 11:42:16.166 8868 8891 W System.err: ... 17 more
10-02 11:42:16.166 8868 8891 W System.err: Caused by: java.lang.reflect.InvocationTargetException
10-02 11:42:16.166 8868 8891 W System.err: at java.lang.reflect.Method.invoke(Native Method)
10-02 11:42:16.166 8868 8891 W System.err: at io.datafx.controller.ViewFactory.createByController(ViewFactory.java:175)
10-02 11:42:16.166 8868 8891 W System.err: ... 18 more
10-02 11:42:16.166 8868 8891 W System.err: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.application.model.Model.getName()' on a null object reference
10-02 11:42:16.166 8868 8891 W System.err: at com.application.scenes.Homepresenter.init(Homepresenter.java:41)
10-02 11:42:16.166 8868 8891 W System.err: ... 20 more