Fix missing class in manifest merger
If manifest merger sees a manifest with an sdk codename instead
of a number it fails with:
Exception in thread "main" java.lang.NoClassDefFoundError: com/android/sdklib/SdkVersionInfo
at com.android.manifmerger.XmlDocument.getApiLevelFromAttribute(XmlDocument.java:384)
at com.android.manifmerger.XmlDocument.addImplicitElements(XmlDocument.java:418)
at com.android.manifmerger.XmlDocument.merge(XmlDocument.java:161)
at com.android.manifmerger.ManifestMerger2.merge(ManifestMerger2.java:909)
at com.android.manifmerger.ManifestMerger2.merge(ManifestMerger2.java:263)
at com.android.manifmerger.ManifestMerger2.access$600(ManifestMerger2.java:61)
at com.android.manifmerger.ManifestMerger2$Invoker.merge(ManifestMerger2.java:1530)
at com.android.manifmerger.Merger.process(Merger.java:153)
at com.android.manifmerger.Merger.main(Merger.java:42)
Caused by: java.lang.ClassNotFoundException: com.android.sdklib.SdkVersionInfo
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:185)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
... 9 more
Add sdklib to the classpath to fix it.
Test: m java
Bug: 77569197
Change-Id: I54fd9edb36aca32cff507340a76eee5e367529e6
diff --git a/core/config.mk b/core/config.mk
index 67ca08e..098e2a2 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -713,8 +713,9 @@
# Tool to merge AndroidManifest.xmls
ANDROID_MANIFEST_MERGER_CLASSPATH := \
prebuilts/gradle-plugin/com/android/tools/build/manifest-merger/26.1.0/manifest-merger-26.1.0.jar \
- prebuilts/gradle-plugin/com/android/tools/sdk-common/26.1.0/sdk-common-26.1.0.jar \
prebuilts/gradle-plugin/com/android/tools/common/26.1.0/common-26.1.0.jar \
+ prebuilts/gradle-plugin/com/android/tools/sdk-common/26.1.0/sdk-common-26.1.0.jar \
+ prebuilts/gradle-plugin/com/android/tools/sdklib/26.1.0/sdklib-26.1.0.jar \
prebuilts/gradle-plugin/org/jetbrains/kotlin/kotlin-runtime/1.0.5/kotlin-runtime-1.0.5.jar \
prebuilts/gradle-plugin/org/jetbrains/kotlin/kotlin-stdlib/1.1.3/kotlin-stdlib-1.1.3.jar \
prebuilts/misc/common/guava/guava-21.0.jar