Rosemoe / sora-editor

A multifunctional Android code editor library. (aka CodeEditor)
GNU Lesser General Public License v2.1
951 stars 142 forks source link

App crashes after calling setEditorLanguage method #587

Open FloydP opened 3 months ago

FloydP commented 3 months ago

I'm running the official demo on Android 8 and Android 10 versions, and when I call the editor.setEditorLanguage method to switch languages (based on textmate), the app crashes

log: FATAL EXCEPTION: AsyncAnalyzer-1 Process: com.lzy.iauto, PID: 32429 java.lang.NoSuchMethodError: No virtual method toArray(Ljava/util/function/IntFunction;)[Ljava/lang/Object; in class Ljava/util/ArrayList; or its super classes (declaration of 'java.util.ArrayList' appears in /apex/com.android.runtime/javalib/core-oj.jar) at org.eclipse.tm4e.core.internal.rule.RuleFactory._compilePatterns(RuleFactory.java:250) at org.eclipse.tm4e.core.internal.rule.RuleFactory.lambda$getCompiledRuleId$1(RuleFactory.java:101) at org.eclipse.tm4e.core.internal.rule.RuleFactory$$ExternalSyntheticLambda1.apply(D8$$SyntheticClass:0) at org.eclipse.tm4e.core.internal.grammar.Grammar.registerRule(Grammar.java:208) at org.eclipse.tm4e.core.internal.rule.RuleFactory.getCompiledRuleId(RuleFactory.java:53) at org.eclipse.tm4e.core.internal.rule.RuleFactory._compilePatterns(RuleFactory.java:209) at org.eclipse.tm4e.core.internal.rule.RuleFactory.lambda$getCompiledRuleId$1(RuleFactory.java:78) at org.eclipse.tm4e.core.internal.rule.RuleFactory$$ExternalSyntheticLambda1.apply(D8$$SyntheticClass:0) at org.eclipse.tm4e.core.internal.grammar.Grammar.registerRule(Grammar.java:208) at org.eclipse.tm4e.core.internal.rule.RuleFactory.getCompiledRuleId(RuleFactory.java:53) at org.eclipse.tm4e.core.internal.rule.RuleFactory._compilePatterns(RuleFactory.java:173) at org.eclipse.tm4e.core.internal.rule.RuleFactory.lambda$getCompiledRuleId$1(RuleFactory.java:78) at org.eclipse.tm4e.core.internal.rule.RuleFactory$$ExternalSyntheticLambda1.apply(D8$$SyntheticClass:0) at org.eclipse.tm4e.core.internal.grammar.Grammar.registerRule(Grammar.java:208) at org.eclipse.tm4e.core.internal.rule.RuleFactory.getCompiledRuleId(RuleFactory.java:53) at org.eclipse.tm4e.core.internal.rule.RuleFactory._compilePatterns(RuleFactory.java:173) at org.eclipse.tm4e.core.internal.rule.RuleFactory.lambda$getCompiledRuleId$1(RuleFactory.java:101) at org.eclipse.tm4e.core.internal.rule.RuleFactory$$ExternalSyntheticLambda1.apply(D8$$SyntheticClass:0) at org.eclipse.tm4e.core.internal.grammar.Grammar.registerRule(Grammar.java:208) at org.eclipse.tm4e.core.internal.rule.RuleFactory.getCompiledRuleId(RuleFactory.java:53) at org.eclipse.tm4e.core.internal.rule.RuleFactory._compilePatterns(RuleFactory.java:209) at org.eclipse.tm4e.core.internal.rule.RuleFactory.lambda$getCompiledRuleId$1(RuleFactory.java:78) at org.eclipse.tm4e.core.internal.rule.RuleFactory$$ExternalSyntheticLambda1.apply(D8$$SyntheticClass:0) at org.eclipse.tm4e.core.internal.grammar.Grammar.registerRule(Grammar.java:208) at org.eclipse.tm4e.core.internal.rule.RuleFactory.getCompiledRuleId(RuleFactory.java:53) at org.eclipse.tm4e.core.internal.grammar.Grammar._tokenize(Grammar.java:282) at org.eclipse.tm4e.core.internal.grammar.Grammar.tokenizeLine2(Grammar.java:271) at io.github.rosemoe.sora.langs.textmate.TextMateAnalyzer.tokenizeLine(TextMateAnalyzer.java:212) at io.github.rosemoe.sora.langs.textmate.TextMateAnalyzer.tokenizeLine(TextMateAnalyzer.java:67) at io.github.rosemoe.sora.lang.analysis.AsyncIncrementalAnalyzeManager$LooperThread.initialize(AsyncIncrementalAnalyzeManager.java:451) at io.github.rosemoe.sora.lang.analysis.AsyncIncrementalAnalyzeManager$LooperThread.handleMessage(AsyncIncrementalAnalyzeManager.java:473) at io.github.rosemoe.sora.lang.analysis.AsyncIncrementalAnalyzeManager$LooperThread.run(AsyncIncrementalAnalyzeManager.java:581)

FloydP commented 3 months ago

Sorry, I should have enabled desugar and I can close this issue

FloydP commented 3 months ago

Still not working I configured desugar and used Build | Build Bundle(s) / APK(s) | Build APK(s) to build the apk, the error still occurs.

hakobast commented 3 months ago

I get the same error with the latest version