小编Lor*_*nto的帖子

找到 2 个文件,路径为“META-INF/LGPL2.11”

有人知道如何调试这个吗?我无法弄清楚哪些库产生了问题。

旁注,它只发生在我尝试运行 Android 测试时,所以我最好的猜测是它与某些测​​试库有关。


    testImplementation "androidx.room:room-testing:$version_room"
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
    androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.4.0'
    // Compose Tests
    androidTestImplementation "androidx.compose.ui:ui-test-junit4:$version_compose"
    debugImplementation "androidx.compose.ui:ui-test-manifest:$version_compose"
    // Hilt test
    androidTestImplementation "com.google.dagger:hilt-android-testing:$version_hilt"
    kaptAndroidTest "com.google.dagger:hilt-android-compiler:$version_hilt"
    debugImplementation 'androidx.fragment:fragment-testing:1.3.6'
Run Code Online (Sandbox Code Playgroud)
Execution failed for task ':app:mergeDebugAndroidTestJavaResource'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
   > 2 files found with path 'META-INF/LGPL2.1' from inputs:
      - /home/lbenevento/.gradle/caches/transforms-3/1e2dfa6057fe4e701d175f47b1099efa/transformed/jetified-jna-platform-5.5.0.jar
      - /home/lbenevento/.gradle/caches/transforms-3/405542266c1c406c39ff1a20cb26a332/transformed/jetified-jna-5.5.0.jar
     Adding a packagingOptions block may help, please refer to
     https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.PackagingOptions.html
     for more information

* Try:
Run with --info or --debug option to get more log …
Run Code Online (Sandbox Code Playgroud)

android gradle android-testing android-jetifier

20
推荐指数
3
解决办法
2万
查看次数

recyclerView 中的某些项目未调用 doOnPreDraw 方法

我在回收器视图中的某些动画时遇到问题。我在onViewAttachedToWindow中做了相关测量:

override fun onViewAttachedToWindow(holder: PairingViewHolder) {
        super.onViewAttachedToWindow(holder)

        // get originalHeight & expandedHeight if not gotten before
        if (holder.expandedHeight < 0) {
            // Execute pending bindings, otherwise the measurement will be wrong.
            holder.itemViewDataBinding.executePendingBindings()
            holder.cardContainer.layoutParams.width = expandedWidth
            holder.expandedHeight = 0 // so that this block is only called once

            holder.cardContainer.doOnLayout { view ->

                holder.originalHeight = view.height
                holder.expandView.isVisible = true

                // show expandView and record expandedHeight in next layout pass
                // (doOnPreDraw) and hide it immediately.
                view.doOnPreDraw {
                    holder.expandedHeight = view.height
                    holder.expandView.isVisible = …
Run Code Online (Sandbox Code Playgroud)

animation android visibility android-recyclerview

7
推荐指数
1
解决办法
1603
查看次数

Compose 中的自定义图标

我有一个用于动态定义菜单的数据类。

data class ActionItemSpec(
    val contentDescription: String,
    val icon: ImageVector,
    val onClick: () -> Unit
)
Run Code Online (Sandbox Code Playgroud)

我的问题是,当使用标准图标时,它可以完美地工作,但此类问题是它不能采用其他任何东西,例如自定义可绘制对象。

如何从自定义可绘制对象创建 ImageVector?你可以撰写吗?

icons android vector drawable android-jetpack-compose

3
推荐指数
1
解决办法
1963
查看次数