After using android studio 3.1.2 it showing error=2, No such file or directory

前端 未结 5 1679
野的像风
野的像风 2020-12-31 18:50

After installing Ubuntu 18 in new desktop with i7 and 24gb ram . We try to move our android studio project to new pc in zip format and our project

相关标签:
5条回答
  • 2020-12-31 19:34

    You should check Android Studio configuration on you old PC and compare version of every position in Android SDK > SDK Tools:

    In my case the main problem was with Android NDK. Apparently I've installed update to version 17 and that was causing problems. So what I did:

    1. Remove everything from directory [android-sdk]\ndk-bundle\ or uninstall Android NDK in Android Studio\Sdk tools (see on the image above)
    2. Close Android Studio (AS).
    3. Download (in my case) NDK version 16b from https://developer.android.com/ndk/downloads/older_releases
    4. Extract archive (10 directories and 8 files or so) to [android-sdk]\ndk-bundle\
    5. Start AS and perform full refresh: Build > Refresh Linked C++ projects and Build > Rebuild project.

    Hope it helps.

    0 讨论(0)
  • 2020-12-31 19:35

    Invalidate Caches and Restart fixed it for me.
    go to File > Invalidate Caches/Restart...

    Hope it works for you.

    0 讨论(0)
  • 2020-12-31 19:40

    Mips is not supported anymore in Android NDK r17. I had the same problem and in my case it was caused by a dependency which contains a prebuilt mips native lib. I was able to fix the build error by excluding the mips files as follows in the main build.gradle:

    android {
        packagingOptions {
            exclude 'lib/mips64/NAME_OF_THE_LIB.so'
            exclude 'lib/mips/NAME_OF_THE_LIB.so'
        }
    }
    

    where NAME_OF_THE_LIB must be replaced by the actual name of the so file. You can find it by unzipping the apk of a previous successful build, if you have one.

    0 讨论(0)
  • 2020-12-31 19:43

    Follow the below simple steps to fix this:

    1. Close All opened file.
    2. Close Android Studio.
    3. After that, restart your mac, and rebuild your project from Android Studio.
    0 讨论(0)
  • 2020-12-31 19:53

    include this code in your build.gradle

    defaultConfig {
    
        packagingOptions{
            doNotStrip '*/mips/*.so'
            doNotStrip '*/mips64/*.so'
        }
    }
    
    0 讨论(0)
提交回复
热议问题