B4J Question Mac JavaPackager Issues

dieterp

Active Member
Licensed User
Longtime User
We're having an issue getting the B4J Packager to open the app after building it on a mac. Here are the steps taken:
  1. Everything works fine with the build and packaging of the app
  2. The screen then opens that prompts you to copy the application into the Mac applications folder. That all works fine (It did prompt something about installing xCode. Is this required)?
  3. When we then try to run the app, the app icon appears at the bottom of the Mac by all the icons, bounces around a few times and then disappears (Note we haven't set an icon for the app. Will it fail without an icon)?
The OSX version running on the Mac is 10.13.1. What I've also noticed though is that when we try to run the myApp.jar version on the Mac device we get the error 'The Java jar file "myApp.jar" could not be launched. Check the console for possible error messages'. I'm a noob on Mac, so where/how would I check the console, or can someone possibly suggest what the above issues could entail? We do have the java jdk installed on the machine.
 

dieterp

Active Member
Licensed User
Longtime User
OK. It seems like the issue is that it's not finding the Sqlite DB that the app uses. Here is the error from the Terminal:

java.io.FileNotFoundException: cricketdb.db

I use the following code to copy the database to the file.DirApp folder:
B4X:
If File.Exists(File.DirApp, "cricketdb.db") = False Then
        File.Copy(File.DirAssets, "cricketdb.db", File.DirApp, "cricketdb.db")
        Log("File was copied to: " & File.DirApp)
    End If
Is File.DirApp the correct location to copy to, or should I be using something else? Also, should cricketdb.db be in the 'Files' folder or in the 'Objects' folder?

Update: I hadn't uploaded the cricketdb.db file to the assets folder, so after doing that and changing the location to File.DirData it seems to now be working. Is File.DirData the correct location to use though?
 
Last edited:
Upvote 0
Top