use of com.android.tools.build.bundletool.model.exceptions.IncompatibleDeviceException in project bundletool by google.
the class ApkMatcherTest method textureVariant_incompatibleDevice.
@Test
public void textureVariant_incompatibleDevice() {
ZipPath apk = ZipPath.create("master-etc1_rgb8.apk");
BuildApksResult buildApksResult = buildApksResult(createVariant(mergeVariantTargeting(variantSdkTargeting(sdkVersionFrom(Versions.ANDROID_L_API_VERSION)), variantTextureTargeting(ATC)), splitApkSet(/* moduleName= */
"base", splitApkDescription(ApkTargeting.getDefaultInstance(), apk))));
IncompatibleDeviceException exception = assertThrows(IncompatibleDeviceException.class, () -> new ApkMatcher(lDeviceWithGlExtensions("GL_OES_compressed_ETC1_RGB8_texture")).getMatchingApks(buildApksResult));
assertThat(exception).hasMessageThat().contains("The app doesn't support texture compression formats of the device. Device formats:" + " [ETC1_RGB8], app formats: [ATC]");
}
use of com.android.tools.build.bundletool.model.exceptions.IncompatibleDeviceException in project bundletool by google.
the class BuildApksDeviceSpecTest method deviceSpecPreL_bundleTargetsLPlus_throws.
@Test
public void deviceSpecPreL_bundleTargetsLPlus_throws() throws Exception {
DeviceSpec deviceSpec = mergeSpecs(sdkVersion(/* KitKat */
19), abis("x86"), locales("en-US"), density(XHDPI));
bundleSerializer.writeToDisk(createMinSdkBundle(21), bundlePath);
BuildApksCommand command = BuildApksCommand.builder().setBundlePath(bundlePath).setOutputFile(outputFilePath).setDeviceSpec(deviceSpec).build();
IncompatibleDeviceException exception = assertThrows(IncompatibleDeviceException.class, command::execute);
assertThat(exception).hasMessageThat().contains("App Bundle targets L+ devices, but the device has SDK version lower than L.");
}
Aggregations