0

Last month i build many gluon apps for android mobile. They were working. But now when i build apk using same way they are not working, and generating this error on android mobile Unfortunately GluonSingleViewApp has stopped. I searched about two weeks on this problem but not find any solutions. Now i need your help community.

After building many projects including samples provided by gluon, netbeans gluon sample projects and falilure i followed simple approach.

In netbeans i make simple new GluonSingleView app and apply task>android>androidInstall.

When i run app in mobile it shows error Unfortunately GluonSingleViewApp has stopped.

I do not changed any thing this my my gradle.build file.

  buildscript {
      repositories {
          jcenter()
      }
      dependencies {
          classpath 'org.javafxports:jfxmobile-plugin:1.3.12'
      }
  }

  apply plugin: 'org.javafxports.jfxmobile'

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

  mainClassName = 'com.gluonsingleviewapp.GluonSingleViewApp'

  dependencies {
      compile 'com.gluonhq:charm:5.0.0'
  }

  jfxmobile {
      downConfig {
          version = '3.8.0'
          // Do not edit the line below. Use Gluon Mobile Settings in your project context menu instead
          plugins 'display', 'lifecycle', 'statusbar', 'storage'
      }
      android {
          manifest = 'src/android/AndroidManifest.xml'
      }
  }

This is the LogCat generated by Android Monitor

FATAL EXCEPTION: main
Process: com.gluonsingleviewapp, PID: 14831
java.lang.RuntimeException: Did not create correct launcher.
    at javafxports.android.FXDalvikEntity.getLauncherAndLaunchApplication(FXDalvikEntity.java:165)
    at javafxports.android.FXDalvikEntity.surfaceCreated(FXDalvikEntity.java:304)
    at android.view.SurfaceView.updateWindow(SurfaceView.java:712)
    at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:209)
    at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:1014)
    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2510)
    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1437)
    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7397)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:920)
    at android.view.Choreographer.doCallbacks(Choreographer.java:695)
    at android.view.Choreographer.doFrame(Choreographer.java:631)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:906)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:158)
    at android.app.ActivityThread.main(ActivityThread.java:7224)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by: java.lang.RuntimeException: Could not find /javafx.platform.properties on classpath.
    at javafxports.android.DalvikLauncher.launchApp(DalvikLauncher.java:81)
    at javafxports.android.FXDalvikEntity.getLauncherAndLaunchApplication(FXDalvikEntity.java:162)
    ... 18 more
fabian
  • 80,457
  • 12
  • 86
  • 114
  • Can you post a more complete stacktrace? Also, make sure you are running on Java 8. – José Pereda Nov 12 '18 at 09:00
  • I am new to stackoverflow! Thanks for comments!!! I am using java 1.8.0_192. My problem is some times simple gluon project successfully build and run on android device but manjor time fails on android device. How can i complete stacktrace? I am using window 8.1, netbeans ide and gradle 4.10.2. Thanks again... – CTO - Abid Maqbool Nov 13 '18 at 13:30
  • Last day i solved my problem at my own. Actually i am missing some thing. My all the projects builds successfully before using mysql jdbc library. When i used mysql lib in my project it generated a problem that `jfxrt.jar` is coppying duplicate in `dalvik-sdk` sub directory. I delete this file and close the folder. After this when i build apk in netbeans it successfully build but cusses error which i mention in original above post. Actualy this jar file is necessary for apk for running. Now after a long journey of searching on the web and using my own experience i solved my problem. – CTO - Abid Maqbool Nov 15 '18 at 12:27
  • Good that you solved it. If you are using mysql, I'd suggest you have a look at [this](https://stackoverflow.com/a/33599574/3956070) and [this](https://gluonhq.com/embedding-database-cross-platform-projects/). – José Pereda Nov 15 '18 at 12:30
  • The solutions is that i delete the dalvik directory in .gradle folder under user folder. and then regenerate apk file it builds successfully, and working in my mobile. A want to mention a problem in jfxmobile-problem that may new comers face that is when use mysql jdbc library use should add some lines in android plugin. as this is my gradle.build file. – CTO - Abid Maqbool Nov 15 '18 at 12:40
  • ``` dependencies { compile 'mysql:mysql-connector-java:8.0.13' } jfxmobile { android { manifest = 'src/android/AndroidManifest.xml' packagingOptions { exclude 'META-INF/INDEX.LIST' //use this if your want to use mysql lib } //it causes to prevent duplicate files `jfxtr.jar` dexOptions { javaMaxHeapSize "4g" //if your app uses max heap } } } ``` – CTO - Abid Maqbool Nov 15 '18 at 12:42

0 Answers0