compile and build gluon mobile app for desktop

前端 未结 2 1213
后悔当初
后悔当初 2020-12-12 01:15

we have

desktopRuntime \'org.xerial:sqlite-jdbc:3.15.1\'

in gradle file. i build project but my zip file dont have this file in lib folder

相关标签:
2条回答
  • 2020-12-12 01:34

    The problem with the distZip or jar gradle tasks is they miss to include desktop dependencies.

    When deploying to desktop you can change temporary desktopRuntime to runtime, so they will be included, as Ladislav Török suggests, but then you should undo the change so that dependency isn't included in the mobile deployment.

    If you want to have a working zip, we have to modify the distZip task, to include the desktop dependencies in the lib folder, and also to include them in the class path (so they are also added to the scripts in the bin folder). Include this in your build.gradle script:

    startScripts {
        classpath += configurations.desktopRuntime
    }
    
    distZip {
        into("$project.name/lib") {
            from configurations.desktopRuntime
        }
    }
    

    You can also solve the issue by using the shadowJar, providing you include the desktop dependencies, to create an executable fat jar, like in this solution.

    0 讨论(0)
  • 2020-12-12 01:38
    Try next steps:
    

    1.

        dependencies {
          compile 'org.xerial:sqlite-jdbc:3.15.1'
          runtime 'org.xerial:sqlite-jdbc:3.15.1'
        }
    
    1. Go to "Files" tab in NetBeans IDE -> your_project -> build -> libs and here add your lib some as sqlite-jdbc.jar
    0 讨论(0)
提交回复
热议问题