slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
17.55k stars 601 forks source link

error: failed to run custom build command for `i-slint-backend-android-activity v1.5.0` #5029

Closed Gibbz closed 7 months ago

Gibbz commented 7 months ago

Im trying to get a basic app with a single window running on android... Ive tried xbuild and cargo-apk, both with the same error.

Following the guides: https://snapshots.slint.dev/master/docs/rust/slint/android/#building-and-deploying https://github.com/rust-mobile/xbuild https://slint.dev/blog/slint-1.5-released

cargo.toml

[package]
name = "bike-aid"
version = "0.1.0"
authors = ["Bronson <bronsonmathews@gmail.com>"]
edition = "2021"
build = "build.rs"

[dependencies]
#slint = "1.5.0"
#i-slint-backend-android-activity = { version = "=1.5.0", features = ["native-activity"] }
slint = { version = "1.5", features = ["backend-android-activity-05"] }

[build-dependencies]
slint-build = "1.5"

[lib]
crate-type = ["cdylib", "lib"]

Log:


Caused by:
  process didn't exit successfully: `/home/bronson/Projects/bike-aid/bike-aid-app/target/debug/build/i-slint-backend-android-activity-d2158fa33b0a0fcf/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=ANDROID_HOME
  cargo:rerun-if-env-changed=JAVA_HOME

  --- stderr
  thread 'main' panicked at /home/bronson/.cargo/registry/src/index.crates.io-6f17d22bba15001f/i-slint-backend-android-activity-1.5.0/build.rs:87:9:
  Dex conversion failed: Error in /home/bronson/Projects/bike-aid/bike-aid-app/target/aarch64-linux-android/debug/build/i-slint-backend-android-activity-5584ba82a1156d20/out/java/dev/slint/android-activity/SlintInputView$1.class:
  java.lang.NullPointerException: Cannot invoke "String.length()" because "<parameter1>" is null
  Compilation failed with an internal error.
  Exception in thread "main" java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: /home/bronson/Projects/bike-aid/bike-aid-app/target/aarch64-linux-android/debug/build/i-slint-backend-android-activity-5584ba82a1156d20/out/java/dev/slint/android-activity/SlintInputView$1.class
        at com.android.tools.r8.utils.R0.a(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:126)
        at com.android.tools.r8.D8.main(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:5)
  Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: /home/bronson/Projects/bike-aid/bike-aid-app/target/aarch64-linux-android/debug/build/i-slint-backend-android-activity-5584ba82a1156d20/out/java/dev/slint/android-activity/SlintInputView$1.class
        at Version.fakeStackEntry(Version_8.2.2-dev.java:0)
        at com.android.tools.r8.M.a(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:5)
        at com.android.tools.r8.utils.R0.a(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:81)
        at com.android.tools.r8.utils.R0.a(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:32)
        at com.android.tools.r8.utils.R0.a(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:31)
        at com.android.tools.r8.utils.R0.b(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:2)
        at com.android.tools.r8.D8.a(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:26)
        at com.android.tools.r8.D8.b(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:13)
        at com.android.tools.r8.D8.a(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:24)
        at com.android.tools.r8.utils.R0.a(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:113)
        ... 1 more
  Caused by: java.lang.NullPointerException: Cannot invoke "String.length()" because "<parameter1>" is null
        at com.android.tools.r8.graph.u2.<init>(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:5)
        at com.android.tools.r8.graph.p1.c(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:3)
        at com.android.tools.r8.graph.Q3.b(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:10)
        at com.android.tools.r8.internal.Ga.a(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:873)
        at com.android.tools.r8.graph.T3.a(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:44)
        at com.android.tools.r8.utils.R0.a(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:129)
        at com.android.tools.r8.utils.R0.a(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:130)
        at com.android.tools.r8.utils.R0.a(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:128)
        at com.android.tools.r8.graph.T3.b(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:2)
        at com.android.tools.r8.dex.a.a(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:27)
        at java.base/java.util.concurrent.ForkJoinTask$AdaptedInterruptibleCallable.compute(ForkJoinTask.java:1689)
        at java.base/java.util.concurrent.ForkJoinTask$InterruptibleTask.exec(ForkJoinTask.java:1641)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:507)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1491)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:2073)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:2035)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:187)
        Suppressed: java.lang.RuntimeException: java.util.concurrent.ExecutionException: com.android.tools.r8.utils.T0: java.lang.NullPointerException: Cannot invoke "String.length()" because "<parameter1>" is null
                at com.android.tools.r8.dex.c.a(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:60)
                at com.android.tools.r8.dex.c.a(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:9)
                at com.android.tools.r8.dex.c.a(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:8)
                at com.android.tools.r8.D8.a(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:29)
                at com.android.tools.r8.D8.d(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:17)
                at com.android.tools.r8.D8.c(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:1)
                at com.android.tools.r8.utils.R0.a(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:28)
                at com.android.tools.r8.utils.R0.b(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:2)
                at com.android.tools.r8.D8.a(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:26)
                at com.android.tools.r8.D8.b(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:13)
                at com.android.tools.r8.D8.a(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:24)
                at com.android.tools.r8.utils.R0.a(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:113)
                at com.android.tools.r8.D8.main(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:5)
        Caused by: java.util.concurrent.ExecutionException: com.android.tools.r8.utils.T0: java.lang.NullPointerException: Cannot invoke "String.length()" because "<parameter1>" is null
                at java.base/java.util.concurrent.ForkJoinTask.getException(ForkJoinTask.java:564)
                at java.base/java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.java:573)
                at java.base/java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:1007)
                at com.android.tools.r8.utils.d3.a(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:64)
                at com.android.tools.r8.dex.c.a(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:41)
                ... 12 more
        Caused by: com.android.tools.r8.utils.T0: java.lang.NullPointerException: Cannot invoke "String.length()" because "<parameter1>" is null
                at com.android.tools.r8.utils.R0.a(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:149)
                at com.android.tools.r8.utils.R0.a(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:128)
                at com.android.tools.r8.graph.T3.b(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:2)
                at com.android.tools.r8.dex.a.a(R8_8.2.2-dev_53a55043254cc5be8ef500331bba25d1b4ca4bc2cd66c555d4358bf672a1f10a:27)
                at java.base/java.util.concurrent.ForkJoinTask$AdaptedInterruptibleCallable.compute(ForkJoinTask.java:1689)
                at java.base/java.util.concurrent.ForkJoinTask$InterruptibleTask.exec(ForkJoinTask.java:1641)
                at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:507)
                at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1491)
                at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:2073)
                at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:2035)
                at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:187)
        Caused by: [CIRCULAR REFERENCE: java.lang.NullPointerException: Cannot invoke "String.length()" because "<parameter1>" is null]
Gibbz commented 7 months ago

Ive fixed this by installing jdk-openjdk17 instead of the latest version.

ogoffart commented 7 months ago

Thanks for filling an issue. This was actually already reported in https://github.com/slint-ui/slint/issues/4973 I'm closing this issue in favor of #4973 , but thanks anyway for reporting.