https://github.com/GunroarCannon/love-a ... /game.love
https://github.com/GunroarCannon/love-android
When I add my game to the assets folder of love-android to build my own android APK like the wiki says it just turns out the same with the artifacts not recognising my game.
On-top of that I also included lua-https lib, but both my game.love and the lib so file don't show in the unzipped apk. Both release and debug versions. Any help please?
Problem packaging game.love in love-android
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- Gunroar:Cannon()
- Party member
- Posts: 1141
- Joined: Thu Dec 10, 2020 1:57 am
Re: Problem packaging game.love in love-android
errm... no, not this way. instead of putting your game.love file, put its contents instead this way:
Almost forgot it, i'm using a modified version of love-webp.lua from https://github.com/ImagicTheCat/love-webp and i added a function to load libwebp.so from android
instead of:
i'm using:
It loads the labrary this way:
valid for Love2D v11.4 onwards. Note a libwebp.so file in this example used to load WebP images, the path of this library is just lib/libwebp.so to load it.Almost forgot it, i'm using a modified version of love-webp.lua from https://github.com/ImagicTheCat/love-webp and i added a function to load libwebp.so from android
instead of:
Code: Select all
local ffi = require("ffi")
local webp = ffi.load("webp")
local webpdemux = ffi.load("webpdemux")
Code: Select all
local ffi = require("ffi")
local ls = require('love.system')
local function loadwebplib()
local osString = ls.getOS()
local lib
local is64bit = ffi.abi("64bit")
local hashardfloat = ffi.abi("hardfp")
local checkarch = ffi.arch
if osString == 'Windows' then
lib = "lib/webp.dll"
elseif osString == 'Android' then
lib = "lib/libwebp.so"
else
lib = love.errorhandler("System not supported: "..osString)
end
print("Using: "..lib)
local filename = love.path.leaf(lib)
if not love.filesystem.getInfo(filename) then
local libfile = assert(love.filesystem.read(lib))
assert(love.filesystem.write(filename, libfile))
end
return ffi.load(love.filesystem.getSaveDirectory() .. '/' .. filename)
end
local webp = loadwebplib()
- Get what OS is using
- select the library path
- copy the library onto the save directory (on android is /storage/emulated/0//Android/data/org.love2d.android/files/save/ along with the assets if apply)
- load the library through ffi.load()
- Gunroar:Cannon()
- Party member
- Posts: 1141
- Joined: Thu Dec 10, 2020 1:57 am
Re: Problem packaging game.love in love-android
Weird, according to the official love-android...
But by your logic of putting main.lua in res does that mean I could put game.love there? (My game has a looot of files, plus I can't drag and drop).If you want to put your game inside the APK, you
can either:
1. Put all your games in app/src/embed/assets
such that your main.lua path is app/src/
embed/assets/main.lua ; or
2. Put your zipped *.love in app/src/embed/
assets with name game.love
And can ffi really load so files for Android??
Re: Problem packaging game.love in love-android
no, on res folder no. the assets folder contains the main.lua file.Gunroar:Cannon() wrote: ↑Tue Oct 08, 2024 8:17 am But by your logic of putting main.lua in res does that mean I could put game.love there? (My game has a looot of files, plus I can't drag and drop).
By other hand, if you have lots of files of your game (i assume images, sprites or sound) ireccomend to pack these to a zip file and use mounting (https://love2d.org/wiki/love.filesystem.mount) to a mountpoint
yes, you can. I can load WebP images on android with libwebp.so, but was so quite hard to find a suitable version, make sure the library you want to use is compiled on at least armv7 in order to run on all phones except very old ones (they use armv6), if you put an armv8 one, it only run on 64-bit androidAnd can ffi really load so files for Android??
Maybe on github you find a compiled binary of the .so
Who is online
Users browsing this forum: Bing [Bot] and 4 guests