@@ -172,18 +172,18 @@ java.lang.NoClassDefFoundError: Failed resolution of: Ljava/lang/management/Mana
172
172
173
173
#### Build failures due to duplicate resource files
174
174
175
- Building a project for Android that depends on ` kotlinx-coroutines-debug ` (usually introduced by being a transitive
175
+ Building an Android project that depends on ` kotlinx-coroutines-debug ` (usually introduced by being a transitive
176
176
dependency of ` kotlinx-coroutines-test ` ) may fail with ` DuplicateRelativeFileException ` for ` META-INF/AL2.0 ` ,
177
177
` META-INF/LGPL2.1 ` , or ` win32-x86/attach_hotspot_windows.dll ` when trying to merge the Android resource.
178
178
179
- The problem is with the fact that Android merges the resources of all its dependencies into a single directory and
180
- complains about conflicts. However :
179
+ The problem is that Android merges the resources of all its dependencies into a single directory and complains about
180
+ conflicts, but :
181
181
* ` kotlinx-coroutines-debug ` transitively depends on JNA and JNA-platform, both of which include license files in their
182
- META-INF directories. Trying to merge their resources leads to problems , which means that any Android project that
182
+ META-INF directories. Trying to merge these files leads to conflicts , which means that any Android project that
183
183
depends on JNA and JNA-platform will experience build failures.
184
184
* Additionally, ` kotlinx-coroutines-debug ` embeds ` byte-buddy-agent ` and ` byte-buddy ` , along with their resource files.
185
185
Then, if the project separately depends on ` byte-buddy ` , merging the resources of ` kotlinx-coroutines-debug ` with ones
186
- from ` byte-buddy ` and ` byte-buddy-agent ` will lead to problems as the resource files are duplicated.
186
+ from ` byte-buddy ` and ` byte-buddy-agent ` will lead to conflicts as the resource files are duplicated.
187
187
188
188
One possible workaround for these issues is to add the following to the ` android ` block in your gradle file for the
189
189
application subproject:
@@ -202,8 +202,8 @@ This will cause the resource merge algorithm to exclude the problematic license
202
202
copy of the files needed for ` byte-buddy-agent ` to work.
203
203
204
204
Alternatively, avoid depending on ` kotlinx-coroutines-debug ` . In particular, if the only reason why this library a
205
- dependency of your project is that ` kotlinx-coroutines-test ` in turn depends on it, you may replace your dependency on
206
- ` kotlinx.coroutines.test ` with one that excludes ` kotlinx-coroutines-debug ` . For example, you could replace
205
+ dependency of your project is that ` kotlinx-coroutines-test ` in turn depends on it, you may change your dependency on
206
+ ` kotlinx.coroutines.test ` to exclude ` kotlinx-coroutines-debug ` . For example, you could replace
207
207
``` kotlin
208
208
androidTestImplementation(" org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines_version " )
209
209
```
0 commit comments