Improve poorly written Android install failure messages. Closes #1459

* We also add a new message specifically for when the install succeeds but we
  can't verify it, to indicate the problem better than suggesting that
  permission errors are at fault.
This commit is contained in:
baldurk
2019-07-22 13:30:26 +01:00
parent 93fbb5e300
commit 09df7a12c6
3 changed files with 44 additions and 17 deletions
+20 -13
View File
@@ -2878,31 +2878,38 @@ bool MainWindow::LoadLayout(int layout)
void MainWindow::showLaunchError(ReplayStatus status)
{
QString title;
QString message;
switch(status)
{
case ReplayStatus::AndroidGrantPermissionsFailed:
title = tr("Permission is required");
message = tr("Enable RenderDocCmd to access storage on your device.");
message =
tr("Failed to automatically grant Android permissions to installed server.\n\n"
"Please manually allow the RenderDocCmd program storage permissions on your device "
"to ensure correct functionality.");
break;
case ReplayStatus::AndroidABINotFound:
title = tr("Failed to install RenderDoc server");
message = tr("Couldn't determine supported ABIs.");
message =
tr("Couldn't determine supported ABIs for your device, please check device connection "
"and status.");
break;
case ReplayStatus::AndroidAPKFolderNotFound:
title = tr("Failed to install RenderDoc server");
message = tr("APK folder missing.");
message = tr("Couldn't find APK folder, please check that your installation is complete.");
break;
case ReplayStatus::AndroidAPKInstallFailed:
title = tr("Failed to install RenderDoc server");
message = tr("Couldn't find any installed APKs.");
default:
title = tr("Failed to install RenderDoc server");
message = tr("Unknown error.");
message =
tr("Couldn't install APK, please check that your device is connected and accessible to "
"adb.");
case ReplayStatus::AndroidAPKVerifyFailed:
message =
tr("Couldn't correctly verify installed APK version.\n\n"
"Please check your installation is not corrupted, or if this is a custom build check "
"that all ABIs are built at the same version as this program.");
break;
default: message = tr("Unexpected error: %1.").arg(ToQStr(status)); break;
}
GUIInvoke::call(this, [this, title, message]() { RDDialog::warning(this, title, message); });
GUIInvoke::call(this, [this, message]() {
RDDialog::warning(this, tr("Problems installing RenderDoc server"), message);
});
}
bool MainWindow::isCapturableAppRunningOnAndroid()
+17 -2
View File
@@ -480,11 +480,25 @@ ReplayStatus InstallRenderDocServer(const std::string &deviceID)
if(!success)
{
status = ReplayStatus::AndroidGrantPermissionsFailed;
RDCLOG("Failed to install APK. stdout: %s, stderr: %s", trim(adbInstall.strStdout).c_str(),
trim(adbInstall.strStderror).c_str());
RDCLOG("Retrying...");
adbExecCommand(deviceID, "install -r \"" + apk + "\"");
success = CheckAndroidServerVersion(deviceID, abi);
if(success)
{
// if it succeeded this time, then it was the permission grant that failed
status = ReplayStatus::AndroidGrantPermissionsFailed;
}
else
{
// otherwise something went wrong with verifying. If the install failed completely we'll
// return AndroidAPKInstallFailed below, otherwise return a code indicating we couldn't
// verify the install properly.
status = ReplayStatus::AndroidAPKVerifyFailed;
}
}
}
@@ -653,7 +667,8 @@ extern "C" RENDERDOC_API ReplayStatus RENDERDOC_CC RENDERDOC_StartAndroidRemoteS
// If server is not detected or has been removed due to incompatibility, install it
status = Android::InstallRenderDocServer(deviceID);
if(status != ReplayStatus::Succeeded && status != ReplayStatus::AndroidGrantPermissionsFailed)
if(status != ReplayStatus::Succeeded && status != ReplayStatus::AndroidGrantPermissionsFailed &&
status != ReplayStatus::AndroidAPKVerifyFailed)
{
RDCERR("Failed to install RenderDoc server app");
return status;
+7 -2
View File
@@ -3204,10 +3204,14 @@ a remote server.
.. data:: AndroidAPKFolderNotFound
Couldn't find the build-android folder which contains the Android remote server APK.
Couldn't find the folder which contains the Android remote server APK.
.. data:: AndroidAPKInstallFailed
Failed to install Android remote server for unknown reasons.
.. data:: AndroidAPKVerifyFailed
Failed to install Android remote server.
)");
enum class ReplayStatus : uint32_t
@@ -3235,7 +3239,8 @@ enum class ReplayStatus : uint32_t
AndroidGrantPermissionsFailed,
AndroidABINotFound,
AndroidAPKFolderNotFound,
AndroidAPKInstallFailed
AndroidAPKInstallFailed,
AndroidAPKVerifyFailed,
};
DECLARE_REFLECTION_ENUM(ReplayStatus);