Unable to install custom app, Herelink read-only

I am trying to install a custom version of QGC. When I try to install using "adb install <name.apk> it fails. And the Herelink goes offline.

I also tried "adb push <name.apk> <name.apk> and it fails saying the device is read-only.

use adb install, not push

I have tried “adb install <name.apk>”, many times. Also tried “adb install --no-streaming <name.apk>” and that also did not work.

I only tried push to see if I could get the apk file to the device. And that is when it gave me the read only error.

Just another data point. I was able to successfully install the same apk onto an old Samsung Galaxy 6 device. This was done using the same command that does not work with my Herelink: adb install <name.apk>

you need to at least provide the exact error you are getting.

Below is captures from attempting the install with streaming and no streaming. And log captures afterwards. Note the exceptions in each case.
I have more complete logs but this site will not let me upload them.

Device SW Version: LATEST: BRU01211104

C:\apk>adb devices
List of devices attached
d7934778 device

C:\apk>adb install android-build-release-signed.apk
Performing Streamed Install
adb: failed to install android-build-release-signed.apk:

C:\apk>adb devices
List of devices attached
d7934778 offline

** Unplugged USB cable and plugged back in

C:\apk>adb devices
List of devices attached
d7934778 device

C:\apk>adb logcat

05-14 08:09:27.423 262 262 I usbethx : POWER_SUPPLY_CURRENT_MAX=500
05-14 08:09:27.423 262 262 I usbethx : POWER_SUPPLY_TYPE=USB
05-14 08:09:27.423 262 262 I usbethx : POWER_SUPPLY_CHARGE_TYPE=N/A
05-14 08:09:27.423 262 262 I usbethx : SEQNUM=2215
05-14 08:09:27.431 746 825 V UsbDeviceManager: USB UEVENT: {USB_STATE=DISCONNECTED, SUBSYSTEM=android_usb, SEQNUM=2216, ACTION=change, DEVPATH=/devices/virtual/android_usb/android0}
05-14 08:09:27.432 1 1 I init : type=1400 audit(0.0:334): avc: denied { write } for name=“0.modem” dev=“sysfs” ino=6182 scontext=u:r:init:s0 tcontext=u:object_r:sysfs:s0 tclass=dir permissive=1
05-14 08:09:27.432 1 1 I init : type=1400 audit(0.0:335): avc: denied { add_name } for name=“charger_status” scontext=u:r:init:s0 tcontext=u:object_r:sysfs:s0 tclass=dir permissive=1
05-14 08:09:27.432 1 1 I init : type=1400 audit(0.0:336): avc: denied { create } for name=“charger_status” scontext=u:r:init:s0 tcontext=u:object_r:sysfs:s0 tclass=file permissive=1
05-14 08:09:27.438 746 1978 W FastPrintWriter: Write failure
05-14 08:09:27.438 746 1978 W FastPrintWriter: java.io.IOException: write failed: EIO (I/O error)
05-14 08:09:27.438 746 1978 W FastPrintWriter: at libcore.io.IoBridge.write(IoBridge.java:501)
05-14 08:09:27.438 746 1978 W FastPrintWriter: at java.io.FileOutputStream.write(FileOutputStream.java:316)
05-14 08:09:27.438 746 1978 W FastPrintWriter: at com.android.internal.util.FastPrintWriter.flushBytesLocked(FastPrintWriter.java:336)
05-14 08:09:27.438 746 1978 W FastPrintWriter: at com.android.internal.util.FastPrintWriter.flushLocked(FastPrintWriter.java:359)
05-14 08:09:27.438 746 1978 W FastPrintWriter: at com.android.internal.util.FastPrintWriter.flush(FastPrintWriter.java:394)
05-14 08:09:27.438 746 1978 W FastPrintWriter: at android.os.ShellCommand.exec(ShellCommand.java:113)
05-14 08:09:27.438 746 1978 W FastPrintWriter: at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:18409)
05-14 08:09:27.438 746 1978 W FastPrintWriter: at android.os.Binder.shellCommand(Binder.java:468)
05-14 08:09:27.438 746 1978 W FastPrintWriter: at android.os.Binder.onTransact(Binder.java:367)
05-14 08:09:27.438 746 1978 W FastPrintWriter: at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:2387)
05-14 08:09:27.438 746 1978 W FastPrintWriter: at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:3056)
05-14 08:09:27.438 746 1978 W FastPrintWriter: at android.os.Binder.execTransact(Binder.java:565)
05-14 08:09:27.438 746 1978 W FastPrintWriter: Caused by: android.system.ErrnoException: write failed: EIO (I/O error)
05-14 08:09:27.438 746 1978 W FastPrintWriter: at libcore.io.Posix.writeBytes(Native Method)
05-14 08:09:27.438 746 1978 W FastPrintWriter: at libcore.io.Posix.write(Posix.java:273)
05-14 08:09:27.438 746 1978 W FastPrintWriter: at libcore.io.BlockGuardOs.write(BlockGuardOs.java:319)
05-14 08:09:27.438 746 1978 W FastPrintWriter: at libcore.io.IoBridge.write(IoBridge.java:496)
05-14 08:09:27.438 746 1978 W FastPrintWriter: … 11 more
05-14 08:09:27.439 262 262 I usbethx : change@/devices/virtual/android_usb/android0
05-14 08:09:27.439 262 262 I usbethx : ACTION=change
05-14 08:09:27.439 262 262 I usbethx : DEVPATH=/devices/virtual/android_usb/android0
05-14 08:09:27.439 262 262 I usbethx : SUBSYSTEM=android_usb
05-14 08:09:27.439 262 262 I usbethx : USB_STATE=DISCONNECTED
05-14 08:09:27.440 262 262 I usbethx : SEQNUM=2216
05-14 08:09:27.440 262 262 I usbethx : change@/devices/platform/soc/fa300000.usb/udc/fa300000.usb
05-14 08:09:27.440 262 262 I usbethx : ACTION=change
05-14 08:09:27.442 262 262 I usbethx : DEVPATH=/devices/platform/soc/fa300000.usb/udc/fa300000.usb
05-14 08:09:27.442 262 262 I usbethx : SUBSYSTEM=udc

