mlc-llm icon indicating copy to clipboard operation
mlc-llm copied to clipboard

启动app时报错(class文件空指针异常)

Open Myl-Ma opened this issue 6 months ago • 0 comments

🐛 Bug

To Reproduce

Steps to reproduce the behavior: 1.在MLCChat目录下用Androidstudio打开该项目 2.点击gradle的下载按钮,此时全部下载完成,没有报错 3.点击绿色的三角形:run,开始报错

Expected behavior

Image Image 开始报错: 1.> Task :app:compileDebugKotlin FAILED e: This version (1.5.11) of the Compose Compiler requires Kotlin version 1.9.23 but you appear to be using Kotlin version 1.9.22 which is not known to be compatible. Please consult the Compose-Kotlin compatibility map located at https://developer.android.com/jetpack/androidx/releases/compose-kotlin to choose a compatible version pair (or `suppressKotlinVersionCompatibilityCheck` but don't say I didn't warn you!).

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

  • What went wrong: Execution failed for task ':app:mergeLibDexDebug'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Failed to transform debug (project :mlc4j) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, com.android.build.api.attributes.AgpVersionAttr=7.4.0, com.android.build.api.attributes.BuildTypeAttr=debug, com.android.build.gradle.internal.attributes.VariantAttr=debug, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=26, org.gradle.category=library, org.gradle.jvm.environment=android, org.gradle.libraryelements=classes, org.gradle.usage=java-runtime, org.jetbrains.kotlin.platform.type=androidJvm}. This version (1.5.11) of the Compose Compiler requires Kotlin version 1.9.23 but you appear to be using Kotlin version 1.9.22 which is not known to be compatible. Please consult the Compose-Kotlin compatibility map located at https://developer.android.com/jetpack/androidx/releases/compose-kotlin to choose a compatible version pair (or suppressKotlinVersionCompatibilityCheck but don't say I didn't warn you!).

Execution failed for DexingNoClasspathTransform: D:\mlc-llm\android\MLCChat\dist\lib\mlc4j\build\intermediates\runtime_library_classes_dir\debug. > Error while dexing.

Try:

Run with --info or --debug option to get more log output. Run with --scan to get full insights. Get more help at https://help.gradle.org. (具体信息在附件中)

ml.txt

2.> Task :app:writeDebugSigningConfigVersions UP-TO-DATE

Transform debug (project :mlc4j) with DexingNoClasspathTransform AGPBI: {"kind":"error","text":"java.lang.NullPointerException: Cannot invoke "String.length()" because "" is null","sources":[{"file":"D:\mlc-llm\android\MLCChat\dist\lib\mlc4j\build\intermediates\runtime_library_classes_dir\debug\ai\mlc\mlcllm\JSONFFIEngine$1.class"}],"tool":"D8"}

3.java.lang.NullPointerException: Cannot invoke "String.length()" because "" is null

4.:app:mergeLibDexDebug

5.Cannot invoke "String.length()" because "" is null

Environment

  • Platform (e.g. WebGPU/Vulkan/IOS/Android/CUDA):Android
  • Operating system (e.g. Ubuntu/Windows/MacOS/...):在Ubuntu中执行了package命令,在windows中的Androidstudio中打开项目(并且更改了模型路径),但Ubuntu中的Androidstudio还是报相同的错误!
  • Device (e.g. iPhone 12 Pro, PC+RTX 3090, ...) vivo Y33
  • How you installed MLC-LLM (conda, source):conda
  • How you installed TVM-Unity (pip, source):pip
  • Python version (e.g. 3.10): 3.10

Additional context

Myl-Ma avatar Apr 12 '25 08:04 Myl-Ma