I'm using llama-pack as a library in a Node.js project. When I call
twaGenerator.createTwaProject("d:/temp/llama", twaManifest);
I get lots of errors saying a file or directory doesn't exist, e.g.
(node:33288) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, mkdir 'd:\temp\llama\app\src\main\res\mipmap-mdpi'
The end result is the TWA project generation doesn't succeed; it's missing a bunch of files. Looking in the target directory, I see an /app folder with a build.gradle in it, but nothing else; there is no /app/src folder, nor any /gradle folder.
I can workaround this by manually creating these directories; at which point all the files get generated. But I'm wondering why the files aren't generated in the first place; the TwaGenerator code looks like it should be creating these directories.
My full test code:
router.get('/test', async function (req, res) {
const rawManifestArgs = {
packageId: "com.messianicradio",
host: "https://messianicradio.com",
name: "Chavah",
themeColor: "#2f3d58",
navigationColor: "#2f3d58",
backgroundColor: "#2f3d58",
startUrl: "/",
iconUrl: "https://messianicradio.com/images/chavah512x512.png",
maskableIconUrl: "https://messianicradio.com/images/chavah-maskable1000x1000.png",
appVersion: '1.0.0',
signingKey: {
path: "C:/Users/judah/Documents/my-release-key.keystore",
alias: 'alias_name',
},
useBrowserOnChromeOS: true,
splashScreenFadeOutDuration: 300,
enableNotifications: false,
shortcuts: "[]",
};
const twaGenerator = new TwaGenerator();
const twaManifest = new TwaManifest(rawManifestArgs);
const targetDirectory = "d:\\temp\\llama";
await twaGenerator.createTwaProject(targetDirectory, twaManifest);
});