C:\apk>adb devices
List of devices attached
d7934778 device

C:\apk>adb install --no-streaming android-build-release-signed.apk
Performing Push Install
adb: error: failed to read copy responseease-signed.apk
android-build-release-signed.apk: 1 file pushed, 0 skipped. 4.9 MB/s (26079780 bytes in 5.108s)
adb: error: failed to read copy response

C:\apk>adb devices
List of devices attached
d7934778 offline

** Unplugged USB cable and plugged back in

C:\apk>adb devices
List of devices attached
d7934778 device

C:\apk>adb logcat

05-14 08:09:27.423 262 262 I usbethx : SEQNUM=2215
05-14 08:09:27.431 746 825 V UsbDeviceManager: USB UEVENT: {USB_STATE=DISCONNECTED, SUBSYSTEM=android_usb, SEQNUM=2216, ACTION=change, DEVPATH=/devices/virtual/android_usb/android0}
05-14 08:09:27.432 1 1 I init : type=1400 audit(0.0:334): avc: denied { write } for name=“0.modem” dev=“sysfs” ino=6182 scontext=u:r:init:s0 tcontext=u:object_r:sysfs:s0 tclass=dir permissive=1
05-14 08:09:27.432 1 1 I init : type=1400 audit(0.0:335): avc: denied { add_name } for name=“charger_status” scontext=u:r:init:s0 tcontext=u:object_r:sysfs:s0 tclass=dir permissive=1
05-14 08:09:27.432 1 1 I init : type=1400 audit(0.0:336): avc: denied { create } for name=“charger_status” scontext=u:r:init:s0 tcontext=u:object_r:sysfs:s0 tclass=file permissive=1
05-14 08:09:27.438 746 1978 W FastPrintWriter: Write failure
05-14 08:09:27.438 746 1978 W FastPrintWriter: java.io.IOException: write failed: EIO (I/O error)
05-14 08:09:27.438 746 1978 W FastPrintWriter: at libcore.io.IoBridge.write(IoBridge.java:501)
05-14 08:09:27.438 746 1978 W FastPrintWriter: at java.io.FileOutputStream.write(FileOutputStream.java:316)
05-14 08:09:27.438 746 1978 W FastPrintWriter: at com.android.internal.util.FastPrintWriter.flushBytesLocked(FastPrintWriter.java:336)
05-14 08:09:27.438 746 1978 W FastPrintWriter: at com.android.internal.util.FastPrintWriter.flushLocked(FastPrintWriter.java:359)
05-14 08:09:27.438 746 1978 W FastPrintWriter: at com.android.internal.util.FastPrintWriter.flush(FastPrintWriter.java:394)
05-14 08:09:27.438 746 1978 W FastPrintWriter: at android.os.ShellCommand.exec(ShellCommand.java:113)
05-14 08:09:27.438 746 1978 W FastPrintWriter: at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:18409)
05-14 08:09:27.438 746 1978 W FastPrintWriter: at android.os.Binder.shellCommand(Binder.java:468)
05-14 08:09:27.438 746 1978 W FastPrintWriter: at android.os.Binder.onTransact(Binder.java:367)
05-14 08:09:27.438 746 1978 W FastPrintWriter: at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:2387)
05-14 08:09:27.438 746 1978 W FastPrintWriter: at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:3056)
05-14 08:09:27.438 746 1978 W FastPrintWriter: at android.os.Binder.execTransact(Binder.java:565)
05-14 08:09:27.438 746 1978 W FastPrintWriter: Caused by: android.system.ErrnoException: write failed: EIO (I/O error)
05-14 08:09:27.438 746 1978 W FastPrintWriter: at libcore.io.Posix.writeBytes(Native Method)
05-14 08:09:27.438 746 1978 W FastPrintWriter: at libcore.io.Posix.write(Posix.java:273)
05-14 08:09:27.438 746 1978 W FastPrintWriter: at libcore.io.BlockGuardOs.write(BlockGuardOs.java:319)
05-14 08:09:27.438 746 1978 W FastPrintWriter: at libcore.io.IoBridge.write(IoBridge.java:496)
05-14 08:09:27.438 746 1978 W FastPrintWriter: … 11 more
05-14 08:09:27.439 262 262 I usbethx : change@/devices/virtual/android_usb/android0
05-14 08:09:27.439 262 262 I usbethx : ACTION=change
05-14 08:09:27.439 262 262 I usbethx : DEVPATH=/devices/virtual/android_usb/android0
05-14 08:09:27.439 262 262 I usbethx : SUBSYSTEM=android_usb
05-14 08:09:27.439 262 262 I usbethx : USB_STATE=DISCONNECTED
05-14 08:09:27.440 262 262 I usbethx : SEQNUM=2216
05-14 08:09:27.440 262 262 I usbethx : change@/devices/platform/soc/fa300000.usb/udc/fa300000.usb

