본문 바로가기
[Developer]/Android

Google Android NDK 17.0 이상을 사용시 mips 에러 처리

by 해피빈이 2018. 5. 10.

Google Android NDK 17.0 이상을 사용시 발생할 수 있는 에러



최근 jni 파일이 포함된 프로젝트 빌드를 하다가 아래와 같은 에러를 발생하여 진행하지 못했다.

 

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 'D:\development\Android\sdk\ndk-bundle\toolchains\mips64el-linux-android-4.9\prebuilt\windows-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 'D:\development\Android\sdk\ndk-bundle\toolchains\mips64el-linux-android-4.9\prebuilt\windows-x86_64\bin\mips64el-linux-android-strip'

at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:27)

at net.rubygrapefruit.platform.internal.WindowsProcessLauncher.start(WindowsProcessLauncher.java:22)

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 "D:\development\Android\sdk\ndk-bundle\toolchains\mips64el-linux-android-4.9\prebuilt\windows-x86_64\bin\mips64el-linux-android-strip" (in directory "D:\temp\20180510\Sample\app"): CreateProcess error=2, 지정된 파일을 찾을 수 없습니다

at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)

at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)

... 10 more

Caused by: java.io.IOException: CreateProcess error=2, 지정된 파일을 찾을 수 없습니다

at java.lang.ProcessImpl.create(Native Method)

at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)

at java.lang.ProcessImpl.start(ProcessImpl.java:137)

at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)

... 11 more


위의 경로에 따른 힌트로 아래의 디렉토리에 보면 이러한 내용이 나온다.


\Android\sdk\ndk-bundle\toolchains\mipsel-linux-android-4.9\prebuilt\windows-x86_64\NOTICE-MIPS


This mipsel-linux-android-4.9 directory exists to make the NDK compatible with the Android

SDK's Gradle plugin, version 3.0.1 and earlier, which expects the NDK

to have a MIPS toolchain directory.


mips 뿐 아니라 mips64까지 모두 빌드가 불가능하도록 처리가 되어있다.




이것을 해결하기 위해 어떤 분은 ndk 16버전을 받아서 임시로 해당 컴파일러를 넣어서 해결하였다고 하지만, 나는 다른 방법으로 해결하였다.


위에서 언급하지 않은 나의 환경이 하나 더 있었는데, 바로 Android Project의 build.gradle 내용이다.




위와 같이 3.0.1 버전을 사용하고 있었기 때문에 문제가 되었던 상황이다.

(사실 이건은 위의 NOTICE-MIPS 문서에도 나와있다.)


3.0.1이나 그 하위버전을 사용한다면 ndk 디렉토리에서 MIPS, MIPS64 찾을것이고, 그럴 경우 문제가 된다는 것이다.


따라서, android gradle plugin 버전을 현재 최신버전인 3.1.2로 올렸다.



그리고 빌드했더니, 해당부분은 건너뛰어 성공!

반응형

댓글