From 190b08379a19565b7a594e31862cc99f456e009c Mon Sep 17 00:00:00 2001 From: "^\\.zer0de(?:a|r?p)?(?:th|[fv])$" Date: Sat, 12 Mar 2022 12:24:36 +0100 Subject: [PATCH] Avoid AAPT errors stemming from attempts of adding the same library twice. (#187) Co-authored-by: zer0def --- ndk-build/src/readelf.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ndk-build/src/readelf.rs b/ndk-build/src/readelf.rs index 87927bce..fce9c2b7 100644 --- a/ndk-build/src/readelf.rs +++ b/ndk-build/src/readelf.rs @@ -51,8 +51,9 @@ impl<'a> UnalignedApk<'a> { }; if let Some(path) = find_library_path(search_paths, &need)? { - provided.insert(path.file_name().unwrap().to_str().unwrap().to_string()); - artifacts.push(path); + if provided.insert(path.file_name().unwrap().to_str().unwrap().to_string()) { + artifacts.push(path); + } } else { eprintln!("Shared library \"{}\" not found.", need); }