You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 47df801
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: Sources/SwiftJavaDocumentation/Documentation.docc/Android.md
+17-1Lines changed: 17 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,20 @@
1
-
# Android
1
+
# Android
2
+
3
+
## R8/Proguard Rules
4
+
5
+
Since swift-java uses JNI and reflection APIs, we must tell the R8 optimizer to ignore our wrapped types,
6
+
otherwise we will run into runtime crashes, because types are stripped from the APK/AAR.
7
+
8
+
The `SwiftKit` Java library already contains a [Proguard consumer file](https://developer.anbdroid.com/topic/performance/app-optimization/library-optimization),
9
+
which is automatically detected by R8, so any `org.swift.swiftkit` types are already ignored.
10
+
However, you must still provide rules for your own types.
11
+
12
+
For example, if your library is named is `org.swift.exampleapp`, then add the following rules to your proguard file:
0 commit comments