0

enter image description here when i wrote in command gradlew android is pass and is give me the apk in jfxports/android/APKNAME.apk is fine when installed in my device and i put username password is not access to app

and when i wrote command gradlew androidinstall is give me this message enter image description here

this is my build.gradle:

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

apply plugin: 'org.javafxports.jfxmobile'

repositories {
jcenter()
}

dependencies {
compile 'mysql:mysql-connector-java:3.1.12'
}

mainClassName = 'main.Main'

jfxmobile {
android {
    applicationPackage = 'org.javafxports.ensemble'
    //        compileSdkVersion = 27
    //        manifest = 'src/android/AndroidManifest.xml'
    packagingOptions {
        exclude 'META-INF/INDEX.LIST'
    }
}
ios {
    forceLinkClasses = [ 'com.gluonhq.**.*', 'com.mysql.**.*']
    infoPList = file('src/ios/Default-Info.plist')
}
}

This is the logcat:

thanks Prof.Jose i edited can please check this error what is mean ?

  D/libc-netbsd(13661): [getaddrinfo]: hostname=127.0.0.1; servname=(null); cache_mode=(null), netid=0; mark=0
D/libc-netbsd(13661): [getaddrinfo]: ai_addrlen=0; ai_canonname=(null); ai_flags=4; ai_family=0
I/System.out(13661): [CDS]connect[/127.0.0.1:3306] tm:90
D/SocketClient(  252): SocketClient sendData done:
D/Posix   (13661): [Posix_connect Debug]Process org.javafxports.ensemble :3306
I/System.out(13661): [CDS]close[44851]
W/System.err(13661): Exception in Application start method
I/System.out(13661): QuantumRenderer: shutdown
D/Surface (13661): Surface::setBuffersDimensions(this=0xf49d3e00,w=720,h=1134)
I/BufferQueueProducer(  230): [SurfaceView](this:0x7faa7fd000,id:3976,api:1,p:13661,c:230) new GraphicBuffer needed
W/System.err(13661): java.lang.reflect.InvocationTargetException
I/[MALI][Gralloc](  230): Usage: 0xb00, format: 0x1 stride: 720 vertical_stride: 1134 size: 3265920
W/System.err(13661):    at java.lang.reflect.Method.invoke(Native Method)
W/System.err(13661):    at java.lang.reflect.Method.invoke(Method.java:372)
W/System.err(13661):    at javafxports.android.DalvikLauncher$1.run(DalvikLauncher.java:188)
W/System.err(13661):    at java.lang.Thread.run(Thread.java:818)
W/System.err(13661): Caused by: java.lang.RuntimeException: Exception in Application start method
W/System.err(13661):    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
W/System.err(13661):    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$138(LauncherImpl.java:182)
D/GraphicBuffer(  230): alloc, handle(0x7fa9998a60) (w:720 h:1134 s:720 f:0x1 u:0x000b00) err(0)
W/System.err(13661):    at com.sun.javafx.application.LauncherImpl.access$lambda$1(LauncherImpl.java)
W/System.err(13661):    at com.sun.javafx.application.LauncherImpl$$Lambda$2.run(Unknown Source)
W/System.err(13661):    ... 1 more
W/System.err(13661): Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/swing/JOptionPane;
W/System.err(13661):    at controller.MainmenuController.compilpebox(MainmenuController.java:172)
W/System.err(13661):    at controller.MainmenuController.initialize(MainmenuController.java:208)
W/System.err(13661):    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2548)
W/System.err(13661):    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441)
W/System.err(13661):    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3214)
W/System.err(13661):    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3175)
W/System.err(13661):    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3148)
W/System.err(13661):    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3124)
W/System.err(13661):    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3104)
W/System.err(13661):    at javafx.fxml.FXMLLoader.load(FXMLLoader.java:3097)
W/System.err(13661):    at main.Main.start(Main.java:17)
W/System.err(13661):    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$145(LauncherImpl.java:863)
W/System.err(13661):    at com.sun.javafx.application.LauncherImpl.access$lambda$8(LauncherImpl.java)
W/System.err(13661):    at com.sun.javafx.application.LauncherImpl$$Lambda$9.run(Unknown Source)
W/System.err(13661):    at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$158(PlatformImpl.java:326)
W/System.err(13661):    at com.sun.javafx.application.PlatformImpl.access$lambda$6(PlatformImpl.java)
D/GraphicBuffer(13661): register, handle(0xefc8a8e0) (w:720 h:1134 s:720 f:0x1 u:0x000b00)
W/System.err(13661):    at com.sun.javafx.application.PlatformImpl$$Lambda$7.run(Unknown Source)
W/System.err(13661):    at com.sun.javafx.application.PlatformImpl.lambda$null$156(PlatformImpl.java:295)
W/System.err(13661):    at com.sun.javafx.application.PlatformImpl.access$lambda$18(PlatformImpl.java)
W/System.err(13661):    at com.sun.javafx.application.PlatformImpl$$Lambda$19.run(Unknown Source)
W/System.err(13661):    at java.security.AccessController.doPrivileged(AccessController.java:52)
W/System.err(13661):    at com.sun.javafx.application.PlatformImpl.lambda$runLater$157(PlatformImpl.java:294)
W/System.err(13661):    at com.sun.javafx.application.PlatformImpl.access$lambda$5(PlatformImpl.java)
W/System.err(13661):    at com.sun.javafx.application.PlatformImpl$$Lambda$6.run(Unknown Source)
W/System.err(13661):    at com.sun.glass.ui.monocle.RunnableProcessor.runLoop(RunnableProcessor.java:92)
W/System.err(13661):    at com.sun.glass.ui.monocle.RunnableProcessor.run(RunnableProcessor.java:51)
W/System.err(13661):    ... 1 more
W/System.err(13661): Caused by: java.lang.ClassNotFoundException: Didn't find class "javax.swing.JOptionPane" on path: DexPathList[[zip file "/data/app/org.javafxports.ensemble-1/base.apk"],nativeLibraryDirectories=[/data/app/org.javafxports.ensemble-1/lib/arm, /vendor/lib, /system/lib]]
W/System.err(13661):    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
W/System.err(13661):    at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
W/System.err(13661):    at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
W/System.err(13661):    ... 27 more
W/System.err(13661):    Suppressed: java.lang.ClassNotFoundException: javax.swing.JOptionPane
W/System.err(13661):            at java.lang.Class.classForName(Native Method)
W/System.err(13661):            at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
W/System.err(13661):            at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
W/System.err(13661):            at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
W/System.err(13661):            ... 28 more
W/System.err(13661):    Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
waeliam88
  • 11
  • 6
  • See this [answer](https://stackoverflow.com/a/33599574/3956070), on how to solve the duplicate file and what mysql version is supported on mobile. Check this [post](http://gluonhq.com/embedding-database-cross-platform-projects/) on using SQLite instead. – José Pereda Aug 21 '18 at 15:24
  • thanks @jose pereda i do the same code now the message is come like this * What went wrong: Configured compileSdkVersion is invalid: 21 (C:\Users\wjbr\AppData\Local\Android\Sdk/platforms/android-21 * – waeliam88 Aug 21 '18 at 16:43
  • * What went wrong: Execution failed for task ':shrinkMultiDexComponents'. > java.io.FileNotFoundException: C:\Users\wjbr\Desktop\imene\build\javafxports\tmp\android\multi-dex\manifest_keep.txt (The system cannot find the file specified) * – waeliam88 Aug 22 '18 at 14:47
  • Please edit your question, post the changes you've made, and the new exceptions you get. Debugging via comments it is very hard an unproductive. – José Pereda Aug 22 '18 at 15:06
  • You haven't added the `packagingOptions` from the answer I mentioned, to exclude duplicate files – José Pereda Aug 22 '18 at 15:22
  • which packaging let me honest with you i try every build.gradle is not fix my issue i need just one favorite if yo have ready build.gradle put it here or send to me simple project or if you are not busy i will upload my project and i will give you the link Mr jose – waeliam88 Aug 22 '18 at 15:42
  • Dear Jose still i didn't solve my project plz if you can check my build.gradle is ok or not – waeliam88 Aug 25 '18 at 14:29
  • You have to use `packagingOptions`, as that allows you to exclude files: `packagingOptions { exclude 'META-INF/INDEX.LIST' }`, as posted [here](https://stackoverflow.com/a/33599574/3956070). – José Pereda Aug 25 '18 at 19:54
  • thanks i will call you from now prof.jose is working now when wrote in cmd graldew android is fine to converted to apk but when i installed and run it on my device is give crash then shutdown the app and when i try this command " gradlew androidinstall " is come this messege in last command * What went wrong: Execution failed for task ':androidInstall'. > com.android.builder.testing.api.DeviceException: java.lang.RuntimeException: No connected devices! * – waeliam88 Aug 26 '18 at 15:16
  • Have you enabled Developer options on your device? – José Pereda Aug 26 '18 at 15:53
  • yes sir i just enbaled now – waeliam88 Aug 26 '18 at 16:12
  • what i will do next prof jose – waeliam88 Aug 26 '18 at 16:34
  • Did you enable USB debugging from Developer options? Then plug your device and from a terminal go to Android sdk folder, enter platform-tools and run `adb logcat`. The first time you will be prompted from your computer, select the check and accepted it. If you successfully see the log of your device, then you can run `gradlew androidInstall`. After you install the app, you can also use `adb logcat` to see the exception that crahes the app, so you can try to solve it. – José Pereda Aug 26 '18 at 16:41
  • prof jose i got this error i edited my question – waeliam88 Aug 26 '18 at 18:59
  • prof jose i solved the problem it was from usb Cable thank you for help me i will try then i will give you feedback – waeliam88 Aug 27 '18 at 06:47
  • now is connected and installed on my device put the problem when i wrote the username and password is give me message and crash the app on my device – waeliam88 Aug 27 '18 at 07:33
  • Plug your device and from a terminal go to the Android SDK folder, enter platform-tools and run `adb logcat`. Run your application and when it crashes, check the terminal for an exception. Check that exception and see how you can solve it. – José Pereda Aug 27 '18 at 08:34
  • prof.jose i edited my question in up when i open my app on my device the app is become black screen and i wrote the command on platform-tools ad logcat the message attached in up – waeliam88 Aug 27 '18 at 14:01
  • There is nothing in your logcat related to the exception. Make sure you post the right part. Or add a link with the whole logcat. – José Pereda Aug 27 '18 at 14:06
  • Thanks @dear prof.jose i edited the logcat check my error – waeliam88 Aug 27 '18 at 15:38
  • The error is clear: you are using Swing classes, and those are not supported on mobile. Use only JavaFX UI components. – José Pereda Aug 27 '18 at 15:44
  • @genuies Prof. Jose Thank you so much is working perfectly I've tired you i'm sorry for that and I was proud to contact with you and will always take advice from you professor Jose Thank you so me i become a professional of your education #muchas _gracias_profJose – waeliam88 Aug 27 '18 at 16:57

0 Answers0