Commit 47c4640
authored
fix: Build warnings and compatibility issues across Android and MAUI (.NET) SDKs. (#439)
## Summary
Fix build warnings and compatibility issues across Android and MAUI
(.NET) SDKs, upgrade Dokka to 2.1.0, and make GeckoView lazy-loaded in
the E2E app.
## Changes
### Android SDK (`observability-android`)
- **Upgrade Dokka 2.0.0 → 2.1.0**: Migrated to the V2 plugin mode
(`V2EnabledWithHelpers`) and adopted the new `dokka { }` DSL, replacing
the deprecated `tasks.dokkaJavadoc` configuration. Added `dokka-javadoc`
plugin.
- **Replace deprecated `kotlinOptions` with `kotlin { compilerOptions {
} }`**: Applies to both `observability-android` and
`mobile-dotnet/android/native/LDObserve` Gradle build scripts.
- **C native library adjustments**: Bumped compiler optimization from
`-O2` to `-O3`; added `-Wl,-z,max-page-size=16384` linker option to
support Android 16KB page-size devices.
### MAUI / .NET SDK (`mobile-dotnet`)
- **Exclude LD Client SDK doc content files**: Added
`ExcludeAssets="contentFiles"` to the `LaunchDarkly.ClientSdk`
PackageReference in both `LDObservability.csproj` and
`LDObservability.Fat.csproj` to prevent the LD SDK's content files from
being included in the output.
- **Fix deprecated Java boxing constructors**: Replaced `new
Java.Lang.Boolean(b)`, `new Java.Lang.Integer(i)`, etc. with
`Java.Lang.Boolean.ValueOf(b)`, `Java.Lang.Integer.ValueOf(i)`, etc. in
`DictionaryTypeConverters.cs` to eliminate deprecation warnings.
- **Fix nullable value type in dictionaries**: Changed
`IDictionary<string, object>?` to `IDictionary<string, object?>?` in
`ToJavaDictionary` to properly handle nullable attribute values.
- **Remove unbindable Kotlin companion field**: Added a `remove-node`
transform in `Metadata.xml` to suppress binding warning BG8400 for
`LDObserveBridgeAdapter.Companion`.
### E2E Android App
- **Lazy-load GeckoView**: GeckoView instances are no longer eagerly
created — they are loaded on tap. This avoids crashes on emulators/CI
where GeckoEngine is unavailable. Applies to both Compose
(`LazyGeckoViewItem`) and XML (`setupLazyGeckoView`) activities.
- **Layout restructure**: WebViews remain in a scrollable section;
GeckoViews are placed outside the scroll area as fixed-height,
tap-to-load containers.
- **Add `android:extractNativeLibs="true"`** to `AndroidManifest.xml`.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Medium risk due to build/packaging and native build flag changes
(Dokka upgrade, Kotlin compiler config, CMake linker options, and .NET
binding transforms) that could affect release artifacts, plus UI
behavior changes for GeckoView loading.
>
> **Overview**
> Improves build compatibility across the Android and MAUI (.NET) SDKs
by **upgrading Dokka to 2.1.0** (switching to the new `dokka {}` DSL /
V2 plugin mode) and modernizing Kotlin Gradle config to `kotlin {
compilerOptions { ... } }`.
>
> Adjusts packaging/binding behavior in the .NET Android binding and
observability projects by suppressing additional binding warnings,
removing an unbindable Kotlin `Companion` field via `Metadata.xml`,
excluding `LaunchDarkly.ClientSdk` `contentFiles`, and tightening
Android JNI marshalling helpers (nullable attribute values and `ValueOf`
boxing).
>
> Updates the E2E Android app to **lazy-load GeckoView on tap** (Compose
and XML), restructures the XML layout to keep WebViews scrollable while
GeckoViews sit in fixed containers, adds
`android:extractNativeLibs="true"`, and tweaks the native `tile_hash`
build to `-O3` plus a 16KB page-size linker option.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
ae9715c. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 569a7b4 commit 47c4640
14 files changed
Lines changed: 241 additions & 168 deletions
File tree
- e2e/android/app/src
- compose/java/com/example/androidobservability/masking
- main
- java/com/example/androidobservability/masking
- res/layout
- sdk/@launchdarkly
- mobile-dotnet
- android
- LDObserve.Android.Binding
- Transforms
- native/LDObserve
- observability
- bridge
- sample
- observability-android
- lib
- src/main/cpp
Lines changed: 85 additions & 77 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
23 | | - | |
| 25 | + | |
| 26 | + | |
24 | 27 | | |
| 28 | + | |
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
| |||
46 | 50 | | |
47 | 51 | | |
48 | 52 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
56 | | - | |
57 | 57 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 58 | + | |
68 | 59 | | |
69 | | - | |
70 | | - | |
71 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
72 | 77 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
87 | 93 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
| 94 | + | |
| 95 | + | |
97 | 96 | | |
98 | | - | |
| 97 | + | |
99 | 98 | | |
100 | 99 | | |
101 | | - | |
| 100 | + | |
102 | 101 | | |
103 | 102 | | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
| 103 | + | |
| 104 | + | |
113 | 105 | | |
114 | | - | |
| 106 | + | |
115 | 107 | | |
116 | 108 | | |
117 | | - | |
| 109 | + | |
118 | 110 | | |
119 | 111 | | |
120 | 112 | | |
| |||
152 | 144 | | |
153 | 145 | | |
154 | 146 | | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
164 | 173 | | |
165 | | - | |
166 | 174 | | |
167 | | - | |
168 | | - | |
169 | | - | |
| 175 | + | |
| 176 | + | |
170 | 177 | | |
171 | | - | |
172 | 178 | | |
173 | | - | |
174 | 179 | | |
175 | 180 | | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
| 181 | + | |
181 | 182 | | |
182 | | - | |
183 | 183 | | |
184 | | - | |
185 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
186 | 194 | | |
187 | 195 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
Lines changed: 48 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
25 | | - | |
26 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
27 | 40 | | |
28 | 41 | | |
29 | 42 | | |
| |||
34 | 47 | | |
35 | 48 | | |
36 | 49 | | |
37 | | - | |
38 | | - | |
39 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
40 | 58 | | |
41 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
42 | 62 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
47 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
48 | 86 | | |
49 | 87 | | |
0 commit comments