Product: Native Android SDK
Product Version: 9.2.2 and 9.2.3
Please give a brief summary of your issue:
Compilation error after integrating PDFTron SDK.
Please describe your issue and provide steps to reproduce it:
- Setup the gradle files with PDFTron dependencies and private repo
- Build or hit Run in Android Studio
Result: Get these errors:
values.xml. Cause: java.lang.IllegalStateException: Can not add resource (com.android.aaptcompiler.ParsedResource@50082638) to table.). Check logs for more details.
Failed to compile values resource file /Users/seth/Projects/canopy/mobile/android/canopy/app/build/intermediates/incremental/clientDebug/mergeClientDebugResources/merged.dir/values/values.xml
Caused by: java.lang.IllegalStateException: Can not add resource (com.android.aaptcompiler.ParsedResource@50082638) to table.
Workaround: Use the AAR integration instead of gradle or use gradle integration referencing 9.2.1. Issue is introduced in 9.2.2 and continues in 9.2.3
Hello, I’m Ron, an automated tech support bot
While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:
I was able to replicate with the manual AAR integration as well. By updating the material library I get the same error.
Updating from 1.4.0 to 1.6.1:
Reverting back to material 1.4.0 works again:
Seems as though the PDFTron SDK isn’t updated to work with updated material library. That may be why I can’t integrate using Gradle Dependencies?
Could you let us know what your projects targetSDKVersion and compileSdkVersion is?
compileSdk = 31
targetSdk = 31
We have found the solution to the issue you were having.
It appears that Material 1.5.0 added in a resource called dividerThickness and in your project you also define your own resource called dividerThickness.
If you remove the your dividerThickness attribute from attrs.xml and it’s references, the project library will compile and run even with material:1.5.0
We have implemented that solution. Thank you!
This error usually occurs whenever You are using some special character in your native files especially if you are using ! or ‘ directly then you will face this type of error. You have to use a backslash while you are using it ! or ’
' #❎ Dont use this
\' #✅ this is Right
Or You are using ! then
! #❎ Dont use this
\! #✅ this is Right
And now your error will be solved. You can Read More about this error at here.