Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AAPT: No resource found that matches the given name: attr 'android:keyboardNavigationCluster' #882

Closed
andrey-skl opened this issue Jul 6, 2018 · 20 comments

Comments

@andrey-skl
Copy link

andrey-skl commented Jul 6, 2018

Description

I've upgraded to latest React Native 0.56.0 – It also brings updates of Android build tools versions. I use latest react-native-image-picker@0.26.10
When I run android build (react-native run-android) it fails with this messages:

:react-native-image-picker:preBuild UP-TO-DATE
:react-native-image-picker:preReleaseBuild UP-TO-DATE
:react-native-image-picker:checkReleaseManifest
:react-native-image-picker:preDebugAndroidTestBuild UP-TO-DATE
:react-native-image-picker:preDebugBuild UP-TO-DATE
:react-native-image-picker:preDebugUnitTestBuild UP-TO-DATE
:react-native-image-picker:preReleaseUnitTestBuild UP-TO-DATE
:react-native-image-picker:prepareAndroidArchLifecycleRuntime100Library
:react-native-image-picker:prepareComAndroidSupportAnimatedVectorDrawable2610Library
:react-native-image-picker:prepareComAndroidSupportAppcompatV72610Library
:react-native-image-picker:prepareComAndroidSupportSupportCompat2610Library
:react-native-image-picker:prepareComAndroidSupportSupportCoreUi2610Library
:react-native-image-picker:prepareComAndroidSupportSupportCoreUtils2610Library
:react-native-image-picker:prepareComAndroidSupportSupportFragment2610Library
:react-native-image-picker:prepareComAndroidSupportSupportMediaCompat2610Library
:react-native-image-picker:prepareComAndroidSupportSupportV42610Library
:react-native-image-picker:prepareComAndroidSupportSupportVectorDrawable2610Library
:react-native-image-picker:prepareComFacebookFbuiTextlayoutbuilderTextlayoutbuilder100Library
:react-native-image-picker:prepareComFacebookFrescoDrawee190Library
:react-native-image-picker:prepareComFacebookFrescoFbcore190Library
:react-native-image-picker:prepareComFacebookFrescoFresco190Library
:react-native-image-picker:prepareComFacebookFrescoImagepipeline190Library
:react-native-image-picker:prepareComFacebookFrescoImagepipelineBase190Library
:react-native-image-picker:prepareComFacebookFrescoImagepipelineOkhttp3190Library
:react-native-image-picker:prepareComFacebookReactReactNative0560Library
:react-native-image-picker:prepareComFacebookSoloaderSoloader030Library
:react-native-image-picker:prepareOrgWebkitAndroidJscR174650Library
:react-native-image-picker:prepareReleaseDependencies
:react-native-image-picker:compileReleaseAidl
:react-native-image-picker:compileReleaseNdk NO-SOURCE
:react-native-image-picker:compileLint
:react-native-image-picker:copyReleaseLint NO-SOURCE
:react-native-image-picker:compileReleaseRenderscript
:react-native-image-picker:generateReleaseBuildConfig
:react-native-image-picker:generateReleaseResValues
:react-native-image-picker:generateReleaseResources
:react-native-image-picker:mergeReleaseResources
:react-native-image-picker:processReleaseManifest
:react-native-image-picker:processReleaseResources
/Users/.../Documents/work/.../node_modules/react-native-image-picker/android/build/intermediates/res/merged/release/values-v26/values-v
26.xml:15:21-54: AAPT: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.

/Users/.../Documents/work/.../node_modules/react-native-image-picker/android/build/intermediates/res/merged/release/values-v26/values-v
26.xml:15: error: Error: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.


:react-native-image-picker:processReleaseResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-image-picker:processReleaseResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt

How to repeat issue and example

Just try to use react-native-image-picker with latest React Native 0.56.0

Solution

What needs to be done to address this issue? Ideally, provide a pull request with a fix.

Additional Information

  • React Native version: 0.56.0
  • Platform: Android
  • Development Operating System: macOS
  • Dev tools:
    buildToolsVersion = "26.0.3"
    minSdkVersion = 16
    compileSdkVersion = 26
    targetSdkVersion = 26
    supportLibVersion = "26.1.0"

Solution

Building react-native-image-picker on the same tools version as main project helps, so I suggest using general approach of supporting passing tools version from root project:

def _ext = rootProject.ext;

def _compileSdkVersion = _ext.has('compileSdkVersion') ? _ext.compileSdkVersion : 25;
def _buildToolsVersion = _ext.has('buildToolsVersion') ? _ext.buildToolsVersion : '25.0.2';
def _minSdkVersion = _ext.has('minSdkVersion') ? _ext.minSdkVersion : 16;
def _targetSdkVersion = _ext.has('targetSdkVersion') ? _ext.targetSdkVersion : 25;

