Closed llanginger closed 2 years ago
Whoops, I didn't mention in my original post that this is using react-native version 0.60.4!
My best guess from reading the logs is that this issue is due to some architectural change in RN 0.60.x meaning that the reference to those specific resource files (dialogCornerRadius, fontVariationSettings and ttcIndex) need to be edited.
Thanks in advance!
Did you try to bump your minSDK version in your gradle file up to 19? This is one of our requirements (see here). And the error is just saying, that your app has the minSDK set to 16
Hi Jonas,
Sorry for the confusion - that initial snippet was the prompt that described to me additional steps I needed to take to configure the project initially; I wanted to be explicitly clear as to why I bumped the minSdk version (which I now see is listed as a requirement at the top of the instructions) and added the tools:replace flag in androidmanifest.xml
The log with the actual error I'm facing is the second, longer log.
I also double checked JUST IN CASE I had once again forgotten something like that but if you take a look in the repo I linked the minSdk is set to 19:
https://github.com/llanginger/testAnylineRelease/blob/master/android/build.gradle
Hey,
sorry i must have read over it. Yes, seems actually like an issue. Did you try to update your compileVersion with the Libs? https://stackoverflow.com/a/50496385/2157717
Could you try put this to 29? https://github.com/llanginger/testAnylineRelease/blob/cd36e3a713fa553364eadf5a74dd8c09ae8579b8/android/build.gradle#L7
Hey Jonas,
No worries on the first bit!
Just tried running with compileSdkVersion set to 29 and still getting the error, unfortunately. Here's the log with the --info flag:
Caching disabled for task ':anyline-ocr-react-native-module:verifyReleaseResources' because:
Build cache is disabled
Task ':anyline-ocr-react-native-module:verifyReleaseResources' is not up-to-date because:
Task has failed previously.
All input files are considered out-of-date for incremental task ':anyline-ocr-react-native-module:verifyReleaseResources'.
Unable do incremental execution: full task run
AAPT2 aapt2-3.4.1-5326820-osx Daemon #0: starting
AAPT2 aapt2-3.4.1-5326820-osx Daemon #1: starting
AAPT2 aapt2-3.4.1-5326820-osx Daemon #2: starting
AAPT2 aapt2-3.4.1-5326820-osx Daemon #3: starting
AAPT2 aapt2-3.4.1-5326820-osx Daemon #4: starting
AAPT2 aapt2-3.4.1-5326820-osx Daemon #5: starting
AAPT2 aapt2-3.4.1-5326820-osx Daemon #6: starting
:anyline-ocr-react-native-module:verifyReleaseResources (Thread[Execution worker for ':' Thread 6,5,main]) completed. Took 0.632 secs.
AAPT2 aapt2-3.4.1-5326820-osx Daemon #0: shutdown
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':anyline-ocr-react-native-module:verifyReleaseResources'.
> 1 exception was raised by workers:
com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
/Users/leolanginger/Desktop/Projects/motionFolder/aws/appProjectFolder/testAnyline/node_modules/anyline-ocr-react-native-module/android/build/intermediates/res/merged/release/values-v28/values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
/Users/leolanginger/Desktop/Projects/motionFolder/aws/appProjectFolder/testAnyline/node_modules/anyline-ocr-react-native-module/android/build/intermediates/res/merged/release/values-v28/values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
/Users/leolanginger/Desktop/Projects/motionFolder/aws/appProjectFolder/testAnyline/node_modules/anyline-ocr-react-native-module/android/build/intermediates/res/merged/release/values/values.xml:4142: error: resource android:attr/fontVariationSettings not found.
/Users/leolanginger/Desktop/Projects/motionFolder/aws/appProjectFolder/testAnyline/node_modules/anyline-ocr-react-native-module/android/build/intermediates/res/merged/release/values/values.xml:4143: error: resource android:attr/ttcIndex not found.
error: failed linking references.
does this maybe help? https://stackoverflow.com/a/54945040/2157717
Hi Jonas,
That does not appear to have helped. I tried modifying the test app (the one linked in this thread)'s android/build.gradle
to:
ext {
buildToolsVersion = "27.0.3"
minSdkVersion = 19
compileSdkVersion = 26
targetSdkVersion = 27
supportLibVersion = "26.1.0"
}
...
To match the settings in anyline-ocr-react-native-module/android/build.gradle
and the same error still remains:
> Configure project :anyline-ocr-react-native-module
WARNING: The specified Android SDK Build Tools version (27.0.3) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.4.1.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '27.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
> Task :anyline-ocr-react-native-module:compileReleaseJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
> Task :anyline-ocr-react-native-module:verifyReleaseResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':anyline-ocr-react-native-module:verifyReleaseResources'.
> 1 exception was raised by workers:
com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
/Users/leolanginger/Desktop/Projects/motionFolder/aws/appProjectFolder/testAnyline/node_modules/anyline-ocr-react-native-module/android/build/intermediates/res/merged/release/values-v28/values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
/Users/leolanginger/Desktop/Projects/motionFolder/aws/appProjectFolder/testAnyline/node_modules/anyline-ocr-react-native-module/android/build/intermediates/res/merged/release/values-v28/values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
/Users/leolanginger/Desktop/Projects/motionFolder/aws/appProjectFolder/testAnyline/node_modules/anyline-ocr-react-native-module/android/build/intermediates/res/merged/release/values/values.xml:4142: error: resource android:attr/fontVariationSettings not found.
/Users/leolanginger/Desktop/Projects/motionFolder/aws/appProjectFolder/testAnyline/node_modules/anyline-ocr-react-native-module/android/build/intermediates/res/merged/release/values/values.xml:4143: error: resource android:attr/ttcIndex not found.
error: failed linking references.
Can you try to set the compileSdkVersion to 28 please?
Hi Jonas,
That did not work.
android/build.gradle:
buildscript {
ext {
buildToolsVersion = "27.0.3"
minSdkVersion = 19
compileSdkVersion = 28
targetSdkVersion = 27
supportLibVersion = "26.1.0"
}
...
Compiler output:
> Task :anyline-ocr-react-native-module:verifyReleaseResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':anyline-ocr-react-native-module:verifyReleaseResources'.
> 1 exception was raised by workers:
com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
/Users/leolanginger/Desktop/Projects/motionFolder/aws/appProjectFolder/testAnyline/node_modules/anyline-ocr-react-native-module/android/build/intermediates/res/merged/release/values-v28/values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
/Users/leolanginger/Desktop/Projects/motionFolder/aws/appProjectFolder/testAnyline/node_modules/anyline-ocr-react-native-module/android/build/intermediates/res/merged/release/values-v28/values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
/Users/leolanginger/Desktop/Projects/motionFolder/aws/appProjectFolder/testAnyline/node_modules/anyline-ocr-react-native-module/android/build/intermediates/res/merged/release/values/values.xml:4142: error: resource android:attr/fontVariationSettings not found.
/Users/leolanginger/Desktop/Projects/motionFolder/aws/appProjectFolder/testAnyline/node_modules/anyline-ocr-react-native-module/android/build/intermediates/res/merged/release/values/values.xml:4143: error: resource android:attr/ttcIndex not found.
error: failed linking references.
Hi,
Do you also get this error when you try to install our provided example app with the Anyline?
It might be related to the react-native version you use.
Could you try to change your "package.json" to the following react-native version?
"dependencies": {
"react-native": "^0.58.5"
},
Please let me know if it makes a difference for you.
I also just found this one: https://github.com/wix/react-native-navigation/issues/4671 or https://github.com/crazycodeboy/react-native-splash-screen/issues/393#issuecomment-519843778 - it may solve the issue too
We don't actively monitor the Github Issues, please raise a support request using the Anyline Helpdesk. Link to Anyline Helpdesk: https://anyline.atlassian.net/servicedesk/customer/portal/2/group/6
When raising a support request based on this Github Issue, please fill out and include the following information:
Support request concerning Anyline Github Repository: [URL to relevant Anyline Github Repository here] Support request based on Github Issue: [URL to relevant Github Issue here]
Thank you so much!
Anyline React-Native Plugin version:
12.1.0 React native version 0.60.4
I'm submitting a ... [x] bug report [ ] feature request [ ] general question
Occurring on ... [x] Android [ ] iOS
Current behavior:
running
./gradlew assembleRelease
fails with error:Execution failed for task ':anyline-ocr-react-native-module:verifyReleaseResources'.
(Stack trace provided below)Expected behavior:
running
./gradlew assembleRelease
would produce a functioning release APKSteps to reproduce:
(Repo with these exact steps provided)
Create blank react-native project with
react-native init
Run
yarn add anyline-ocr-react-native-module
and follow install instructions with the following alterations, as per android packager’s prompt (below): Increase min android sdk version to 19 and add tools to AndroidManifest.xmlRun
react-native run-android
to confirm app builds and runs on real device in DEBUG mode - this worksRun
cd android && ./gradlew assembleRelease
to confirm similar error message - this fails and outputs the same errorRelated code:
Repo demonstrating issue: https://github.com/llanginger/testAnylineRelease
Packager prompt to add tools and up minSdk version:
> Task :app:processDebugManifest FAILED ... /Users/leolanginger/Desktop/Projects/motionFolder/aws/appProjectFolder/testAnyline/android/app/src/debug/AndroidManifest.xml:11:7-34 Error: Attribute application@allowBackup value=(false) from AndroidManifest.xml:11:7-34 is also present at [:anyline-ocr-react-native-module] AndroidManifest.xml:15:18-44 value=(true). Suggestion: add 'tools:replace="android:allowBackup"' to <application> element at AndroidManifest.xml:7:5-117 to override. /Users/leolanginger/Desktop/Projects/motionFolder/aws/appProjectFolder/testAnyline/android/app/src/debug/AndroidManifest.xml Error: uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:anyline-ocr-react-native-module] /Users/leolanginger/Desktop/Projects/motionFolder/aws/appProjectFolder/testAnyline/node_modules/anyline-ocr-react-native-module/android/build/intermediates/library_manifest/debug/AndroidManifest.xml as the library might be using APIs not available in 16 Suggestion: use a compatible library with a minSdk of at most 16, or increase this project's minSdk version to at least 19
Stack trace from our main app: