FolioReader / FolioReader-Android

A Java ePub reader and parser framework for Android.
BSD 3-Clause "New" or "Revised" License
2.24k stars 715 forks source link

AAPT: error: resource android:attr/android:progressBarStyle not found #389

Closed zhirshya closed 4 years ago

zhirshya commented 4 years ago

FolioReader version - 0.5.4 FolioReader Stock / Modified - Stock.

Android SDK - minSdkVersion 21, targetSdkVersion 29

Mobile / Tablet / Emulator Info - This is a build error.

Crash / Error - ~/.gradle/caches/transforms-2/files-2.1/3b37d1e20c2d569e237caae59c970fe0/folioreader-0.5.4/res/layout/progress_dialog.xml:13: AAPT: error: resource android:attr/android:progressBarStyle not found.

Steps to reproduce / Describe in detail - Add "implementation 'com.folioreader:folioreader:0.5.4'" in application build.gradle, but haven't added any code that uses it, and the error disappears upon commenting out "implementation 'com.folioreader:folioreader:0.5.4'".

AndroidStudio 3.5 ext.kotlin_version = '1.3.41' classpath 'com.android.tools.build:gradle:3.5.0'.

KishanViramgama commented 4 years ago

@zhirshya

Try this

Module:app

dependencies { configurations.matching { it.name == '_internal_aapt2_binary' }.all { config -> config.resolutionStrategy.eachDependency { details -> details.useVersion("3.3.2-5309881") } } }

shabana0508 commented 4 years ago

@zhirshya Try this android:attr/progressBarStyle instead of "android:attr/android:progressBarStyle"

ahmedProgrammation commented 4 years ago

thanks you very match for solution :
add to build.gradle :

dependencies { implementation "com.folioreader:folioreader:0.5.4" 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") } } }

zhirshya commented 4 years ago

Thanks everyone, configurations.matching { it.name == '_internal_aapt2_binary' }.all { config -> config.resolutionStrategy.eachDependency { details -> details.useVersion("3.3.2-5309881") } } solved the issue I had.

sgehrman commented 4 years ago

same problem. I'm using flutter, so I don't understand this solution. Can't you just fix the code?

voipworld commented 4 years ago

hello, i used the solution to make it work, but any final solution?

washeeeq commented 4 years ago

Tried above suggested solution unfortunately it ended while building with:

AAPT: unknown option '--proguard-minimal-keep-rules'.

aapt2 link [options] -o arg --manifest arg files...

Options: -o arg Output path. --manifest arg Path to the Android manifest to build. -I arg Adds an Android APK to link against. -A arg An assets directory to include in the APK. These are unprocessed. -R arg Compilation unit to link, using overlay semantics. The last conflicting resource given takes precedence. --package-id arg Specify the package ID to use for this app. Must be greater or equal to 0x7f and can't be used with --static-lib or --shared-lib. --java arg Directory in which to generate R.java.

Yahoo-Mike commented 3 years ago

This workaround used to work for me, but after upgrading Android Studio I get the same "--proguard-minimal-keep-rules" error as @washeeeq .

Creating the _progressdialog.xml file from the solution in #406 worked for me. I removed the "configurations.matching{}" workaround, too.

sdilizio commented 3 years ago

I also get the "--proguard-minimal-keep-rules" error. Have tried the solution to #406 with no luck.

If I change style="?android:attr/android:progressBarStyle" to "style="?android:attr/progressBarStyle", it simply changes back when the app is built and gives the same error.

Any ideas?

y-ziane commented 3 years ago

I also get the "--proguard-minimal-keep-rules" error. Have tried the solution to #406 with no luck.

If I change style="?android:attr/android:progressBarStyle" to "style="?android:attr/progressBarStyle", it simply changes back when the app is built and gives the same error.

Any ideas?

Hey did u manage to solve it ? i'm facing the same problem :(

sdilizio commented 3 years ago

y-ziane, believe I tried just replacing the code as per #406, and this didn't work. When I properly deleted the original progress_dialog.xml and then recreated it with the code, I think that's when it worked for me.

VictorKabata commented 3 years ago

thanks you very match for solution : add to build.gradle :

dependencies { implementation "com.folioreader:folioreader:0.5.4" 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") } } }

The above solution together with #406 fixed the issue for me

Ader0m commented 2 years ago

In build.gradle (:app) dependencies { configurations.matching { it.name == '_internal_aapt2_binary' }.all { config -> config.resolutionStrategy.eachDependency { details -> details.useVersion("3.3.2-5309881") } } }

Hello, I use this solution in my project, but it still leads to such an error. I suffer a lot of time, help me pls.

ERROR:C:\Users\Vlad.gradle\caches\transforms-3\c9df99c4345292133a8da2f8096f1b5a\transformed\jetified-folioreader-0.5.4\res\layout\progress_dialog.xml:17: AAPT: error: resource android:attr/android:progressBarStyle not found.