From a8416aa4f579dc36a25548b5cf0d3e154374541d Mon Sep 17 00:00:00 2001 From: Yurii Prykhodko Date: Tue, 30 Mar 2021 13:32:00 +0300 Subject: [PATCH 1/4] Add README section describing Android release build fix --- README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/README.md b/README.md index b9dadac0..08cda65a 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,43 @@ After that you can access the media/subtitle file by
+#### Android release build + +If you're using multiple plugins that depend on C++ libraries, +you might run into some problems building and running the app with this plugin. + +In order to fix this, you'll need to update your application's build configs. + +1. In `android/app/build.gradle`: +```groovy +android { + packagingOptions { + pickFirst 'lib/**/libc++_shared.so' + } + + buildTypes { + release { + minifyEnabled true + useProguard true + proguardFiles getDefaultProguardFile( + 'proguard-android-optimize.txt'), + 'proguard-rules.pro' + } + } +} +``` + +2. Create `android/app/proguard-rules.pro`, add the following lines: +```proguard +-keep class io.flutter.app.** { *; } +-keep class io.flutter.plugin.** { *; } +-keep class io.flutter.util.** { *; } +-keep class io.flutter.view.** { *; } +-keep class io.flutter.** { *; } +-keep class io.flutter.plugins.** { *; } +-keep class org.videolan.libvlc.** { *; } +``` + ## Quick Start To start using the plugin, copy this code or follow the example project in 'flutter_vlc_player/example' From 32501a76cc3b014170ec1ba2540af44641147c0b Mon Sep 17 00:00:00 2001 From: Yurii Prykhodko Date: Tue, 30 Mar 2021 13:49:16 +0300 Subject: [PATCH 2/4] Move the duplicate lib fix description to an inline comment. --- README.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 08cda65a..787b8727 100644 --- a/README.md +++ b/README.md @@ -75,17 +75,14 @@ After that you can access the media/subtitle file by
-#### Android release build - -If you're using multiple plugins that depend on C++ libraries, -you might run into some problems building and running the app with this plugin. - -In order to fix this, you'll need to update your application's build configs. +#### Android build configuration 1. In `android/app/build.gradle`: ```groovy android { packagingOptions { + // Fixes duplicate libraries build issue, + // when your project uses >=2 plugins that depend on C++ libs. pickFirst 'lib/**/libc++_shared.so' } From ecf7ad59d8f15b9148297d45e1ca97f085bd63ba Mon Sep 17 00:00:00 2001 From: Yurii Prykhodko Date: Tue, 30 Mar 2021 14:07:31 +0300 Subject: [PATCH 3/4] Keep only org.videolan.libvlc libs in recommended proguard-rules --- README.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/README.md b/README.md index 787b8727..5045d963 100644 --- a/README.md +++ b/README.md @@ -100,12 +100,6 @@ android { 2. Create `android/app/proguard-rules.pro`, add the following lines: ```proguard --keep class io.flutter.app.** { *; } --keep class io.flutter.plugin.** { *; } --keep class io.flutter.util.** { *; } --keep class io.flutter.view.** { *; } --keep class io.flutter.** { *; } --keep class io.flutter.plugins.** { *; } -keep class org.videolan.libvlc.** { *; } ``` From 5082945e32dc3c3b3e29b0e9b2df707537df42db Mon Sep 17 00:00:00 2001 From: Yurii Prykhodko Date: Tue, 30 Mar 2021 14:11:32 +0300 Subject: [PATCH 4/4] Comment in plain English --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5045d963..a29b093d 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ After that you can access the media/subtitle file by android { packagingOptions { // Fixes duplicate libraries build issue, - // when your project uses >=2 plugins that depend on C++ libs. + // when your project uses more than one plugin that depend on C++ libs. pickFirst 'lib/**/libc++_shared.so' }