Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Using intent package crashes the realm based app in release builds #1968

Closed
7 tasks done
milindgoel15 opened this issue Jul 15, 2023 · 6 comments
Closed
7 tasks done
Labels
bug Something isn't working Stale triage

Comments

@milindgoel15
Copy link

milindgoel15 commented Jul 15, 2023

Platform

Android 13

Plugin

android intent plus

Version

4.0.1

Flutter SDK

3.10.5

Steps to reproduce

  1. Added android intent plus.
  2. Built a release apk
  3. The app crashes with realmexception
realmexception: error opening realm at path ./default.realm. error code: 1018 . message: failed to open file at path './default.realm.lock': read-only file system flutter

Also, weirdly, while building the release apk with the plugin, it outputs all the files to android/app/build/outputs and build/app/outputs/flutter-apk folders instead of the usual build/app/outputs folders only.

Code Sample

No response

Logs

These are the logs from debug variant of prod release. (i ran with prod flavor tho) Any debug variant works fine. Release build doesnt

https://pastebin.com/14r4cw4Z

Flutter Doctor

[✓] Flutter (Channel stable, 3.10.5, on Microsoft Windows [Version 10.0.22621.1992], locale en-IN)
    • Flutter version 3.10.5 on channel stable at C:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 796c8ef792 (5 weeks ago), 2023-06-13 15:51:02 -0700
    • Engine revision 45f6e00911
    • Dart version 3.0.5
    • DevTools version 2.23.1

[✓] Windows Version (Installed version of Windows is version 10 or higher)

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at C:\Users\Lenovo\AppData\Local\Android\Sdk
    • Platform android-33-ext4, build-tools 33.0.1
    • ANDROID_SDK_ROOT = C:\Users\Lenovo\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)
    • All Android licenses accepted.

[✓] Android Studio (version 2022.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)

[✓] VS Code, 64-bit edition (version 1.80.0)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 3.66.0

[✓] Connected device (1 available)
    • 2109119DI (mobile) • 417812e0 • android-arm64 • Android 13 (API 33)

[✓] Network resources
    • All expected network resources are available.

• No issues found!

Checklist before submitting a bug

  • I Google'd a solution and I couldn't find it
  • I searched on StackOverflow for a solution and I couldn't find it
  • I read the README.md file of the plugin
  • I'm using the latest version of the plugin
  • All dependencies are up to date with flutter pub upgrade
  • I did a flutter clean
  • I tried running the example project
@milindgoel15 milindgoel15 added bug Something isn't working triage labels Jul 15, 2023
@milindgoel15
Copy link
Author

milindgoel15 commented Jul 17, 2023

An update to this issue. I am not sure if it's a plugin issue or a Gradle problem. But in my case, I solved this by changing the subProjects block present in Android/build.gradle file back to 2 separate blocks. For some reason, having them combined raises the realm exception as mentioned above, breaking the app only after adding the intent package.

Feel free to close this issue if this cant be solved from the plugin's end.

@vbuberen
Copy link
Collaborator

vbuberen commented Aug 1, 2023

But in my case, I solved this by changing the subProjects block present in Android/build.gradle file back to 2 separate blocks. For some reason, having them combined raises the realm exception as mentioned above, breaking the app only after adding the intent package.

Could you please share a code snippet on what changed and helped you? Would appreciate it as didn't get what was the solution.

@milindgoel15
Copy link
Author

You can refer to this comment on what causes the realm-based app to throw realm exception on adding certain packages.

realm/realm-dart#1355 (comment)

If you need a minimal reproducible repository, lemme know

@github-actions
Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days

@github-actions github-actions bot added the Stale label Oct 31, 2023
@milindgoel15
Copy link
Author

Any update on this? We can close this issue if it's something not fixable on the plugin's end.

@github-actions github-actions bot removed the Stale label Nov 1, 2023
Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days

@github-actions github-actions bot added the Stale label Jan 31, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale triage
Projects
None yet
Development

No branches or pull requests

2 participants