Skip to content Skip to sidebar Skip to footer

After Using Android Studio 3.1.2 It Showing Error=2, No Such File Or Directory

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 work fine on old pc but it showin

Solution 1:

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

enter image description here

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.

Solution 2:

include this code in your build.gradle

defaultConfig {

    packagingOptions{
        doNotStrip '*/mips/*.so'
        doNotStrip '*/mips64/*.so'
    }
}

Solution 3:

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.

Solution 4:

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.

Solution 5:

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

Hope it works for you.

Post a Comment for "After Using Android Studio 3.1.2 It Showing Error=2, No Such File Or Directory"