From 85e59899968f67e7ce86571548efffa51ecf13a0 Mon Sep 17 00:00:00 2001 From: Bryan Oltman Date: Mon, 9 Sep 2024 12:51:56 -0400 Subject: [PATCH 1/7] fix: update build.gradle to not strip symbols for *.so files --- add_to_app/AndroidAddToAppDemo/app/build.gradle | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/add_to_app/AndroidAddToAppDemo/app/build.gradle b/add_to_app/AndroidAddToAppDemo/app/build.gradle index d1c9090..2a294b7 100644 --- a/add_to_app/AndroidAddToAppDemo/app/build.gradle +++ b/add_to_app/AndroidAddToAppDemo/app/build.gradle @@ -24,6 +24,12 @@ android { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' signingConfig signingConfigs.debug + packagingOptions { + doNotStrip "*/arm64-v8a/*.so" + doNotStrip "*/armeabi-v7a/*.so" + doNotStrip "*/x86/*.so" + doNotStrip "*/x86_64/*.so" + } } } compileOptions { From 976a7470c4683fc80c2198b83eaab2ce5a0202a3 Mon Sep 17 00:00:00 2001 From: Bryan Oltman Date: Mon, 9 Sep 2024 12:53:46 -0400 Subject: [PATCH 2/7] Add comment --- add_to_app/AndroidAddToAppDemo/app/build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/add_to_app/AndroidAddToAppDemo/app/build.gradle b/add_to_app/AndroidAddToAppDemo/app/build.gradle index 2a294b7..eecfacb 100644 --- a/add_to_app/AndroidAddToAppDemo/app/build.gradle +++ b/add_to_app/AndroidAddToAppDemo/app/build.gradle @@ -24,6 +24,9 @@ android { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' signingConfig signingConfigs.debug + + // Necessary to ensure the libapp.so produced by Shorebird matches the one that ends up + // in the APK. packagingOptions { doNotStrip "*/arm64-v8a/*.so" doNotStrip "*/armeabi-v7a/*.so" From 382fce32d2bfc85153aea43c006cf2c516e9ca63 Mon Sep 17 00:00:00 2001 From: Bryan Oltman Date: Mon, 9 Sep 2024 12:55:29 -0400 Subject: [PATCH 3/7] Update doNotStrip args --- add_to_app/AndroidAddToAppDemo/app/build.gradle | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/add_to_app/AndroidAddToAppDemo/app/build.gradle b/add_to_app/AndroidAddToAppDemo/app/build.gradle index eecfacb..2eff321 100644 --- a/add_to_app/AndroidAddToAppDemo/app/build.gradle +++ b/add_to_app/AndroidAddToAppDemo/app/build.gradle @@ -28,10 +28,7 @@ android { // Necessary to ensure the libapp.so produced by Shorebird matches the one that ends up // in the APK. packagingOptions { - doNotStrip "*/arm64-v8a/*.so" - doNotStrip "*/armeabi-v7a/*.so" - doNotStrip "*/x86/*.so" - doNotStrip "*/x86_64/*.so" + doNotStrip "**/libapp.so" } } } From a3920b9fbb78979a8491eeabc4cf513b58f81abb Mon Sep 17 00:00:00 2001 From: Bryan Oltman Date: Mon, 9 Sep 2024 12:59:14 -0400 Subject: [PATCH 4/7] Use keepDebugSymbols --- add_to_app/AndroidAddToAppDemo/app/build.gradle | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/add_to_app/AndroidAddToAppDemo/app/build.gradle b/add_to_app/AndroidAddToAppDemo/app/build.gradle index 2eff321..b7ce191 100644 --- a/add_to_app/AndroidAddToAppDemo/app/build.gradle +++ b/add_to_app/AndroidAddToAppDemo/app/build.gradle @@ -27,9 +27,7 @@ android { // Necessary to ensure the libapp.so produced by Shorebird matches the one that ends up // in the APK. - packagingOptions { - doNotStrip "**/libapp.so" - } + packaging.jniLibs.keepDebugSymbols.add("**/libapp.so") } } compileOptions { From 75ff422e05b3ce9d851b919f4dba23ac3cd6f959 Mon Sep 17 00:00:00 2001 From: Bryan Oltman Date: Mon, 9 Sep 2024 13:02:01 -0400 Subject: [PATCH 5/7] Update add_to_app/AndroidAddToAppDemo/app/build.gradle Co-authored-by: Eric Seidel --- add_to_app/AndroidAddToAppDemo/app/build.gradle | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/add_to_app/AndroidAddToAppDemo/app/build.gradle b/add_to_app/AndroidAddToAppDemo/app/build.gradle index b7ce191..807c277 100644 --- a/add_to_app/AndroidAddToAppDemo/app/build.gradle +++ b/add_to_app/AndroidAddToAppDemo/app/build.gradle @@ -25,8 +25,12 @@ android { proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' signingConfig signingConfigs.debug - // Necessary to ensure the libapp.so produced by Shorebird matches the one that ends up - // in the APK. + // The Dart compiler builds libapp.so directly (does not use clang), and already strips + // symbols. However when llvm-strip is run on libapp.so, the symbols are re-sorted + // causing the hash of the library to change (which can confuse Shorebird tools). + // This line tells gradle to skip the unnecessary llvm-strip step for libapp.so + // thus ensuring that the libapp.so that Shorebird sees is byte-identical to the one + // which ends up in the APK/AAR/AAB. packaging.jniLibs.keepDebugSymbols.add("**/libapp.so") } } From 5c18b05d995efeffffc7da279694455184724437 Mon Sep 17 00:00:00 2001 From: Bryan Oltman Date: Mon, 9 Sep 2024 13:02:35 -0400 Subject: [PATCH 6/7] Update targetSdk --- add_to_app/AndroidAddToAppDemo/app/build.gradle | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/add_to_app/AndroidAddToAppDemo/app/build.gradle b/add_to_app/AndroidAddToAppDemo/app/build.gradle index 807c277..678287f 100644 --- a/add_to_app/AndroidAddToAppDemo/app/build.gradle +++ b/add_to_app/AndroidAddToAppDemo/app/build.gradle @@ -10,10 +10,8 @@ android { defaultConfig { applicationId "com.example.addtoappdemo" minSdk 24 - // This needs to be 33 or lower-Shorebird currently does not support 34+ - // See https://github.com/shorebirdtech/shorebird/issues/2369 - targetSdk 33 - versionCode 14 + targetSdk 34 + versionCode 2 versionName "1.0.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" From cf6d3c4ce10e85e9bc746f3d24e49d4babef957f Mon Sep 17 00:00:00 2001 From: Bryan Oltman Date: Mon, 9 Sep 2024 13:03:16 -0400 Subject: [PATCH 7/7] Formatting --- add_to_app/AndroidAddToAppDemo/app/build.gradle | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/add_to_app/AndroidAddToAppDemo/app/build.gradle b/add_to_app/AndroidAddToAppDemo/app/build.gradle index 678287f..451c188 100644 --- a/add_to_app/AndroidAddToAppDemo/app/build.gradle +++ b/add_to_app/AndroidAddToAppDemo/app/build.gradle @@ -23,12 +23,12 @@ android { proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' signingConfig signingConfigs.debug - // The Dart compiler builds libapp.so directly (does not use clang), and already strips - // symbols. However when llvm-strip is run on libapp.so, the symbols are re-sorted - // causing the hash of the library to change (which can confuse Shorebird tools). - // This line tells gradle to skip the unnecessary llvm-strip step for libapp.so - // thus ensuring that the libapp.so that Shorebird sees is byte-identical to the one - // which ends up in the APK/AAR/AAB. + // The Dart compiler builds libapp.so directly (does not use clang),and already strips + // symbols. However when llvm-strip is run on libapp.so, the symbols are re-sorted + // causing the hash of the library to change (which can confuse Shorebird tools). + // This line tells gradle to skip the unnecessary llvm-strip step for libapp.so + // thus ensuring that the libapp.so that Shorebird sees is byte-identical to the one + // which ends up in the APK/AAR/AAB. packaging.jniLibs.keepDebugSymbols.add("**/libapp.so") } }