I get a similar error message, I fixed it by passing the absolute path instead of the file name, for example. inside the adb shell , this command shows:
shell@example :/sdcard $ pm install -r -d app-release.apk pkg: app-release.apk Failure [INSTALL_FAILED_INVALID_URI]
Change it to the absolute path corrected by that error message, for example:
pm install -r -d /sdcard/app-release.apk
source share