android {
    compileSdkVersion _compileSdkVersion
    buildToolsVersion _buildToolsVersion

    defaultConfig {
        minSdkVersion _minSdkVersion
        targetSdkVersion _targetSdkVersion
        versionCode 1
        versionName computeVersionName()
    }
    lintOptions {
        abortOnError false
    }
}
@SumanthPuram
Copy link

SumanthPuram commented Jul 16, 2018

We can force Gradle to build all the dependencies with our main project SDK version and tools versions.
Add the following line to your project's android/build.gradle with your Android SDK dependency.


subprojects {
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion 27
                buildToolsVersion "27.0.2"
            }
        }
    }
}

@alexandrughinea
Copy link

@SumanthPuram you saved my react 0.56 migration process! 🥇

@RajaSaravanan
Copy link

@SumanthPuram You saved my day bro! Works perfectly!

@abartolo
Copy link

abartolo commented Aug 1, 2018

@huston007 Your solution worked! thanks, this should be the correct answer imo.

@SumanthPuram solution did not work for me as other libraries had issue with that change.

@mdelclaro
Copy link

@SumanthPuram worked to me as well! Thank you very much. I was facing this issue when using React Native Navigation v1 and React Native 0.56. Thanks!

@korgara
Copy link

korgara commented Aug 8, 2018

@SumanthPuram your solution helped me to generate apk, but this apk doesn't launch.
In android studio I got error like

    --------- beginning of crash
08-08 15:28:52.466 27305-27369/? E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
    Process: com.myappname, PID: 27305
    com.facebook.react.common.JavascriptException: TypeError: undefined is not an object (evaluating 't.default')
    
    This error is located at:
        in e
        in RCTView
        in RCTView
        in n, stack:
    e@439:497
    nr@237:43523
    Ur@237:56432
    Ar@237:56864
    si@237:61708
    li@237:61128
    ii@237:60256
    Mr@237:59236
    pi@237:66432
    mi@237:66744
    render@237:69043
    exports@415:431
    run@411:611
    runApplication@411:2013
    value@98:3340
    <unknown>@98:923
    value@98:2609
    value@98:895
    
        at com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError(ExceptionsManagerModule.java:54)
        at com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException(ExceptionsManagerModule.java:38)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:160)
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
        at android.os.Handler.handleCallback(Handler.java:808)
        at android.os.Handler.dispatchMessage(Handler.java:101)
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
        at android.os.Looper.loop(Looper.java:166)
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
        at java.lang.Thread.run(Thread.java:784)

@abartolo
Copy link

abartolo commented Aug 14, 2018

I created a #912 pull request that fixes this issue so anyone migrated to React Native v56 should be good. This approach worked for me as @SumanthPuram method broke other dependencies that I am using.

Add the following to your package.json if anyone wants to try it out.

{
    "react-native-image-picker": "git+https://github.com/abartolo/react-native-image-picker#UpgradeToRNv56",
}

@Asinox
Copy link

Asinox commented Aug 16, 2018

Oh God, thanks @SumanthPuram !

@andrey-skl
Copy link
Author

andrey-skl commented Aug 17, 2018

@abartolo Cool, but #912 PR does literally the same as my initial PR #883 = )

Anyway how could we get merged any of them?

@abartolo
Copy link

@huston007 lmao, sorry about that. I did not see your PR. I've been going around other libraries and doing the same and must have not checked. I'll close my PR now. Thanks for the update

@roziki-dev
Copy link

@SumanthPuram Thanks,

@ruk91
Copy link

ruk91 commented Sep 6, 2018

Thanks, @SumanthPuram. Your solution works fine.

@ahirag
Copy link

ahirag commented Sep 9, 2018

Thanks @SumanthPuram, helped me with v56 Migration :)

@kadirguloglu
Copy link

Thanks @SumanthPuram

@zouyu0008
Copy link

Thanks @SumanthPuram ,Get rid of the damn problem at last

@charpeni
Copy link
Contributor

Thanks, it has been fixed by 8187eaf.

A new release should be available soon.

@dalmeria
Copy link

dalmeria commented Nov 8, 2018

@SumanthPuram i love you

@chussum
Copy link

chussum commented Nov 19, 2018

@SumanthPuram You save me!!! THX!!

@lsantamaria
Copy link

Thanks, @SumanthPuram !. Your solution works with SDK 28 as well.

@zh-debug
Copy link

@SumanthPuram thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests