gpt4 book ai didi

android - progressBarStyle 不适用于 Android Studio

转载 作者:行者123 更新时间:2023-12-04 23:59:17 55 4
gpt4 key购买 nike

我对 Android Studio 有疑问。

Task :app:processDebugResources FAILEDAGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"/Users/luisabsg/.gradle/caches/transforms-2/files-2.1/270e51d2bcfda0833b0b336f50197a8a/jetified-folioreader-0.5.4/res/layout/progress_dialog.xml","position":{"startLine":16}}],"original":"ERROR:/Users/luisabsg/.gradle/caches/transforms-2/files-2.1/270e51d2bcfda0833b0b336f50197a8a/jetified-folioreader-0.5.4/res/layout/progress_dialog.xml:17: AAPT: error: resource android:attr/android:progressBarStyle not found.\n ","tool":"AAPT"}

任务“:app:processDebugResources”执行失败。

A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskActionAndroid resource linking failedERROR:/Users/luisabsg/.gradle/caches/transforms-2/files-2.1/270e51d2bcfda0833b0b336f50197a8a/jetified-folioreader-0.5.4/res/layout/progress_dialog.xml:17: AAPT: error: resource android:attr/android:progressBarStyle not found.

  • 尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。使用 --scan 运行以获得完整的见解。

enter image description here

最佳答案

AAPT: error: resource android:attr/android:progressBarStyle not found.

您将进度条的样式设置为 R.style.Widget_ProgressBar_Horizo​​ntal 。最后

style="@android:style/Widget.ProgressBar.Horizontal"

 style="?android:attr/progressBarStyleHorizontal"

仅供引用

Android resource linking failedERROR:/Users/luisabsg/.gradle/caches/transforms-2/files-2.1/270e51d2bcfda0833b0b336f50197a8a/jetified-folioreader-0.5.4/res/layout/progress_dialog.xml:17

在你的项目应用模块中转到:- Your-Project-Location -> /app/src/main/res/layout/ 并创建文件 progress_dialog.xml 并设置以下代码:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/layout_loading"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center">
<ProgressBar
android:id="@+id/loading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="?android:attr/progressBarStyle" />
<TextView
android:id="@+id/label_loading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:textSize="18sp"
android:textColor="@android:color/white"
android:text="@string/loading" />
</LinearLayout>
</RelativeLayout>

关于android - progressBarStyle 不适用于 Android Studio,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67493970/

55 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com