Problem with AndroidManifest.xml from Turtle CLI

I’ve recently upgraded our application from Expo SDK 32 to Expo SDK 35, and I’m having some trouble building an Android binary using Turtle.

Some (anonymized) details:

$ expo diagnostics

  Expo CLI 3.4.1 environment info:
      OS: macOS 10.14.6
      Shell: 5.4.2 - /usr/local/bin/zsh
      Node: 10.15.3 - ~/.nvm/versions/node/v10.15.3/bin/node
      Yarn: 1.16.0 - ~/.nvm/versions/node/v10.15.3/bin/yarn
      npm: 6.4.1 - ~/.nvm/versions/node/v10.15.3/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
      Android Studio: 3.5 AI-191.8026.42.35.5900203
      Xcode: 11.1/11A1027 - /usr/bin/xcodebuild
      @types/expo: ^31.0.1 => 31.0.1 
      @types/react: ^16.8.23 => 16.9.9 
      @types/react-native: ^0.57.65 => 0.57.65 
      expo: ^35.0.0 => 35.0.0 
      react: 16.8.3 => 16.8.3 
      react-native: => 0.59.8 
      react-navigation: ^3.0.9 => 3.0.9 

$ turtle --version

$ cat app.json
  "expo": {
    "name": "App Name",
    "slug": "app-slug",
    "scheme": "app",
    "icon": "./icons/dev.png",
    "ios": {
      "bundleIdentifier": ""
    "android": {
      "package": "",
      "adaptiveIcon": {
        "foregroundImage": "./icons/adaptive/dev.png",
        "backgroundColor": "#041E2D"
      "permissions": [
      "versionCode": 14
    "version": "1.0.0",
    "splash": {
      "image": "./icons/splash.png",
      "backgroundColor": "#041E2D"
    "orientation": "portrait",
    "sdkVersion": "35.0.0",
    "platforms": [

Relevant (anonymized) environment variables:


(Anonymized) Turtle command:

turtle \
    build:android -o appName-1.0.0.apk \
    --keystore-path /path/to/keystore.jks \
    --keystore-alias keystore alias

Device Info:

Model: Nexus 5X
Android version: 8.11.0
Android security patch level: November 5, 2018
Baseband version: M8994F-
Build number: OPM7.181105.004

When I try to install the APK on the device I receive a message “There was a problem parsing the package.”

I then enable developer mode the device, and attempt to install using adb from Turtle:

~/.turtle/androidDependencies/sdk/platform-tools $ ./adb devices                                                                                                                                                                          [ruby-2.2.0]
List of devices attached
00c8b8a449711c10	device

~/.turtle/androidDependencies/sdk/platform-tools $ ./adb -s 00c8b8a449711c10 install appname-1.0.0.apk
Performing Streamed Install
adb: failed to install appname-1.0.0.apk: Failure [INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION: Failed to parse /data/app/vmdl1142796601.tmp/base.apk: AndroidManifest.xml]

Taking a look at the adb logcat output, I see:

Failed to parse /data/app/vmdl1494921565.tmp/base.apk AndroidManifest.xml
	at android.content.res.AssetManager.openXmlAssetNative(Native Method)
	at android.content.res.AssetManager.openXmlBlockAsset(
	at android.content.res.AssetManager.openXmlResourceParser(
	at android.os.ShellCommand.exec(
	at android.os.Binder.shellCommand(
	at android.os.Binder.onTransact(
	at android.os.Binder.execTransact(

Things I’ve tried:

rm -rf ~/.expo
rm -rf ~/.turtle
watchman watch-del-all
rm -rf /tmp/metro-bundler-cache-*
rm -rf /tmp/haste-map-react-native-packager-*
rm -fr $TMPDIR/metro*
yarn cache clean
rm -rf node_modules
yarn install

Any ideas what I’m doing wrong?

turtle-cli builds aab by default, to build apk add -t apk to build command

1 Like

I added the -t apk parameter, but I’m still seeing the same issue. Any other thoughts?

Try running file appname-1.0.0.apk

I think the file command is not clever enough to identify an APK more specifically than seeing that it is a JAR, so it should print something like this:

appname-1.0.0.apk: Java archive data (JAR)

Then run jar tf appname-1.0.0.apk | grep AndroidManifest.xml
If it prints an error or nothing then there is no AndroidManifest.xml in the file.

If you do see an AndroidManifest.xml file then extract it and have a look at the contents. In an APK the AndroidManifest.xml will not actually be XML, but rather a binary format.

According to an article I found, .aab files also contain an AndroidManifest.xml, but in the .aab file it is a real XML file.

The above should at least give you a hint about what might be the problem.

One possible solution: It is possible to convert a .aab file to a .apk:

1 Like

Thanks for the tip!

$ file appname-1.0.0.apk
appname-1.0.0.apk: Zip archive data, at least v?[0] to extract
$ jar -tf appname-1.0.0.apk | grep AndroidManifest.xml
$ file AndroidManifest.xml
AndroidManifest.xml: Android binary XML
~/.turtle/androidDependencies/sdk/platform-tools $ ./adb -s 00c8b8a449711c10 install appname-1.0.0.apk
Performing Streamed Install

I think I may have accidentally been sending adb the old .aab binary intead of the new .apk format I was building. :facepalm:

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.