diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index d9d2f0b..1d0e845 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -18,22 +18,33 @@ if (keystorePropertiesFile.exists()) { } android { -// namespace = "com.ejada.hmg" namespace = "com.cloudsolutions.HMGPatientApp" compileSdk = 36 - ndkVersion = "28.2.13676358" + // Using NDK 26 for better compatibility with Zoom SDK native libraries + ndkVersion = "27.0.12077973" +// ndkVersion = "25.1.8937393" + + sourceSets { + getByName("main") { + jniLibs.srcDirs("src/main/jniLibs") + } + } defaultConfig { -// applicationId = "com.ejada.hmg" applicationId = "com.cloudsolutions.HMGPatientApp" // minSdk = 24 minSdk = 26 - targetSdk = 36 + targetSdk = 35 compileSdk = 36 // targetSdk = flutter.targetSdkVersion versionCode = flutter.versionCode versionName = flutter.versionName multiDexEnabled = true + + // Filter to arm64-v8a for better native library compatibility + ndk { + abiFilters += listOf("arm64-v8a", "armeabi-v7a") + } } buildFeatures { @@ -84,7 +95,7 @@ android { } } - packagingOptions { + packaging { jniLibs { pickFirsts += listOf( "lib/x86/libc++_shared.so", @@ -94,9 +105,16 @@ android { "**/*.so" ) useLegacyPackaging = true + // Keep Zoom SDK libraries unstripped to preserve symbols + keepDebugSymbols += listOf( + "*/libzoom_util.so", + "*/libzoom_check.so", + "*/libc++_shared.so" + ) } resources { excludes += listOf("META-INF/proguard/androidx-annotations.pro") + excludes.add("lib/*/libc++_shared.so") } } @@ -129,9 +147,13 @@ dependencies { implementation("com.google.code.gson:gson:2.12.0") // Zoom SDKs - implementation("us.zoom.videosdk:zoomvideosdk-core:1.12.10") - implementation("us.zoom.videosdk:zoomvideosdk-annotation:1.12.10") - implementation("us.zoom.videosdk:zoomvideosdk-videoeffects:1.12.10") +// implementation("us.zoom.videosdk:zoomvideosdk-core:1.12.10") +// implementation("us.zoom.videosdk:zoomvideosdk-annotation:1.12.10") +// implementation("us.zoom.videosdk:zoomvideosdk-videoeffects:1.12.10") + + implementation("us.zoom.videosdk:zoomvideosdk-core:2.1.10") + implementation("us.zoom.videosdk:zoomvideosdk-videoeffects:2.1.10") + implementation("us.zoom.videosdk:zoomvideosdk-annotation:2.1.10") // Networking implementation("com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.11") @@ -189,5 +211,39 @@ dependencies { implementation("com.whatsapp.otp:whatsapp-otp-android-sdk:0.1.0") coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.5") // implementation(project(":vitalSignEngine")) +} -} \ No newline at end of file +tasks.whenTaskAdded { + if (name.contains("merge") && name.contains("NativeLibs")) { + doLast { + val outputDir = File(project.buildDir, "intermediates/merged_native_libs/release/out/lib") + + // Handle both architectures + val abis = listOf("arm64-v8a", "armeabi-v7a") + abis.forEach { abi -> + val targetFile = File(outputDir, "$abi/libc++_shared.so") + val sourceFile = file("src/main/jniLibs/$abi/libc++_shared.so") + + if (sourceFile.exists() && targetFile.exists()) { + println("FORCING: Overwriting $abi version with known-good 1.2MB library") + sourceFile.copyTo(targetFile, overwrite = true) + } + } + } + } +} + +//tasks.whenTaskAdded { +// if (name.contains("merge") && name.contains("NativeLibs")) { +// doLast { +// val outputDir = File(project.buildDir, "intermediates/merged_native_libs/release/out/lib") +// val targetFile = File(outputDir, "arm64-v8a/libc++_shared.so") +// val sourceFile = file("src/main/jniLibs/arm64-v8a/libc++_shared.so") +// +// if (sourceFile.exists()) { +// println("FORCE REPLACING: Injecting 1.2MB libc++ into APK...") +// sourceFile.copyTo(targetFile, overwrite = true) +// } +// } +// } +//} \ No newline at end of file diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro index 9c1827a..94ad242 100644 --- a/android/app/proguard-rules.pro +++ b/android/app/proguard-rules.pro @@ -52,6 +52,11 @@ *; } +# Prevent stripping of standard C++ symbols +-keepclassmembers class * { + native ; +} + -dontwarn com.opentok.android.** -dontwarn com.opentok.otc.** diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 54e1a5e..7267f0a 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -133,6 +133,7 @@ android:screenOrientation="sensorPortrait" android:showOnLockScreen="true" android:usesCleartextTraffic="true" + android:extractNativeLibs="true" tools:replace="android:label"> diff --git a/android/app/src/main/jniLibs/arm64-v8a/libc++_shared.so b/android/app/src/main/jniLibs/arm64-v8a/libc++_shared.so new file mode 100755 index 0000000..a80c8b3 Binary files /dev/null and b/android/app/src/main/jniLibs/arm64-v8a/libc++_shared.so differ diff --git a/android/app/src/main/jniLibs/armeabi-v7a/libc++_shared.so b/android/app/src/main/jniLibs/armeabi-v7a/libc++_shared.so new file mode 100755 index 0000000..cbff8a9 Binary files /dev/null and b/android/app/src/main/jniLibs/armeabi-v7a/libc++_shared.so differ diff --git a/android/build/reports/problems/problems-report.html b/android/build/reports/problems/problems-report.html deleted file mode 100644 index 9b679bc..0000000 --- a/android/build/reports/problems/problems-report.html +++ /dev/null @@ -1,663 +0,0 @@ - - - - - - - - - - - - - Gradle Configuration Cache - - - -
- -
- Loading... -
- - - - - - diff --git a/pubspec.yaml b/pubspec.yaml index e1e4b3d..00d9d42 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -90,13 +90,10 @@ dependencies: location: ^8.0.1 gms_check: ^1.0.4 huawei_location: ^6.14.2+301 - huawei_health: ^6.16.0+300 +# huawei_health: ^6.16.0+300 intl: ^0.20.2 flutter_widget_from_html: ^0.17.1 - huawei_map: - git: - url: https://github.com/fleoparra/hms-flutter-plugin.git - path: flutter-hms-map + huawei_map: ^6.12.0+301 scrollable_positioned_list: ^0.3.8