Android versions may not match so you can try to update different versions or here link?

as @Jesus has mentioned, what android version are you targeting? needs to be 7.1 or bellow. you can use a newer sdk, just need to target the lower value

Thanks for the suggestions. But that does not seem to be the issue. I am setting the Target to be “API 25: Android 7.1”. The Herelink device Android version is 7.1.2.

Here is some info from the apk file.
Android manifest:
N: android=http://schemas.android.com/apk/res/android
E: manifest (line=2)
A: android:versionCode(0x0101021b)=(type 0x10)0x494d3
A: android:versionName(0x0101021c)=“3.0.0-243-gd759437” (Raw: “3.0.0-243-gd759437”)
A: android:installLocation(0x010102b7)=(type 0x10)0x0
A: package=“gov.nasa.arc.aol.qgroundcontrol” (Raw: “gov.nasa.arc.aol.qgroundcontrol”)
A: platformBuildVersionCode=(type 0x10)0x19 (Raw: “25”)
A: platformBuildVersionName=“7.1.1” (Raw: “7.1.1”)
E: uses-sdk (line=8)
A: android:minSdkVersion(0x0101020c)=(type 0x10)0x10
A: android:targetSdkVersion(0x01010270)=(type 0x10)0x19

ok, so i dont see anything that should be blocking it initialy. we dont stop you installing custom apps at all, so there must be something else going on here.

