resource android:attr/android:progressBarStyle not found
Asked Answered
L

3

12

I've got this error when I tried to build my project after I updated Android Studio to the lastest version. I am getting below error:

C:\Users\YaCn.gradle\caches\transforms-2\files-2.1\5502c0022567bdcff063e0fb4352b137\folioreader-0.3.3\res\layout\progress_dialog.xml:10: AAPT: error: resource android:attr/android:progressBarStyle not found.

that XML :

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <LinearLayout android:id="@+id/layout_loading"
        android:layout_width="fill_parent"
        android:layout_height="fill_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/android: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>

build gradle file :

   apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.example.admin.hashtab"
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        multiDexEnabled true

        manifestPlaceholders = [manifestApplicationId          : "${applicationId}",
                                onesignal_app_id               : "654bcb8c-90a6-4012-924a-e18e5787a7de",
                                onesignal_google_project_number: "3520309722"]

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility = 1.8
        targetCompatibility = 1.8
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.1.0'
    implementation 'com.android.support:design:27.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    implementation 'com.loopj.android:android-async-http:1.4.9'
    implementation 'com.android.support:recyclerview-v7:27.1.0'
    implementation 'com.android.support:cardview-v7:27.1.0'
    implementation 'com.wang.avi:library:2.1.3'
    implementation 'com.makeramen:roundedimageview:2.3.0'
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
    implementation 'com.google.android.gms:play-services-ads:12.0.1'
    implementation 'com.google.android.gms:play-services-gcm:12.0.1'
    implementation 'com.google.android.gms:play-services-analytics:12.0.1'
    implementation 'com.onesignal:OneSignal:3.+@aar'
    implementation 'com.google.firebase:firebase-core:12.0.1'
    implementation 'com.github.ornolfr:rating-view:0.1.2@aar'
    implementation project(path: ':library')
    implementation project(path: ':SmoothCheckBox-master')
    implementation 'com.github.barteksc:android-pdf-viewer:2.8.2'
    implementation 'com.folioreader:folioreader:0.3.3'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.lmntrx.android.library.livin.missme:missme:0.1.5'
}
// Add to the bottom of the file
apply plugin: 'com.google.gms.google-services'
Laceration answered 31/8, 2019 at 0:18 Comment(0)
D
6

Try adding this to your dependency

implementation "com.folioreader:folioreader:0.5.4"//this is just the updated version as of now
implementation 'com.android.support:multidex:1.0.3' // ( for androidx)
configurations.matching { it.name == '_internal_aapt2_binary' }.all {
    config -> config.resolutionStrategy.eachDependency {
        details -> details.useVersion("3.3.2-5309881")
    } 
}
Doublehung answered 1/11, 2019 at 21:2 Comment(0)
S
5

You have used wrong syles.Just change your style to:

style="?android:attr/progressBarStyle"

instead of

style="?android:attr/android:progressBarStyle"
Shew answered 31/8, 2019 at 5:39 Comment(0)
E
2

Make a new file in layout, name it progress_dialog.xml and paste this code.

<LinearLayout android:id="@+id/layout_loading"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    android:gravity="center"
    xmlns:android="http://schemas.android.com/apk/res/android">

    <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>
Endicott answered 18/1, 2021 at 13:10 Comment(3)
Could you add why this solves the problem?Truce
I am not sure about this explanation, but I guess adding this file in layout supersedes the one in the library progress_dialog.xmlEndicott
This solution worked for me.Sparid

© 2022 - 2024 — McMap. All rights reserved.