Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing libraries in target dir on Windows #100

Closed
bbqsrc opened this issue May 10, 2023 · 6 comments
Closed

Missing libraries in target dir on Windows #100

bbqsrc opened this issue May 10, 2023 · 6 comments

Comments

@bbqsrc
Copy link
Owner

bbqsrc commented May 10, 2023

          I had set "TEMP" to "F:\TEMP",It seems to be working.
[2023-05-10T12:54:12Z INFO  cargo_ndk::cli] Using NDK at path: D:\compiler\Android\ndk\25.0.8775105 (ANDROID_HOME)
[2023-05-10T12:54:12Z INFO  cargo_ndk::cli] NDK API level: 21
[2023-05-10T12:54:12Z INFO  cargo_ndk::cli] Building targets: arm64-v8a
[2023-05-10T12:54:12Z INFO  cargo_ndk::cli] Building arm64-v8a (aarch64-linux-android)
Cargo.rs:139   main: F:\Cargo\bin\cargo-ndk.exe f:"f:\\temp\\.tmpAqdVa2\\ar.exe"
Cargo.rs:139   main: F:\Cargo\bin\cargo-ndk.exe f:"f:\\temp\\.tmpAqdVa2\\cc.exe"
Cargo.rs:139   main: F:\Cargo\bin\cargo-ndk.exe f:"f:\\temp\\.tmpAqdVa2\\cxx.exe"
Cargo.rs:139   main: F:\Cargo\bin\cargo-ndk.exe f:"f:\\temp\\.tmpAqdVa2\\ranlib.exe"
Cargo.rs:139   main: F:\Cargo\bin\cargo-ndk.exe f:"f:\\temp\\.tmpAqdVa2\\triple-ar.exe"
Cargo.rs:139   main: F:\Cargo\bin\cargo-ndk.exe f:"f:\\temp\\.tmpAqdVa2\\triple-linker.exe"
warning: unused manifest key: package.crate-type
   Compiling bytes v1.4.0
   Compiling cfg-if v1.0.0
   Compiling jni-sys v0.3.0
   Compiling cesu8 v1.1.0
   Compiling json v0.12.4
   Compiling memchr v2.5.0
   Compiling thiserror v1.0.40
   Compiling log v0.4.17
   Compiling combine v4.6.6
   Compiling jni v0.21.1
   Compiling flashdrop v0.1.0 (H:\rust\flashdrop)
    Finished dev [unoptimized + debuginfo] target(s) in 6.00s

However, I found no "libflashdrop.so" in target\aarch64-linux-android\debug.

When I tried to execute commnad cargo ndk -t arm64-v8a -o . build, it failed again.

[2023-05-10T12:53:56Z INFO  cargo_ndk::cli] Using NDK at path: D:\compiler\Android\ndk\25.0.8775105 (ANDROID_HOME)
[2023-05-10T12:53:56Z INFO  cargo_ndk::cli] NDK API level: 21
[2023-05-10T12:53:56Z INFO  cargo_ndk::cli] Building targets: arm64-v8a
[2023-05-10T12:53:56Z INFO  cargo_ndk::cli] Building arm64-v8a (aarch64-linux-android)
Cargo.rs:139   main: F:\Cargo\bin\cargo-ndk.exe f:"f:\\temp\\.tmpADw0AH\\ar.exe"
Cargo.rs:139   main: F:\Cargo\bin\cargo-ndk.exe f:"f:\\temp\\.tmpADw0AH\\cc.exe"
Cargo.rs:139   main: F:\Cargo\bin\cargo-ndk.exe f:"f:\\temp\\.tmpADw0AH\\cxx.exe"
Cargo.rs:139   main: F:\Cargo\bin\cargo-ndk.exe f:"f:\\temp\\.tmpADw0AH\\ranlib.exe"
Cargo.rs:139   main: F:\Cargo\bin\cargo-ndk.exe f:"f:\\temp\\.tmpADw0AH\\triple-ar.exe"
Cargo.rs:139   main: F:\Cargo\bin\cargo-ndk.exe f:"f:\\temp\\.tmpADw0AH\\triple-linker.exe"
warning: unused manifest key: package.crate-type
   Compiling cfg-if v1.0.0
   Compiling bytes v1.4.0
   Compiling cesu8 v1.1.0
   Compiling jni-sys v0.3.0
   Compiling json v0.12.4
   Compiling memchr v2.5.0
   Compiling thiserror v1.0.40
   Compiling log v0.4.17
   Compiling combine v4.6.6
   Compiling jni v0.21.1
   Compiling flashdrop v0.1.0 (H:\rust\flashdrop)
    Finished dev [unoptimized + debuginfo] target(s) in 5.96s
[2023-05-10T12:54:02Z INFO  cargo_ndk::cli] Copying libraries to ....
[2023-05-10T12:54:02Z ERROR cargo_ndk::cli] No .so files found in path "H:\\rust\\flashdrop\\target\\aarch64-linux-android\\debug"
[2023-05-10T12:54:02Z ERROR cargo_ndk::cli] Did you set the crate-type in Cargo.toml to include 'cdylib'?
[2023-05-10T12:54:02Z ERROR cargo_ndk::cli] For more info, see <https://doc.rust-lang.org/cargo/reference/cargo-targets.html#library>.

So wired........

My cargo.toml as follow:

[package]
name = "flashdrop"
version = "0.1.0"
edition = "2021"
crate-type = ["cdylib"]

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

[dependencies]
jni = "0.21.1"
json = "0.12.4"

Originally posted by @ScSofts in #99 (comment)

@bbqsrc
Copy link
Owner Author

bbqsrc commented May 10, 2023

I don't have this issue when building libraries myself. Does your project have a lib.rs?

@ScSofts
Copy link
Contributor

ScSofts commented May 10, 2023

yes,and windows target can be built successfully

@bbqsrc
Copy link
Owner Author

bbqsrc commented May 11, 2023

Frustrating. I'm still investigating why. Only happens in some projects. <_<

@bbqsrc
Copy link
Owner Author

bbqsrc commented May 11, 2023

Hey @ScSofts, try version 3.1.1.

@ScSofts
Copy link
Contributor

ScSofts commented May 11, 2023

OK👌I'll have a try

@ScSofts
Copy link
Contributor

ScSofts commented May 11, 2023

It works smoothly! Good job!

@bbqsrc bbqsrc closed this as completed May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants