React-native-navigation: resource android:attr/dialogCornerRadius not found.

Created on 1 Feb 2019  路  11Comments  路  Source: wix/react-native-navigation

Issue Description

Get error like the following when run npm run android
[ENTER DESCRIPTION HERE]

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':react-native-navigation:processReactNative51DebugAndroidTestResources'.

    Android resource linking failed
    Output: PROJECT_ROOT/node_modules/react-native-navigation/lib/android/app/build/intermediates/incremental/mergeReactNative51DebugAndroidTestResources/merged.dir/values-v28/values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
    PROJECT_ROOT/node_modules/react-native-navigation/lib/android/app/build/intermediates/incremental/mergeReactNative51DebugAndroidTestResources/merged.dir/values-v28/values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
    PROJECT_ROOT/node_modules/react-native-navigation/lib/android/app/build/intermediates/incremental/mergeReactNative51DebugAndroidTestResources/merged.dir/values/values.xml:1047: error: resource android:attr/fontVariationSettings not found.
    PROJECT_ROOT/node_modules/react-native-navigation/lib/android/app/build/intermediates/incremental/mergeReactNative51DebugAndroidTestResources/merged.dir/values/values.xml:1048: error: resource android:attr/ttcIndex not found.
    error: failed linking references.

    Command: user/java/gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-osx.jar/01679366724b6cc8d75f761ec8d23958/aapt2-3.2.1-4818971-osx/aapt2 link -I
    user/Library/Android/sdk/platforms/android-26/android.jar
    --manifest
    PROJECT_ROOT/node_modules/react-native-navigation/lib/android/app/build/intermediates/merged_manifests/reactNative51DebugAndroidTest/processReactNative51DebugAndroidTestManifest/merged/AndroidManifest.xml
    -o
    PROJECT_ROOT/node_modules/react-native-navigation/lib/android/app/build/intermediates/processed_res/reactNative51DebugAndroidTest/processReactNative51DebugAndroidTestResources/out/resources-reactNative51DebugAndroidTest.ap_
    -R
    @PROJECT_ROOT/node_modules/react-native-navigation/lib/android/app/build/intermediates/incremental/processReactNative51DebugAndroidTestResources/resources-list-for-resources-reactNative51DebugAndroidTest.ap_.txt
    --auto-add-overlay
    --java
    PROJECT_ROOT/node_modules/react-native-navigation/lib/android/app/build/generated/not_namespaced_r_class_sources/reactNative51DebugAndroidTest/processReactNative51DebugAndroidTestResources/r
    -0
    apk
    --output-text-symbols
    PROJECT_ROOT/node_modules/react-native-navigation/lib/android/app/build/intermediates/symbols/androidTest/reactNative51/debug/R.txt
    --no-version-vectors
    Daemon: AAPT2 aapt2-3.2.1-4818971-osx Daemon #0
    Output: user/Documents/java/gradle/caches/transforms-1/files-1.1/appcompat-v7-28.0.0.aar/788639be9df739a4d85280dd2698b112/res/values-v28/values-v28.xml:9:5-12:13: AAPT: error: resource android:attr/dialogCornerRadius not found.

    PROJECT_ROOT/node_modules/react-native-navigation/lib/android/app/build/intermediates/incremental/mergeReactNative51DebugAndroidTestResources/merged.dir/values-v28/values-v28.xml:11: AAPT: error: resource android:attr/dialogCornerRadius not found.

    user/Documents/java/gradle/caches/transforms-1/files-1.1/design-26.1.0.aar/b2741e663f525b0147aac8cf2e40d225/res/values/values.xml:159:5-202: AAPT: error: resource android:attr/fontVariationSettings not found.

    user/Documents/java/gradle/caches/transforms-1/files-1.1/design-26.1.0.aar/b2741e663f525b0147aac8cf2e40d225/res/values/values.xml:159:5-202: AAPT: error: resource android:attr/ttcIndex not found.

    error: failed linking references.
    Command: userjava/gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-osx.jar/01679366724b6cc8d75f761ec8d23958/aapt2-3.2.1-4818971-osx/aapt2 link -I
    user/Library/Android/sdk/platforms/android-26/android.jar
    --manifest
    PROJECT_ROOT/node_modules/react-native-navigation/lib/android/app/build/intermediates/merged_manifests/reactNative51DebugAndroidTest/processReactNative51DebugAndroidTestManifest/merged/AndroidManifest.xml
    -o
    PROJECT_ROOT/node_modules/react-native-navigation/lib/android/app/build/intermediates/processed_res/reactNative51DebugAndroidTest/processReactNative51DebugAndroidTestResources/out/resources-reactNative51DebugAndroidTest.ap_
    -R
    @PROJECT_ROOT/node_modules/react-native-navigation/lib/android/app/build/intermediates/incremental/processReactNative51DebugAndroidTestResources/resources-list-for-resources-reactNative51DebugAndroidTest.ap_.txt
    --auto-add-overlay
    --java
    PROJECT_ROOT/node_modules/react-native-navigation/lib/android/app/build/generated/not_namespaced_r_class_sources/reactNative51DebugAndroidTest/processReactNative51DebugAndroidTestResources/r
    -0
    apk
    --output-text-symbols
    PROJECT_ROOT/node_modules/react-native-navigation/lib/android/app/build/intermediates/symbols/androidTest/reactNative51/debug/R.txt
    --no-version-vectors
    Daemon: AAPT2 aapt2-3.2.1-4818971-osx Daemon #0

