Error packaging android

Just tried to package an android app and got this error message

[ INFO] Creating android app bundle file
[ ERROR] Failed when running C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe: [BT:1.7.0] Error: MALFORMED
java.lang.IllegalArgumentException: MALFORMED
at java.util.zip.ZipCoder.toString(Unknown Source)
at java.util.zip.ZipFile.getZipEntry(Unknown Source)
at java.util.zip.ZipFile.access$900(Unknown Source)
at java.util.zip.ZipFile$ZipEntryIterator.next(Unknown Source)
at java.util.zip.ZipFile$ZipEntryIterator.next(Unknown Source)
at java.util.Iterator.forEachRemaining(Unknown Source)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown Source)
at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.util.stream.ReferencePipeline.collect(Unknown Source)
at com.android.tools.build.bundletool.validation.BundleModulesValidator.toBundleModule(BundleModulesValidator.java:103)
at com.android.tools.build.bundletool.validation.BundleModulesValidator.lambda$validate$0(BundleModulesValidator.java:79)
at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.util.Collections$2.tryAdvance(Unknown Source)
at java.util.Collections$2.forEachRemaining(Unknown Source)
at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.util.stream.ReferencePipeline.collect(Unknown Source)
at com.android.tools.build.bundletool.validation.BundleModulesValidator.validate(BundleModulesValidator.java:80)
at com.android.tools.build.bundletool.commands.BuildBundleCommand.execute(BuildBundleCommand.java:231)
at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:73)
at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:49)

So this is really odd, and I’m still getting the error, even after reboot, checking Java version, updating android sdk etc, but it looks like the ‘release’ gets created, even though it gives this error?

We needed to add support for Android App Bundles (AAB) recently and I wonder if this could be related to that.

Can you please attach your app’s src/config.json file so I can try to reproduce the issue on my side?

Thanks!

I was thinking something like that too, as I also noticed the android sdk mentioned the addition or update to the zip lib.

Anyhow, here is the config

{
	"config_version": "4",
	"name": [removd],
	"author": [removd],
	"modules": {
		"launchimage": {
			"version": "2.13",
			"config": {
				"android": {
					"portrait": "androidPort.png",
					"landscape": "androidLand.png",
					"background-color": "#ffffff",
					"background-size": "cover"
				},
				"ios": {
					"wC_hR": "img/splash/1080x1920.png",
					"wC_hC": "img/splash/1334x750.png",
					"wR_hC": "img/splash/1920x1080.png",
					"wR_hR": "img/splash/2732x2048.png"
				},
				"hide-manually": true
			}
		},
		"file": {
			"version": "2.27",
			"config": {
				"usage_description": "Access to your camera allows you to take photos in the app as well as use the QR scanner to scan codes"
			}
		},
		"icons": {
			"version": "2.9",
			"config": {
				"android": {
					"48": "img//splash//icon48.png",
					"72": "img//splash//icon72.png",
					"96": "img//splash//icon96.png",
					"144": "img//splash//icon144.png",
					"192": "img//splash//icon192.png"
				},
				"ios": {
					"57": "img//splash//icon57.png",
					"72": "img/splash/icon72.png",
					"76": "img//splash//icon76.png",
					"114": "img//splash//icon114.png",
					"120": "img//splash//icon120.png",
					"144": "img//splash//icon144.png",
					"152": "img//splash//icon152.png",
					"167": "img//splash//icon167.png",
					"180": "img//splash//icon152.png",
					"1024": "img//splash//icon1024.png"
				}
			}
		},
		"tabs": {
			"version": "3.7"
		},
		"topbar": {
			"version": "2.17",
			"config": {},
			"disabled": true
		},
		"request": {
			"version": "2.12",
			"config": {}
		},
		"notification": {
			"version": "2.8"
		},
		"calendar": {
			"version": "2.9",
			"config": {
				"usage_description": "[removd]"
			}
		},
		"prefs": {
			"version": "2.3"
		},
		"platform": {
			"version": "2.3"
		},
		"barcode": {
			"version": "3.0"
		},
		"media": {
			"version": "2.9",
			"config": {}
		},
		"contact": {
			"version": "2.13",
			"config": {
				"usage_description": "[removd]"
			}
		},
		"display": {
			"version": "2.14",
			"config": {
				"fullscreen": {
					"ios7": "not-fullscreen"
				},
				"orientations": {
					"ipad": "portrait",
					"android": "portrait",
					"iphone": "portrait"
				}
			}
		},
		"permissions": {
			"version": "2.2"
		},
		"urlhandler": {
			"version": "2.3",
			"config": {
				"scheme": "[removd]"
			}
		},
		"bolts": {
			"version": "1.10.0"
		},
		"parse": {
			"version": "3.3",
			"config": {
				"android": {
					"24": "img//splash//icon96.png",
					"36": "img//splash//icon96.png",
					"48": "img//splash//icon96.png",
					"72": "img//splash//icon96.png",
					"96": "img//splash//icon96.png",
					"notificationIcon": "@drawable/custom_push_icon",
					"googleServicesJson": "google-services.json"
				},
				"applicationId": "[removd]",
				"server": "[removd]",
				"clientKey": "[removd]"
			}
		},
		"capture": {
			"version": "2.26",
			"config": {
				"usage_description": "This will allow you to take add a photo to your profile or photo gallery"
			}
		},
		"browsersettings": {
			"version": "1.7",
			"config": {
				"media_playback": {
					"inline_video": true
				},
				"accept_cookies": true
			}
		}
	},
	"platform_version": "v2.9.3",
	"version": "3.8",
	"core": {
		"android": {
			"minimum_version": "19",
			"package_name": "[removd]",
			"disable_ics_acceleration": true,
			"remote_debugging": true
		},
		"ios": {
			"minimum_version": "12.0",
			"device_family": "any",
			"webview": "WKWebView",
			"package_name": "[removd]",
			"disable_web_storage_backup": true
		},
		"general": {
			"trusted_urls": [
				"[removd]"
			],
			"httpd": {
				"port": 44301
			}
		}
	},
	"description": "[removd]",
	"flags": {
		"move_filescheme_storage_to_httpscheme": true,
		"android_uses_cleartext_traffic": true
	}
}

Thank you for sending through your config.

I’ve been trying to reproduce this on my side but haven’t yet succeeded.

Can you please try compiling your app against platform_version: "2.9.5" and see if the problem still occurs?

If that doesn’t solve the issue can you please attach the verbose output from the packaging command:

forge package android -v

Thanks!