flutter-rust-ffi icon indicating copy to clipboard operation
flutter-rust-ffi copied to clipboard

Solve the grey screen when ios project is released.

Open Aaron009 opened this issue 4 years ago • 2 comments

Aaron009 avatar Feb 06 '21 22:02 Aaron009

Thank you for the PR, @Aaron009

I understand that your code would be addressing the issue from https://github.com/brickpop/flutter-rust-ffi/issues/16 is this right?

I need to fully understand why these changes (mostly on the example app) would solve the release mode dropping the library symbols problem

brickpop avatar Feb 07 '21 14:02 brickpop

I just modified the following under the file "ios/Classes/SwiftMylibPlugin.swift".

  public func dummyMethodToEnforceBundling() {
    // dummy calls to prevent tree shaking
+   rust_cstr_free(nil);
    rust_greeting("");
  }

Regarding the problem of gray screen, I deleted the project and created it again.

Regarding why the release mode deletes symbols, I think this may be an optimization of ios. Uncalled symbols are deleted to reduce the size of the package. This is just my guess. If anyone knows it, please let me know.

Aaron009 avatar Feb 11 '21 20:02 Aaron009