- 문법:
-
<uses-native-library android:name="string" android:required=["true" | "false"] />
- 포함된 위치:
-
<application>
- 설명
-
애플리케이션을 연결해야 하는 공급업체 제공 공유 네이티브 라이브러리를 지정합니다. 이 요소는 패키지에서 네이티브 라이브러리에 액세스할 수 있도록 시스템에 지시합니다.
NDK 라이브러리는 기본적으로 액세스할 수 있으므로
<uses-native-library>
태그가 필요하지 않습니다.실리콘 공급업체 또는 기기 제조업체에서 제공하는 비 NDK 네이티브 공유 라이브러리에는 앱이 Android 12(API 수준 31) 이상을 타겟팅하면 기본적으로 액세스할 수 없습니다.
<uses-native-library>
태그를 사용하여 명시적으로 요청된 때만 라이브러리에 액세스할 수 있습니다.앱이 Android 11(API 수준 30) 이하를 타겟팅한다면
<uses-native-library>
태그가 필요하지 않습니다. 이 경우 NDK 라이브러리인지와 상관없이 모든 네이티브 공유 라이브러리에 액세스할 수 있습니다.이 요소는 특정 기기에 애플리케이션을 설치하는 데도 영향을 미칩니다. 이 요소가 있고 요소의
android:required
속성이true
로 설정되어 있는 경우 사용자의 기기에 라이브러리가 없다면PackageManager
프레임워크는 사용자가 애플리케이션을 설치하지 못하게 합니다.android:required
속성은 다음 섹션에서 자세히 설명합니다. - 속성
-
android:name
- 라이브러리 파일 이름입니다.
android:required
- 애플리케이션에
android:name
에서 지정한 라이브러리가 필요한지 여부를 나타내는 불리언 값입니다.-
"true"
: 이 라이브러리가 없으면 애플리케이션이 작동하지 않습니다. 시스템은 이 라이브러리가 없는 기기에 애플리케이션을 설치하도록 허용하지 않습니다. -
"false"
: 라이브러리가 있는 경우 애플리케이션이 사용하지만 필요한 경우 라이브러리 없이도 작동하도록 설계되었습니다. 시스템은 라이브러리가 없어도 애플리케이션을 설치하도록 허용합니다."false"
를 사용하면 라이브러리의 부재를 적절하게 처리해야 합니다.
기본값은
"true"
입니다. -
- 도입 수준:
- API 수준 31
- 참고 항목:
<uses-native-library>
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-08-21(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-21(UTC)"],[],[],null,["# <uses-native-library\u003e\n\nsyntax:\n:\n\n ```xml\n \u003cuses-native-library\n android:name=\"string\"\n android:required=[\"true\" | \"false\"] /\u003e\n ```\n\ncontained in:\n:\n `\n `[\u003capplication\u003e](/guide/topics/manifest/application-element)`\n `\n\ndescription:\n\n:\n Specifies a [vendor-provided shared native library](https://source.android.com/devices/tech/config/namespaces_libraries#adding-additional-native-libraries)\n that the application must be linked against. This element tells the system to make the native\n library accessible for the package.\n\n\n NDK libraries are by default accessible and therefore don't require the\n `\u003cuses-native-library\u003e` tag.\n\n\n Non-NDK native shared libraries that are provided by silicon vendors or device manufacturers\n aren't accessible by default if the app targets Android 12 (API level 31) or higher. The\n libraries are accessible only when they are explicitly requested using the\n `\u003cuses-native-library\u003e` tag.\n\n\n If the app targets Android 11 (API level 30) or lower, the\n `\u003cuses-native-library\u003e` tag isn't required. In that case, any native shared\n library is accessible regardless of whether it is an NDK library.\n\n\n This element also affects the installation of the application on a particular device. If this\n element is present and its `android:required` attribute is set to\n `true`, the\n [PackageManager](/reference/android/content/pm/PackageManager)\n framework won't let a user install the application unless the library is present on the\n user's device.\n\n\n The `android:required` attribute is described in detail in the following section.\n\nattributes:\n:\n\n `android:name`\n :\n The name of the library file.\n\n `android:required`\n :\n Boolean value that indicates whether the application requires the\n library specified by `android:name`.\n\n - `\"true\"`: the application doesn't function without this library. The system doesn't let the application install on a device that doesn't have the library.\n - `\"false\"`: the application uses the library if present, but is designed to function without it if necessary. The system lets the application install, even if the library isn't present. If you use `\"false\"`, you are responsible for gracefully handling the absence of the library.\n\n\n The default is `\"true\"`.\n\n\nintroduced in:\n: API level 31\n\nsee also:\n:\n - [PackageManager](/reference/android/content/pm/PackageManager)\n - [\u003cuses-library\u003e](/guide/topics/manifest/uses-library-element)\n [](/guide/topics/manifest/uses-library-element)\n\n [](/guide/topics/manifest/uses-library-element)\n[](/guide/topics/manifest/uses-library-element)"]]