Enet4/dicom-rs

Latest version fails to build for android

IsmailAlamKhan opened this issue · 5 comments

I am not able to build for android when using the latest version of your package with the following error.

image

Thank you for reporting. Please follow the recommendations in issues #432 and #446 so that openjp2 is excluded from building for that platform. You can also try PR #449.

Hey I am kinda new to rust how can I use the version from your PR?

At your Cargo.toml:

[dependencies]
dicom = { git = "https://github.com/Enet4/dicom-rs", branch = "change/openjp2-opt" }

This also works when fetching individual crates.

See also: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#specifying-dependencies-from-git-repositories

Thanks a lot for the responses, I still get the same issue. Here is my build command

rustup target add \
        aarch64-linux-android \
        armv7-linux-androideabi \
        x86_64-linux-android \
        i686-linux-android

# Build the android libraries in the jniLibs directory
cargo ndk -o $JNI_DIR \
        --manifest-path ../Cargo.toml \
        -t armeabi-v7a \
        -t arm64-v8a \
        -t x86 \
        -t x86_64 \
        build --release

and my environment is Apple Mac Mini M2 2023 MacOS Sonoma 14.2.1

@Enet4 Thanks a lot! I was able to solve the issue with the PR by updating the dicom-pixeldata dependency, which was still on the official version. Here's the updated Cargo.toml. This might be helpful for someone else who encounters the same problem.

dicom = { git = "https://github.com/Enet4/dicom-rs", branch = "change/openjp2-opt" }
dicom-pixeldata = { git = "https://github.com/Enet4/dicom-rs", branch = "change/openjp2-opt", default-features = false, features = [
    "rayon",
    "openjpeg-sys",
    "image",
] }