Android debug build crash loop "Failed to open log file"

Post Reply
burninglizardteeth
New member
Posts: 3
Joined: Fri Jan 24, 2020 01:57

Android debug build crash loop "Failed to open log file"

by burninglizardteeth » Post

I've gone through the instructions on https://dev.minetest.net/Android and successfully built a debug apk, but when I install with adb install then try to run, I get the following in logcat

Code: Select all

02-15 18:43:58.410 11669 11703 E Minetest: 2020-02-15 18:43:58: ERROR[Main]: Uncaught exception in main thread: Failed to open log file /storage/emulated/0/Minetest/debug.txt: Permission denied
I've tried deleting the file and letting it be created on startup, but it doesn't get created, same error. Seems like it doesn't even have permission to access the folder.

My Android device isn't rooted, so I haven't been able to figure out how to give it permission to create that log file. Anyone figure this out?

User avatar
Miniontoby
Member
Posts: 616
Joined: Fri Mar 01, 2019 19:25
GitHub: Miniontoby
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: Android debug build crash loop "Failed to open log file"

by Miniontoby » Post

If you want to have minetest on android just go to Google Play Store and search "minetest" and then you can download I know
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

burninglizardteeth
New member
Posts: 3
Joined: Fri Jan 24, 2020 01:57

Re: Android debug build crash loop "Failed to open log file"

by burninglizardteeth » Post

Miniontoby wrote:If you want to have minetest on android just go to Google Play Store and search "minetest" and then you can download I know
Thanks but I'm aware of that, I'm trying to build and run it so that I can start coding on it. No point in testing new changes when I'm failing to get the base to build and run properly.

doctor_ew
New member
Posts: 3
Joined: Sun Feb 16, 2020 16:25
GitHub: v1nsai
In-game: doctor_ew

Re: Android debug build crash loop "Failed to open log file"

by doctor_ew » Post

I think this is because the way external write access is handled in Android 10 has changed. When I first install my Minetest debug apk it asks for permission to access files on the device, which I allow, but then it doesn't seem to be getting or using the permission properly.

I tried setting the min, max and target SDK version in the AndroidManifest.xml but that doesn't seem to do anything. Still digging.

EDIT:
I was close, it was indeed because I'm using Android 10, but setting android:requestLegacyExternalStorage="true" in the manifest gives backwards compatibility. Got it all working now and opened a PR in GitHub.

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests