Anyline / anyline-ocr-react-native-module

Anyline React Native Module for iOS and Android
https://anyline.com/
Other
107 stars 34 forks source link

Android release build fails for task ":anyline-ocr-react-native-module:verifyReleaseResources' #72

Closed llanginger closed 2 years ago

llanginger commented 5 years ago

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 APK

Steps to reproduce:

(Repo with these exact steps provided)

  1. Create blank react-native project with react-native init

  2. 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.xml

  3. Run react-native run-android to confirm app builds and runs on real device in DEBUG mode - this works

  4. Run cd android && ./gradlew assembleRelease to confirm similar error message - this fails and outputs the same error

Related 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:



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/motion_customer_mobile_app_rn_v2/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/motion_customer_mobile_app_rn_v2/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/motion_customer_mobile_app_rn_v2/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/motion_customer_mobile_app_rn_v2/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.

* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':anyline-ocr-react-native-module:verifyReleaseResources'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.accept(ExecuteActionsTaskExecuter.java:151)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.accept(ExecuteActionsTaskExecuter.java:148)
        at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:191)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:141)
        at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionStateTaskExecuter.execute(ResolveBeforeExecutionStateTaskExecuter.java:75)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:62)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:108)
        at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionOutputsTaskExecuter.execute(ResolveBeforeExecutionOutputsTaskExecuter.java:67)
        at org.gradle.api.internal.tasks.execution.ResolveAfterPreviousExecutionStateTaskExecuter.execute(ResolveAfterPreviousExecutionStateTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:94)
        at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:95)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:73)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:49)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:49)
        at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:43)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:355)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:343)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:336)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:322)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:134)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:129)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:202)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:193)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:129)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: com.android.ide.common.workers.WorkerExecutorException: 1 exception was raised by workers:
com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
/Users/leolanginger/Desktop/Projects/motionFolder/aws/appProjectFolder/motion_customer_mobile_app_rn_v2/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/motion_customer_mobile_app_rn_v2/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/motion_customer_mobile_app_rn_v2/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/motion_customer_mobile_app_rn_v2/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.

        at com.android.ide.common.workers.ExecutorServiceAdapter.await(ExecutorServiceAdapter.kt:62)
        at com.android.ide.common.workers.ExecutorServiceAdapter.close(ExecutorServiceAdapter.kt:69)
        at kotlin.io.CloseableKt.closeFinally(Closeable.kt:53)
        at com.android.build.gradle.tasks.VerifyLibraryResourcesTask.compileAndVerifyResources(VerifyLibraryResourcesTask.kt:133)
        at com.android.build.gradle.tasks.VerifyLibraryResourcesTask.doFullTaskAction(VerifyLibraryResourcesTask.kt:113)
        at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:106)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:103)
        at org.gradle.api.internal.project.taskfactory.IncrementalTaskInputsTaskAction.doExecute(IncrementalTaskInputsTaskAction.java:46)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:41)
        at org.gradle.api.internal.project.taskfactory.AbstractIncrementalTaskAction.execute(AbstractIncrementalTaskAction.java:25)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$5.run(ExecuteActionsTaskExecuter.java:404)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:393)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:376)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$200(ExecuteActionsTaskExecuter.java:80)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:213)
        at org.gradle.internal.execution.steps.ExecuteStep.lambda$execute$0(ExecuteStep.java:32)
        at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:32)
        at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:26)
        at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:58)
        at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:35)
        at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:48)
        at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:33)
        at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:39)
        at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:73)
        at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:54)
        at org.gradle.internal.execution.steps.CatchExceptionStep.execute(CatchExceptionStep.java:35)
        at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:51)
        at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:45)
        at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:31)
        at org.gradle.internal.execution.steps.CacheStep.executeWithoutCache(CacheStep.java:201)
        at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:70)
        at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:45)
        at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:49)
        at org.gradle.internal.execution.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:43)
        at org.gradle.internal.execution.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:32)
        at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:38)
        at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:24)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:96)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:89)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:54)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:38)
        at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:77)
        at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:37)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:36)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:26)
        at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:90)
        at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:48)
        at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:33)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:120)
        ... 35 more
Caused by: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
/Users/leolanginger/Desktop/Projects/motionFolder/aws/appProjectFolder/motion_customer_mobile_app_rn_v2/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/motion_customer_mobile_app_rn_v2/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/motion_customer_mobile_app_rn_v2/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/motion_customer_mobile_app_rn_v2/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.

        at com.android.ide.common.workers.ExecutorServiceAdapter.await(ExecutorServiceAdapter.kt:56)
        ... 91 more
Caused by: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
/Users/leolanginger/Desktop/Projects/motionFolder/aws/appProjectFolder/motion_customer_mobile_app_rn_v2/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/motion_customer_mobile_app_rn_v2/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/motion_customer_mobile_app_rn_v2/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/motion_customer_mobile_app_rn_v2/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.

        at com.android.builder.internal.aapt.v2.Aapt2Exception$Companion.create(Aapt2Exception.kt:45)
        at com.android.builder.internal.aapt.v2.Aapt2Exception$Companion.create$default(Aapt2Exception.kt:39)
        at com.android.builder.internal.aapt.v2.Aapt2DaemonImpl.doLink(Aapt2DaemonImpl.kt:191)
        at com.android.builder.internal.aapt.v2.Aapt2Daemon.link(Aapt2Daemon.kt:103)
        at com.android.builder.internal.aapt.v2.Aapt2DaemonManager$LeasedAaptDaemon.link(Aapt2DaemonManager.kt:176)
        at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:858)
        at com.android.build.gradle.internal.res.Aapt2ProcessResourcesRunnable$run$1.invoke(Aapt2ProcessResourcesRunnable.kt:34)
        at com.android.build.gradle.internal.res.Aapt2ProcessResourcesRunnable$run$1.invoke(Aapt2ProcessResourcesRunnable.kt:28)
        at com.android.build.gradle.internal.res.namespaced.Aapt2DaemonManagerService.useAaptDaemon(Aapt2DaemonManagerService.kt:71)
        at com.android.build.gradle.internal.res.namespaced.Aapt2DaemonManagerService.useAaptDaemon$default(Aapt2DaemonManagerService.kt:69)
        at com.android.build.gradle.internal.res.Aapt2ProcessResourcesRunnable.run(Aapt2ProcessResourcesRunnable.kt:33)
        at com.android.ide.common.workers.ExecutorServiceAdapter$submit$submission$1.run(ExecutorServiceAdapter.kt:40)```

**Other information:**
<!-- List any other information that is relevant to your issue. Stack traces, related issues, suggestions on how to fix, Stack Overflow links, forum links, etc. -->
llanginger commented 5 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!

JonasLaux commented 5 years ago

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

llanginger commented 5 years ago

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

JonasLaux commented 5 years ago

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

JonasLaux commented 5 years ago

Could you try put this to 29? https://github.com/llanginger/testAnylineRelease/blob/cd36e3a713fa553364eadf5a74dd8c09ae8579b8/android/build.gradle#L7

llanginger commented 5 years ago

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.
JonasLaux commented 5 years ago

does this maybe help? https://stackoverflow.com/a/54945040/2157717

llanginger commented 5 years ago

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.
JonasLaux commented 5 years ago

Can you try to set the compileSdkVersion to 28 please?

llanginger commented 5 years ago

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.
philippAnyline commented 5 years ago

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.

philippAnyline commented 5 years ago

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

berndkamplanyline commented 2 years ago

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!