negativetwelve / react-native-ux-cam

React Native wrapper for uxcam.com
53 stars 36 forks source link

Android resource linking failed #105

Closed jungRoit closed 3 years ago

jungRoit commented 5 years ago

I am having this error when creating an APK on android.

Execution failed for task ':react-native-ux-cam:verifyReleaseResources'.
> 1 exception was raised by workers:
  com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
  /home/lf/Documents/fieldapp/node_modules/react-native-ux-cam/android/build/intermediates/res/merged/release/values-v28/values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
  /home/lf/Documents/fieldapp/node_modules/react-native-ux-cam/android/build/intermediates/res/merged/release/values-v28/values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
  /home/lf/Documents/fieldapp/node_modules/react-native-ux-cam/android/build/intermediates/res/merged/release/values/values.xml:2714: error: resource android:attr/fontVariationSettings not found.
  /home/lf/Documents/fieldapp/node_modules/react-native-ux-cam/android/build/intermediates/res/merged/release/values/values.xml:2715: error: resource android:attr/ttcIndex not found.
  error: failed linking references.

I am able to fix this problem by changing the following code in android build.gradle

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.3"

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
    }

i changed "compileSdkVersion", "buildToolsVersion" and "targetSdkVersion" from 26 to 28. can I send a PR to make these changes? I always need to make these changes manually while building the APK.

susanuxcam commented 4 years ago

Hey @jungRoit, thanks for letting us know about the issue. I've already sent it to our developers and I will come back to you as soon as I hear back from them.

susanuxcam commented 4 years ago

hey again @jungRoit! I just wanted to let you know that this issue has been resolved with the latest release. Please, make sure to do a version update and verify if it helped. Thanks!

henrique-in commented 2 years ago

I have this problem when generating an apk

   buildToolsVersion = "31.0.0"
   minSdkVersion = 26
    compileSdkVersion = 31
    targetSdkVersion = 31
    kotlinVersion = '1.6.0'
    androidXCore = "1.6.0"

Task :react-native-ux-cam:verifyReleaseResources FAILED FAILURE: Build failed with an exception.What went wrong: Execution failed for task ':react-native-ux-cam:verifyReleaseResources'. A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action Android resource linking failed ERROR:/Users/henrique/.gradle/caches/transforms-3/3f599f9ca437831042d19dc7e14e670e/transformed/core-1.7.0/res/values/values.xml:105:5-114:25: AAPT: error: resource android:attr/lStar not found.

meznaric commented 2 years ago

@henrique-in 👇

If anyone finds themselves here in this issue, it turns out it's a widespread RN issue: https://github.com/facebook/react-native/issues/35210 . Upgrading RN fixed it for us.

Also note, this repository is deprecated so you should probably continue discussion in https://github.com/uxcam/react-native-ux-cam