can you
reboot the unit
do a
“adb install android-build-release-signed.apk”
then after it fails
“adb bugreport”
and upload the file it generates

bugreport-N2G47J-2022-05-16-17-02-56.zip (823.5 KB)

I have followed the steps you provided and uploaded the file. To note is that once the install fails the device appears to go offline. So I had to unplug the device from USB and then plug back in to generated the bugreport.

ok so couple of questions
do you have a microsd card intalled?
and is there enough free space on both the internal storage? apk size * 2
and how big is the apk?

does that mean it rebooted? or just usb stopped responding?

i can see the install attempt
Session 1815042004:
userId=0 installerPackageName=null installerUid=2000 createdMillis=1652745733621
stageDir=/data/app/vmdl1815042004.tmp stageCid=null
mode=1 installFlags=0x70 installLocation=1 sizeBytes=26079780 appPackageName=null appIcon=false appLabel=null
originatingUri=null originatingUid=-1 referrerUri=null abiOverride=null volumeUuid=null
grantedRuntimePermissions=null
mClientProgress=0.0 mProgress=0.0 mSealed=true mPermissionsAccepted=true mRelinquished=false mDestroyed=true
mBridges=1 mFinalStatus=-115 mFinalMessage=Session was abandoned

also have you tried installing any other apk?
just want to narrow down if its something to do with the system as a whole, or just this one apk in question.

To answer your questions:

  • No microsd card installed
  • I believe there is enough space. From device Settings, Storage shows 876 MB of 4.85 GB used.
  • My APK that I am trying to install is 25 MB.
  • Following the install attempt ADB shows the device as “offline”. I am not rebooting the device. Simply unplug/plug the USB cable.
  • I tried another APK for one of the Android Sample apps. And it fails the same way. Its size is 75 KB.

app-release-unsigned.zip (69.0 KB)

This is the sample app that also fails to install.

This is the same sample app that also fails to install. But this one is signed.
app-release.zip (70.2 KB)

my attempt at your app

C:\Users\mich1\Downloads>adb install app-release.apk

  • daemon not running; starting now at tcp:5037
  • daemon started successfully
    Performing Streamed Install
    Success

and i see and can launch app shortcut example

an unsigned app i think will always fail eg

C:\Users\mich1\Downloads>adb install app-release-unsigned.apk
Performing Streamed Install
adb: failed to install app-release-unsigned.apk: Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES: Failed to collect certificates from /data/app/vmdl1698006144.tmp/base.apk: Attempt to get length of null array]

so it looks like its a system wide state.

so my next questions are
is a new and valid windows adb driver installed?
is the version of adb you using up to date?
whats is the oem build number of the herelink fw you are on? (settings > about phone)

for me

adb version
Android Debug Bridge version 1.0.41
Version 31.0.3-7562133
Installed as C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe

is a new and valid windows adb driver installed?

Yes, the driver was installed using the SDK Manager. It currently shows the status is “installed” and the version is “13”. See screenshot. sdk-tools

I also tried updating following the steps at https://www.drivereasy.com/knowledge/install-the-adb-driver-on-your-windows-pc-easily/#d and it said the best driver was already installed.

is the version of adb you using up to date?

Yes,

adb version
Android Debug Bridge version 1.0.41
Version 33.0.1-8253317
Installed as C:\Users\wmmccart\AppData\Local\Android\Sdk\platform-tools\adb.exe

whats is the oem build number of the herelink fw you are on? (settings > about phone)

OEM Build Number: BRU01211104