How to fix android studios 2.3 NDK bug?

后端 未结 11 535
感情败类
感情败类 2020-12-05 16:51

I\'m assuming it\'s a bug since I didn\'t have any problems until the new update. So I cant use the gradle console to debug my app because I have this warning -

相关标签:
11条回答
  • 2020-12-05 17:30

    Fixed this issue by removing an empty ndk-bundle folder from SDK root folder (have no idea why and when it has appeared):

    Here is the explanation why it helps from the issue on Android bug tracker:

    For anyone still experience this issue on plugin 3.0.0-alpha1 or later. Please file a new bug and try to answer all question in #33. We need more information to debug the problem and adding comments to a closed bug is an easy way for it to get lost.

    To give a bit of background, the plugin checks whether the NDK directory is valid. Most likely, you are not using NDK. We automatically assume it's in {sdk}/ndk-bundle. It will be ignored if {sdk}/ndk-bundle does not exist. If you see 'NDK is missing a "platforms" directory.', it means there is an {sdk}/ndk-bundle, but not a {sdk}/ndk-bundle/platforms directory. This means you have a corrupted NDK for some reason. It is safe to just remove {sdk}/ndk-bundle if you are not using it.

    0 讨论(0)
  • 2020-12-05 17:31

    Updating the NDK in the Android Studio SDK tools solved my issue.

    0 讨论(0)
  • 2020-12-05 17:33

    You can give it a try :

    There is a checkbox for it in android studio already.

    Android Studio -> Preferences -> Compiler -> Gradle -> Command-line Options -> Configure on Demand

    Uncheck it and then sync gradle again

    0 讨论(0)
  • 2020-12-05 17:33

    You should not use a directory path with spaces for Android SDK. As an easy cure you can manually change

    sdk.dir=C:/Users/EMILYT~1/AppData/Local/Android/Sdk
    

    You don't need to install NDK.

    0 讨论(0)
  • 2020-12-05 17:38

    For me, the NDK error turned out to be a false diagnosis. This error occurred when gradle threw a ClassNotFound exception on java.io.UncheckedIOException class.

    Although the class is defined in Java 8, it was not included in the JDK 1.8.0u51 (or presumably earlier versions) which I had installed.

    Updating the JDK and removing the 1.8.0u51 version resolved the issue.

    0 讨论(0)
  • 2020-12-05 17:39

    Just install the Android NDK.

    That fixed my error and warning!

    https://i.stack.imgur.com/Lsu8E.png

    1. Go to Tools -> Android -> SDK Manager
    2. Click SDK Tools
    3. CHECK NDK
    4. Apply and quit.
    0 讨论(0)
提交回复
热议问题