Steps to Reproduce / Code Snippets / Screenshots

config : "android": "cd ./android && ./gradlew app:assembleDebug && ./gradlew installDebug"
https://wix.github.io/react-native-navigation/#/docs/Installing?id=android

npm run android


Environment

  • React Native Navigation version: 2.8
  • React Native version: 0.58
  • Platform(s) (iOS, Android, or both?): Android
馃彋 stale

Most helpful comment

Try this:

  • /android/build.gradle
subprojects {
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion compileSdkVersion
                buildToolsVersion "$buildToolsVersion"
            }
        }
    }
}

ext {
    buildToolsVersion = "28.0.3"
    minSdkVersion = 16
    compileSdkVersion = 28
    targetSdkVersion = 27
    supportLibVersion = "28.0.0"
}
  • /android/app/build.gradle
android {
    compileSdkVersion rootProject.ext.compileSdkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion

    defaultConfig {
        applicationId "com.modularapp"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 1
        versionName "1.0"
    }

Regards, Juan

All 11 comments

did you find any solution?

I had a similar problem with AAPT2 which is disabled by default, what I did to fix my problem was just update react-native-navigation's compileSdkVersion,targetSdkVersion,buildToolsVersion in its build.gradle to same version as mine and the problem was solved.

I hope it helps

I had a similar problem with AAPT2 which is disabled by default, what I did to fix my problem was just update react-native-navigation's compileSdkVersion,targetSdkVersion,buildToolsVersion in its gradle.properties to same version as mine and the problem was solved.

I hope it helps

I have the same problem too. Could you be a bit more specific on how to update react-native-vavigation gradle properties properly to the correct version ? Thanks for the help.

I had a similar problem with AAPT2 which is disabled by default, what I did to fix my problem was just update react-native-navigation's compileSdkVersion,targetSdkVersion,buildToolsVersion in its gradle.properties to same version as mine and the problem was solved.
I hope it helps

I have the same problem too. Could you be a bit more specific on how to update react-native-vavigation gradle properties properly to the correct version ? Thanks for the help.

Of course, I got into react-native-navigation's android folder (./node_modules/react-native-navigation/lib/android/app/build.gradle (or open it up in Android Studio) and changed lines 5 to 12 to:

android {
    compileSdkVersion 28
    buildToolsVersion '28.0.3'

    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
    }
   ...

In my project I've been using android sdk version 28. (If you don't know which version you are using just check your build.gradle inside your android/app folder.

But note, if you run npm i or yarnor even install a new library in your project you may have to do it again. Maybe you can optimize those steps running a .sh script or doing something else 馃槃

I'm using:

  • React-Native-Navigation - 2.12.0
  • React-Native - 0.58.5
  • React - 16.6.3

Try this:

  • /android/build.gradle
subprojects {
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion compileSdkVersion
                buildToolsVersion "$buildToolsVersion"
            }
        }
    }
}

ext {
    buildToolsVersion = "28.0.3"
    minSdkVersion = 16
    compileSdkVersion = 28
    targetSdkVersion = 27
    supportLibVersion = "28.0.0"
}
  • /android/app/build.gradle
android {
    compileSdkVersion rootProject.ext.compileSdkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion

    defaultConfig {
        applicationId "com.modularapp"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 1
        versionName "1.0"
    }

Regards, Juan

Setting compileSdkVersion to 28 solved it for me.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.

The issue has been closed for inactivity.

I had a similar problem with AAPT2 which is disabled by default, what I did to fix my problem was just update react-native-navigation's compileSdkVersion,targetSdkVersion,buildToolsVersion in its gradle.properties to same version as mine and the problem was solved.
I hope it helps

I have the same problem too. Could you be a bit more specific on how to update react-native-vavigation gradle properties properly to the correct version ? Thanks for the help.

Of course, I got into react-native-navigation's android folder (./node_modules/react-native-navigation/lib/android/app/build.gradle (or open it up in Android Studio) and changed lines 5 to 12 to:

android {
    compileSdkVersion 28
    buildToolsVersion '28.0.3'

    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
    }
   ...

In my project I've been using android sdk version 28. (If you don't know which version you are using just check your build.gradle inside your android/app folder.

But note, if you run npm i or yarnor even install a new library in your project you may have to do it again. Maybe you can optimize those steps running a .sh script or doing something else 馃槃

I'm using:

  • React-Native-Navigation - 2.12.0
  • React-Native - 0.58.5
  • React - 16.6.3

Solved my issue too. Thanks

Setting compileSdkVersion to 28 solved it for me.

Solved my issue too.

Try this:

  • /android/build.gradle
subprojects {
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion compileSdkVersion
                buildToolsVersion "$buildToolsVersion"
            }
        }
    }
}

ext {
    buildToolsVersion = "28.0.3"
    minSdkVersion = 16
    compileSdkVersion = 28
    targetSdkVersion = 27
    supportLibVersion = "28.0.0"
}
  • /android/app/build.gradle
android {
    compileSdkVersion rootProject.ext.compileSdkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion

    defaultConfig {
        applicationId "com.modularapp"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 1
        versionName "1.0"
    }

Regards, Juan

Thank you... thank you.... thaaaaaankkkkkk youuuuuuuuuuu :)

Was this page helpful?
0 / 5 - 0 ratings