Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 showing error on new pc .

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformNativeLibsWithStripDebugSymbolForDebug'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70) at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:63) at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54) at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58) at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88) at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52) at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54) at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328) at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:124) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:80) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:105) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:99) at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:625) at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:580) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:99) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63) at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55) at java.lang.Thread.run(Thread.java:745) Caused by: org.gradle.process.internal.ExecException: A problem occurred starting process 'command '/home/developer/Android/Sdk/ndk-bundle/toolchains/mips64el-linux-android-4.9/prebuilt/linux-x86_64/bin/mips64el-linux-android-strip'' at org.gradle.process.internal.DefaultExecHandle.execExceptionFor(DefaultExecHandle.java:220) at org.gradle.process.internal.DefaultExecHandle.setEndStateInfo(DefaultExecHandle.java:204) at org.gradle.process.internal.DefaultExecHandle.failed(DefaultExecHandle.java:340) at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:86) at org.gradle.internal.operations.BuildOperationIdentifierPreservingRunnable.run(BuildOperationIdentifierPreservingRunnable.java:39) ... 6 more Caused by: net.rubygrapefruit.platform.NativeException: Could not start '/home/developer/Android/Sdk/ndk-bundle/toolchains/mips64el-linux-android-4.9/prebuilt/linux-x86_64/bin/mips64el-linux-android-strip' at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:27) at net.rubygrapefruit.platform.internal.WrapperProcessLauncher.start(WrapperProcessLauncher.java:36) at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:68) ... 7 more Caused by: java.io.IOException: Cannot run program "/home/developer/Android/Sdk/ndk-bundle/toolchains/mips64el-linux-android-4.9/prebuilt/linux-x86_64/bin/mips64el-linux-android-strip" (in directory "/home/developer/Documents/working_app/valyangadi_firebase_project/app"): error=2, No such file or directory at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25) ... 9 more Caused by: java.io.IOException: error=2, No such file or directory at java.lang.UNIXProcess.forkAndExec(Native Method) at java.lang.UNIXProcess.(UNIXProcess.java:247) at java.lang.ProcessImpl.start(ProcessImpl.java:134) at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) ... 10 more

What is this errors and How to solve this problem? This project works fine on my old laptop Ubuntu 14.04 LTS that using android studio 3.0

like image 354
Midhilaj Avatar asked May 09 '18 12:05

Midhilaj


People also ask

How do you solve Createprocess error 2 the system Cannot find the file specified?

Delete the build file , sometimes it makes the error in case you are migrating the project from Linux to windows or vice versa . Then click invalidate cache and restart . Mine this solved this issue . Hope this will help you .

Where is the Android Studio directory?

Android Studio stores the projects by default in the home folder of the user under AndroidStudioProjects. The main directory contains configuration files for Android Studio and the Gradle build files. The application relevant files are contained in the app folder.

How do I fix Android Studio?

Open your gradle. properties file in Android Studio. Restart Android Studio for your changes to take effect. Click Sync Project with Gradle Files to sync your project.

Where is config or installation folder in Android Studio?

Note: An easy way to locate your configuration directory is to navigate to Help > Edit Custom VM Options in Android Studio. This will open a configuration file. Inspect the path of the configuration file to find your configuration directory.


2 Answers

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.

like image 69
josias Avatar answered Sep 24 '22 03:09

josias


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.

like image 23
Variag Avatar answered Sep 20 '22 03:09

Variag