fix/ADFA-1123 Better error message for missing assets zip#1155
fix/ADFA-1123 Better error message for missing assets zip#1155jomen-adfa wants to merge 3 commits intostagefrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 Walkthrough
WalkthroughReplaces progress-based handling with a flashError call for FileNotFoundException in AssetsInstallationHelper.doInstall; also updates the FileNotFoundException message in SplitAssetsInstaller.preInstall to include additional guidance when Environment.SPLIT_ASSETS_ZIP is missing. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
app/src/main/java/com/itsaky/androidide/assets/SplitAssetsInstaller.kt (1)
40-41: Move this user-facing message to string resources.Line 40-41 hardcodes UI-visible text in code. Since this string is flashed to users, keep it in
strings.xmlfor localization and easier updates.Proposed refactor
- throw FileNotFoundException("Assets zip file not found at path: ${Environment.SPLIT_ASSETS_ZIP.path}." + - " Please check Slack `#qa-testing-builds` channel for the latest version.") + throw FileNotFoundException( + context.getString( + R.string.err_split_assets_zip_missing_with_guidance, + Environment.SPLIT_ASSETS_ZIP.path + ) + )<!-- res/values/strings.xml --> <string name="err_split_assets_zip_missing_with_guidance"> Assets zip file not found at path: %1$s. Please check Slack `#qa-testing-builds` channel for the latest version. </string>🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/src/main/java/com/itsaky/androidide/assets/SplitAssetsInstaller.kt` around lines 40 - 41, The hardcoded user-facing message thrown in SplitAssetsInstaller (the FileNotFoundException creation) should be moved to strings.xml and loaded via resources; add a new string resource like err_split_assets_zip_missing_with_guidance with a %1$s placeholder for the path, then replace the literal in the throw inside SplitAssetsInstaller (where FileNotFoundException("Assets zip file not found at path: ${Environment.SPLIT_ASSETS_ZIP.path}...")) with a call that formats the resource (e.g., context.getString(R.string.err_split_assets_zip_missing_with_guidance, Environment.SPLIT_ASSETS_ZIP.path) or use Resources.getString) so the exception message is localized and not hardcoded.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@app/src/main/java/com/itsaky/androidide/assets/AssetsInstallationHelper.kt`:
- Line 135: In AssetsInstallationHelper.kt the call to
flashError("${e.message}") can display the literal "null" when e.message is
null; change the argument to use a safe fallback (e.g. use e.message ?:
e.toString() ?: "Unknown error" or e.localizedMessage ?:
e::class.java.simpleName) so flashError receives a meaningful string instead of
"null" (update the flashError call where the exception `e` is handled).
---
Nitpick comments:
In `@app/src/main/java/com/itsaky/androidide/assets/SplitAssetsInstaller.kt`:
- Around line 40-41: The hardcoded user-facing message thrown in
SplitAssetsInstaller (the FileNotFoundException creation) should be moved to
strings.xml and loaded via resources; add a new string resource like
err_split_assets_zip_missing_with_guidance with a %1$s placeholder for the path,
then replace the literal in the throw inside SplitAssetsInstaller (where
FileNotFoundException("Assets zip file not found at path:
${Environment.SPLIT_ASSETS_ZIP.path}...")) with a call that formats the resource
(e.g., context.getString(R.string.err_split_assets_zip_missing_with_guidance,
Environment.SPLIT_ASSETS_ZIP.path) or use Resources.getString) so the exception
message is localized and not hardcoded.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 5fb23c53-f08c-4758-806c-377432e0eacb
📒 Files selected for processing (2)
app/src/main/java/com/itsaky/androidide/assets/AssetsInstallationHelper.ktapp/src/main/java/com/itsaky/androidide/assets/SplitAssetsInstaller.kt
Show error message when assets zip is missing on install of debug APK and inform user where to get access to it