willir / cargo-ndk-android-gradle

Cargo NDK for Android projects
Apache License 2.0
55 stars 7 forks source link

Exception when `cargoNdk.module` is set #2

Closed katyo closed 4 years ago

katyo commented 4 years ago

I specify the path to rust code like below:

cargoNdk {
    module = '../../backend'
}

But an exception occurs:

FAILURE: Build failed with an exception.

* Where:
Build file 'android/app/build.gradle' line: 72

* What went wrong:
A problem occurred evaluating project ':app'.
> Cannot cast object '../../backend' with class 'java.lang.String' to class 'java.nio.file.Path'

* 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

The output of gradle --version:

------------------------------------------------------------
Gradle 5.6.2
------------------------------------------------------------

Build time:   2019-09-05 16:13:54 UTC
Revision:     55a5e53d855db8fc7b0e494412fc624051a8e781

Kotlin:       1.3.41
Groovy:       2.5.4
Ant:          Apache Ant(TM) version 1.9.14 compiled on March 12 2019
JVM:          1.8.0_222 (Oracle Corporation 25.222-bga)
OS:           Linux 4.19.81 amd64
willir commented 4 years ago

Thanks for the bug report.

Fixed, published with 0.1.3 version. Could you please check if it works now?

katyo commented 4 years ago

It works. But It seems we need handling of case when module is set with wrong location.

willir commented 4 years ago

Yeah, a far point. I have added validation for cargoNdk.module. It should raise a more or less readable error message.

Published as 0.1.4

katyo commented 4 years ago

Fine!

willir commented 4 years ago

Thanks for checking, closing the issue.