From f476082f9c847bbcc479ed499bf85ee490f0394b Mon Sep 17 00:00:00 2001 From: Michael Akinde Date: Sun, 15 May 2022 10:13:15 +0200 Subject: [PATCH 1/2] Fixed a line of code using a construct that is not available in early Android SDK versions. This causes crashes in Android with SDK < 24. --- gradle.properties | 2 +- src/main/java/com/bladecoder/ink/runtime/Flow.java | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 04b8b0b..d1df1ee 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ # Matching Ink v1.0.0 -version=1.0.0 +version=1.0.0-micabytes.1 diff --git a/src/main/java/com/bladecoder/ink/runtime/Flow.java b/src/main/java/com/bladecoder/ink/runtime/Flow.java index 484b357..74b8057 100644 --- a/src/main/java/com/bladecoder/ink/runtime/Flow.java +++ b/src/main/java/com/bladecoder/ink/runtime/Flow.java @@ -30,7 +30,13 @@ public Flow(String name, Story story, HashMap jObject) throws Ex // choiceThreads is optional Object jChoiceThreadsObj; - jChoiceThreadsObj = jObject.getOrDefault("choiceThreads", null); + // This does not work in Android with SDK < 24 + //jChoiceThreadsObj = jObject.getOrDefault("choiceThreads", null); + if (jObject.containsKey("choiceThreads")) { + jChoiceThreadsObj = jObject.get("choiceThreads"); + } else { + jChoiceThreadsObj = null; + } loadFlowChoiceThreads((HashMap) jChoiceThreadsObj, story); } From ae25f65a092d9678874779ff254771641f6bd813 Mon Sep 17 00:00:00 2001 From: MicaBytes Date: Mon, 19 Sep 2022 22:42:09 +0200 Subject: [PATCH 2/2] Update gradle.properties --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index d1df1ee..04b8b0b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ # Matching Ink v1.0.0 -version=1.0.0-micabytes.1 +version=1.0.0