Skip to content

deps(jni): Bump JNI to 1.0.0#3639

Draft
buenaflor wants to merge 9 commits into
mainfrom
deps/jni-1.0.0
Draft

deps(jni): Bump JNI to 1.0.0#3639
buenaflor wants to merge 9 commits into
mainfrom
deps/jni-1.0.0

Conversation

@buenaflor
Copy link
Copy Markdown
Contributor

@buenaflor buenaflor commented Apr 13, 2026

📜 Description

Now that the JNI packages is decoupled from Flutter we can easily bump it since we are not bound to the min Flutter version anymore.

💡 Motivation and Context

Fixes #3601
Closes #3620

💚 How did you test it?

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPii is enabled
  • I updated the docs if needed
  • All tests passing
  • No breaking changes

🔮 Next steps

buenaflor and others added 2 commits April 11, 2026 16:42
Migrate all JNI binding usage to the new API:
- Java setters/getters are now Dart property setters/getters
- Collection factories changed (JList.array -> JArrayList, JMap.hash -> JHashMap)
- Type checks use isA()/as() instead of $Type marker classes
- Conversion methods renamed (intValue -> toDartInt, etc.)
- JByteArray.from -> JByteArray.of
- Generic type params replace runtime T: named parameter

Add tool/generate_jni.dart with a custom jnigen visitor to exclude
getter/setter pairs with nullability mismatches (jnigen 0.16.0 bug
where getters return T? but setters accept T).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Keep the original JString key reference for removal instead of
converting to Dart string and back. Release non-matching keys
immediately to avoid accumulating JNI references.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@buenaflor buenaflor changed the title deps: bump JNI 1.0.0 deps(jni): Bump JNI to 1.0.0 Apr 16, 2026
buenaflor and others added 2 commits April 16, 2026 12:49
# Conflicts:
#	packages/flutter/lib/src/native/java/binding.dart
Regenerate binding.dart to incorporate new methods from the updated
Android SDK on main (isStrictTraceContinuation, orgId, projectId).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 16, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


Dependencies

  • (jni) Bump JNI to 1.0.0 by buenaflor in #3639

Internal Changes

  • (flutter-example) Fix macOS SPM build and bump AGP to 8.6.0 by buenaflor in #3644
  • (supabase) Fix flaky error client test for postgrest retry by buenaflor in #3643
  • Add dep update pattern to Dependencies changelog category by buenaflor in #3642
  • Replace Danger with release.yml changelog policy by buenaflor in #3641

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:

  • packages/flutter/lib/src/native/java/android_replay_recorder.dart

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.80%. Comparing base (aaa2730) to head (b01dbd0).
⚠️ Report is 18 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3639      +/-   ##
==========================================
+ Coverage   86.96%   91.80%   +4.83%     
==========================================
  Files         320      102     -218     
  Lines       10789     3479    -7310     
==========================================
- Hits         9383     3194    -6189     
+ Misses       1406      285    -1121     
Flag Coverage Δ
sentry ?
sentry_dio ?
sentry_drift ?
sentry_file ?
sentry_firebase_remote_config 100.00% <ø> (ø)
sentry_flutter 91.38% <ø> (ø)
sentry_hive ?
sentry_isar ?
sentry_link ?
sentry_logging ?
sentry_sqflite ?
sentry_supabase 97.27% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Use the custom generate_jni.dart tool instead of running jnigen
directly. The tool applies a visitor that excludes methods with
getter/setter nullability mismatches (jnigen 0.16.0 bug).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sentry
Copy link
Copy Markdown

sentry Bot commented Apr 16, 2026

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
sentry_flutter_example io.sentry.flutter.sample 9.17.0 (1) Release

⚙️ sentry-flutter Build Distribution Settings

buenaflor and others added 4 commits April 16, 2026 15:26
Flesh out the span-first trace lifecycle and navigator-observer
changelog entries with sub-bullets describing the behavior and dart
snippets showing how to opt in / restore the old default. Matches the
style used in the 9.0.0 and 9.14.0 release notes.


Made-with: Cursor

Co-authored-by: Cursor Agent <noreply@cursor.com>
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.

Update to jni 1.0.0 or jni_flutter in sentry_flutter JNI beforeSend blocking callback can crash due to incorrect isolate ownership check

1 participant