BrainiumLLC / cargo-mobile

Rust on mobile made easy!
Apache License 2.0
1.23k stars 52 forks source link

Cant compile on Linux Ubuntu 20.04 #19

Closed charleschege closed 3 years ago

charleschege commented 3 years ago

After the new Linux support was merged, I installed cargo mobile and I have tried to run it with cargo android run on a connected device. I have chosen the winit project template, everything downloads fine but the build fails when gradle is trying to compile the java dependencies.

፨  cargo android run
Detected connected device: x43-A11 (SM-A115F) with target "armv7-linux-androideabi"
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (1, 13): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (1, 14): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (1, 21): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (1, 22): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (1, 25): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (1, 26): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (1, 28): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (1, 29): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (3, 1): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (3, 8): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (3, 11): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (3, 12): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (3, 19): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (3, 20): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (3, 25): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (3, 26): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (3, 32): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (3, 33): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (4, 1): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (4, 8): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (4, 12): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (4, 13): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (4, 15): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (4, 16): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (5, 1): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (5, 8): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (5, 11): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (5, 12): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (5, 18): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (5, 19): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (5, 22): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (5, 23): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (6, 1): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (6, 8): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (6, 11): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (6, 12): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (6, 18): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (6, 19): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (6, 22): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (6, 23): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (7, 1): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (7, 8): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (7, 11): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (7, 12): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (7, 18): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (7, 19): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (7, 22): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (7, 23): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (8, 1): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (8, 8): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (8, 11): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (8, 12): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (8, 18): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (8, 19): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (8, 22): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (8, 23): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (8, 30): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (8, 31): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (9, 1): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (9, 8): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (9, 11): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (9, 12): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (9, 18): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (9, 19): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (9, 22): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (9, 23): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (9, 28): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (9, 29): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (10, 1): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (10, 8): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (10, 11): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (10, 12): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (10, 18): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (10, 19): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (10, 22): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (10, 23): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (10, 28): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (10, 29): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (11, 1): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (11, 8): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (11, 11): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (11, 12): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (11, 18): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (11, 19): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (11, 22): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (11, 23): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (11, 28): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (11, 29): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (12, 1): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (12, 8): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (12, 11): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (12, 12): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (12, 18): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (12, 19): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (12, 22): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (12, 23): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (12, 28): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (12, 29): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (13, 1): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (13, 8): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (13, 11): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (13, 12): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (13, 18): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (13, 19): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (13, 22): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (13, 23): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (13, 28): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (13, 29): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (15, 24): Unresolved reference: DefaultTask
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (16, 6): Unresolved reference: InputDirectory
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (17, 6): Unresolved reference: PathSensitive
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (17, 20): Unresolved reference: PathSensitivity
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (18, 21): Unresolved reference: File
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (19, 6): Unresolved reference: Input
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (21, 6): Unresolved reference: Input
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (24, 6): Unresolved reference: TaskAction
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (28, 19): Unresolved reference: GradleException
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (32, 19): Unresolved reference: GradleException
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (36, 19): Unresolved reference: GradleException
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (38, 9): Unresolved reference: project
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (39, 13): Unresolved reference: workingDir
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (39, 24): Unresolved reference: File
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (39, 29): Unresolved reference: project
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (40, 13): Unresolved reference: executable
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (41, 13): Unresolved reference: args
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (42, 17): Unresolved reference: project
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (42, 42): Unresolved reference: LogLevel
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (43, 17): Unresolved reference: args
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (44, 24): Unresolved reference: project
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (44, 49): Unresolved reference: LogLevel
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (45, 17): Unresolved reference: args
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (48, 17): Unresolved reference: args
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt: (50, 13): Unresolved reference: args
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (1, 13): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (1, 14): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (1, 21): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (1, 22): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (1, 25): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (1, 26): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (1, 28): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (1, 29): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (3, 1): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (3, 8): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (3, 11): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (3, 12): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (3, 19): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (3, 20): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (3, 25): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (3, 26): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (3, 32): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (3, 33): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (4, 1): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (4, 8): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (4, 12): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (4, 13): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (4, 15): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (4, 16): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (5, 1): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (5, 8): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (5, 11): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (5, 12): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (5, 18): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (5, 19): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (5, 22): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (5, 23): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (6, 1): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (6, 8): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (6, 11): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (6, 12): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (6, 18): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (6, 19): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (6, 22): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (6, 23): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (7, 1): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (7, 8): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (7, 11): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (7, 12): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (7, 18): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (7, 19): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (7, 22): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (7, 23): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (8, 1): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (8, 8): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (8, 11): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (8, 12): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (8, 18): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (8, 19): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (8, 22): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (8, 23): Expecting a top level declaration
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (18, 25): Unresolved reference: Plugin
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (18, 32): Unresolved reference: Project
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (21, 5): 'apply' overrides nothing
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (21, 33): Unresolved reference: Project
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (25, 23): Unresolved reference: GradleException
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (28, 23): Unresolved reference: GradleException
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (31, 95): Unresolved reference: DefaultTask
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (32, 21): Unresolved reference: group
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (33, 21): Unresolved reference: description
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (39, 25): Unresolved reference: group
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (40, 25): Unresolved reference: description
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (41, 25): Unresolved reference: rootDirRel
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (41, 38): Unresolved reference: File
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (42, 25): Unresolved reference: target
e: /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/RustPlugin.kt: (43, 25): Unresolved reference: release

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':buildSrc:compileKotlin'.
> Compilation error. See log for more details

* Try:
Run with --stacktrace option to get the stack trace. 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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 4s
error: Failed to assemble APK
    Command "/home/x43/projects/KeAir/gen/android/ke-air/gradlew --project-dir /home/x43/projects/KeAir/gen/android/ke-air assembleArmDebug --warn" didn't complete
    successfully, exiting with code 1.

What could be the issue?

francesca64 commented 3 years ago

Thanks for trying it out!

What are the contents of BuildTask.kt?

charleschege commented 3 years ago

Thanks for trying it out!

What are the contents of BuildTask.kt?

Where is this file supposed to be located? I can't find it

francesca64 commented 3 years ago

Judging from the error output, it should be at /home/x43/projects/KeAir/gen/android/ke-air/buildSrc/src/main/kotlin/BuildTask.kt.

charleschege commented 3 years ago

I was doing a file search that did not produce any results but I can see the file exits in that directory. Here are the contents of BuildTask.kt

package wild-machine.x43.ke-air

import com.android.build.gradle.*
import java.io.File
import org.gradle.api.DefaultTask
import org.gradle.api.GradleException
import org.gradle.api.Project
import org.gradle.api.logging.LogLevel
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputDirectory
import org.gradle.api.tasks.PathSensitive
import org.gradle.api.tasks.PathSensitivity
import org.gradle.api.tasks.TaskAction

open class BuildTask : DefaultTask() {
    @InputDirectory
    @PathSensitive(PathSensitivity.RELATIVE)
    var rootDirRel: File? = null
    @Input
    var target: String? = null
    @Input
    var release: Boolean? = null

    @TaskAction
    fun build() {
        val rootDirRel = rootDirRel
        if (rootDirRel == null) {
            throw GradleException("rootDirRel cannot be null")
        }
        val target = target
        if (target == null) {
            throw GradleException("target cannot be null")
        }
        val release = release
        if (release == null) {
            throw GradleException("release cannot be null")
        }
        project.exec {
            workingDir(File(project.getProjectDir(), rootDirRel.getPath()))
            executable("cargo")
            args(listOf("android", "build"))
            if (project.logger.isEnabled(LogLevel.DEBUG)) {
                args("-vv")
            } else if (project.logger.isEnabled(LogLevel.INFO)) {
                args("-v")
            }
            if (release) {
                args("--release")
            }
            args("${target}")
        }.assertNormalExitValue()
    }
}
zeerooth commented 3 years ago

I was able to replicate this issue - it only happens when I use a Domain with a - character, so example.com works, but some-example.com fails. Hyphens are not valid in java/kotlin package names, so if you want to get this working you should change your domain to something that doesn't contain hyphens. In the meantime, I'll try to create a PR that includes hyphens in the list of disallowed characters in domain names so that something like that wouldn't happen again.

charleschege commented 3 years ago

Thanks! That solved my issue

charleschege commented 3 years ago

I am now able to fully build and run for android. However, I have tried the winit and wgpu templates and they start well but crash immediately. Has anyone successful run the templates on android or are these known issues.

The cargo android run logs

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings
Success
Starting: Intent { cmp=wildmachine.x43.keair.ke_air/android.app.NativeActivity }
--------- beginning of crash
--------- beginning of system
--------- beginning of main
zeerooth commented 3 years ago

Have you tried running it again? There is currently a known issue with rust library not being attached to the apk in the same run - more described in #13. There is an open MR #18 that might fix this in the near future. But I don't know if that's a case for you as well. If not, please run adb logcat | grep -i "Cargo" and provide the logs.

charleschege commented 3 years ago

I am also not a kotlin expert but re-running cargo android run solves the issue. Thanks for the help

charleschege commented 3 years ago

The demos are working perfectly, the android window is stable. A year ago, I tried cargo-ndk and cargo-apk and they didn't work. Cargo-mobile is much better. Great work