Skip to content

fix 16 kB alignment issue returns with computer visio#1010

Merged
Daniel-ADFA merged 5 commits intostagefrom
ADFA-2975
Mar 2, 2026
Merged

fix 16 kB alignment issue returns with computer visio#1010
Daniel-ADFA merged 5 commits intostagefrom
ADFA-2975

Conversation

@Daniel-ADFA
Copy link
Contributor

No description provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9016af7 and 203a1ff.

📒 Files selected for processing (1)
  • app/build.gradle.kts
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/build.gradle.kts

📝 Walkthrough

Release Notes

Changes

  • JNI Library Packaging (app/build.gradle.kts)

    • Disabled legacy packaging for JNI libraries by setting useLegacyPackaging = false in the Android packaging configuration
    • Resolves 16 kB alignment issues with native library packaging in the APK
  • ML Framework Upgrades (cv-image-to-xml/build.gradle.kts)

    • Migrated from TensorFlow Lite to LiteRT (Google's new inference engine) at version 1.0.1
      • Added litert, litert-support, and litert-gpu dependencies
    • Updated ML Kit Text Recognition from 16.0.0 to 16.0.1 (patch version bump)

Risk Assessment

⚠️ Potential Risks:

  • Breaking Change Risk: Migration from TensorFlow Lite to LiteRT may require code updates if TensorFlow Lite-specific APIs are directly used in the cv-image-to-xml module. Verify compatibility with existing ML model loading and inference code.
  • APK Structure Change: Disabling legacy JNI packaging changes how native libraries are embedded in the APK. This could affect:
    • APK size and compression ratios
    • Installation on older Android devices
    • Native library loading paths at runtime
    • Compatibility with app signing and distribution processes

Recommended Testing:

  • Verify native library loading works correctly on target Android API levels
  • Test cv-image-to-xml ML model inference functionality post-migration
  • Validate APK generation and installation on supported devices
  • Check for any runtime crashes related to native code or ML operations

Walkthrough

Two Gradle build configuration files were updated: JNI packaging behavior was reconfigured in the Android build, and TensorFlow Lite dependencies were replaced with litert equivalents while ML Kit Text Recognition was updated to a newer patch version.

Changes

Cohort / File(s) Summary
Android Build Configuration
app/build.gradle.kts
Added JNI packaging configuration setting useLegacyPackaging to false under jniLibs block.
Dependency Updates
cv-image-to-xml/build.gradle.kts
Replaced TensorFlow Lite dependencies with litert, litert-support, and litert-gpu (v1.0.1). Updated ML Kit Text Recognition from 16.0.0 to 16.0.1.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A hop and a skip through the build we go,
JNI packaged fresh, let legacy go!
TensorFlow flows to litert's new light,
Dependencies updated, everything's right! ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title mentions a '16 kB alignment issue' but the changes only add JNI packaging configuration and update dependencies, with no clear connection to alignment issues. Revise the title to accurately describe the main changes: updating JNI packaging configuration and replacing TensorFlow Lite dependencies with litert equivalents.
Description check ❓ Inconclusive No description was provided by the author, making it impossible to assess whether the description relates to the changeset. Add a pull request description explaining the purpose of the changes, including why JNI packaging was modified and why the dependency updates were necessary.
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ADFA-2975

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@cv-image-to-xml/build.gradle.kts`:
- Around line 41-45: YoloModelSource.kt still imports and constructs legacy
TensorFlow Lite types (Interpreter, TensorImage, TensorBuffer, ImageProcessor,
etc.), causing compatibility with the newly added LiteRT libs; update
YoloModelSource.kt to replace those usages with the LiteRT equivalents from
com.google.ai.edge.litert (use the LiteRT Interpreter/client APIs,
TensorImage/TensorBuffer replacements and image preprocessing utilities provided
by litert), remove or replace imports of org.tensorflow.lite.* and map the model
loading, invocation, and tensor handling code (where functions/constructors
reference Interpreter, ImageProcessor, TensorImage, TensorBuffer) to the
corresponding LiteRT APIs so model inference and preprocessing use the litert
classes and methods consistently.

In `@gradle.properties`:
- Around line 34-35: The gradle property android.enableR8.fullMode is
ineffective because proguard-rules.pro contains -dontshrink which disables
shrinking; either remove android.enableR8.fullMode from gradle.properties if
minification is intentionally off, or remove the -dontshrink entry in
proguard-rules.pro and run/verify release builds (using existing keep rules) to
ensure minification with fullMode succeeds—update whichever file contains the
chosen change and re-run a release build to confirm no missing-keep issues.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f7befd3 and 9016af7.

📒 Files selected for processing (3)
  • app/build.gradle.kts
  • cv-image-to-xml/build.gradle.kts
  • gradle.properties

@Daniel-ADFA Daniel-ADFA merged commit c254794 into stage Mar 2, 2026
2 checks passed
@Daniel-ADFA Daniel-ADFA deleted the ADFA-2975 branch March 2, 2026 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants