11

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

usr1234567
  • 21,601
  • 16
  • 108
  • 128
Midhilaj
  • 4,905
  • 9
  • 45
  • 88
  • 1
    Apparently `/home/developer/Android/Sdk/ndk-bundle/toolchains/mips64el-linux-android-4.9/prebuilt/linux-x86_64/bin/mips64el-linux-android-strip` does not exist on your new computer. Do you really need to build for mips64? – Michael May 09 '18 at 13:12
  • I have exactly the same problem but with `..\prebuilt\windows-x86_64\bin\mips64el-linux-android-strip`. I think it's related to Android Studio update I've installed yesterday, but everything was working fine. Today when I try to compile, this error pops out. – Variag May 09 '18 at 15:34
  • Where can i download old version android studio ? – Midhilaj May 10 '18 at 05:35
  • Umm, google it? Unfortunately I thought of that and downgraded AS to version 3.0.1, but nothing has changed. I still get the same error, so bug must be somewhere else. – Variag May 10 '18 at 07:17

5 Answers5

20

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.

Variag
  • 1,056
  • 10
  • 25
  • How would I go about refreshing and rebuilding if I was building the app using the ionic framework built on cordova, since it uses the Android SDK and NDK? – nosh Jun 19 '18 at 14:05
  • I'm not familiar with Cordova, but according to [this answer](https://stackoverflow.com/a/40475804/5273427) you could check if you have `ndk-bundle` directory inside `Android SDK directory`. If so, remove it, download another package (older if you need) extract it somewhere and rename to **ndk-bundle**. Then paste it to where you deleted previous ndk directory and rebuild. – Variag Jun 19 '18 at 16:08
  • Yeah so I did that and the exception is no longer being thrown but now I am getting the wierdest exception thrown of all time in which it the exception that fails the build is "Already Finished" Here is my error log: "BUILD FAILED in 3s (node:31772) UnhandledPromiseRejectionWarning: Error: cmd: Command failed with exit code 1 Error output: FAILURE: Build failed with an exception. * What went wrong: Already finished" Does not make much sense to me. – nosh Jun 19 '18 at 16:09
  • I'd try restarting PC and building project again. If it won't help, start new question, comments are not meant for problems solving. – Variag Jun 19 '18 at 16:16
  • Can't really start a question when I don't have the ability to do so. Trying to earn enough reputation back to get that privilege back. It has been a long time since I have had the ability to ask questions. Thanks for the help! – nosh Jun 19 '18 at 16:17
  • Restarting my computer and rebuilding the project worked, thanks! – nosh Jun 19 '18 at 16:37
6

include this code in your build.gradle

defaultConfig {

    packagingOptions{
        doNotStrip '*/mips/*.so'
        doNotStrip '*/mips64/*.so'
    }
}
Tony Barajas
  • 124
  • 2
  • 12
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.

josias
  • 586
  • 4
  • 9
0

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.
double-beep
  • 5,031
  • 17
  • 33
  • 41
0

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

Hope it works for you.

Archit garg
  • 61
  • 1
  • 5