Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

项目环境遇到障碍,请求支持 #3

Open
zhairzz opened this issue Sep 28, 2019 · 2 comments
Open

项目环境遇到障碍,请求支持 #3

zhairzz opened this issue Sep 28, 2019 · 2 comments

Comments

@zhairzz
Copy link

zhairzz commented Sep 28, 2019

项目环境配置,如下:
1、NDK问题已经解决 - JNI编译采用 ndk r14b
2、gradle 插件版本 gradle-4.4
3、as 版本 Android Studio 3.1.4
4、cmake 版本 3.10.2
local.properties 设置 cmake.dir=/Users/zhairz/tools/android-sdk/cmake/3.10.2.4988404

报错信息如下:
`

Configure project :app
Support for CMake 3.7 and higher is a preview feature. To report a bug, see https://developer.android.com/studio/report-bugs.html
Support for CMake 3.7 and higher is a preview feature. To report a bug, see https://developer.android.com/studio/report-bugs.html

Task :app:generateJsonModelDebug FAILED
External native generate JSON debug: starting JSON generation
External native generate JSON debug: using platform version 19 for ABI ARMEABI_V7A and min SDK version 19
External native generate JSON debug: rebuilding JSON /Users/zhairz/lpr/HyperLPR/Prj-Android/app/.externalNativeBuild/cmake/debug/armeabi-v7a/android_gradle_build.json due to:
External native generate JSON debug: - expected json /Users/zhairz/lpr/HyperLPR/Prj-Android/app/.externalNativeBuild/cmake/debug/armeabi-v7a/android_gradle_build.json file is not present, will remove stale json folder
External native generate JSON debug: - missing previous command file /Users/zhairz/lpr/HyperLPR/Prj-Android/app/.externalNativeBuild/cmake/debug/armeabi-v7a/cmake_build_command.txt, will remove stale json folder
External native generate JSON debug: removing stale contents from '/Users/zhairz/lpr/HyperLPR/Prj-Android/app/.externalNativeBuild/cmake/debug/armeabi-v7a'
External native generate JSON debug: created folder '/Users/zhairz/lpr/HyperLPR/Prj-Android/app/.externalNativeBuild/cmake/debug/armeabi-v7a'
External native generate JSON debug: executing cmake Executable : /Users/zhairz/tools/android-sdk/cmake/3.10.2.4988404/bin/cmake
arguments :
-H/Users/zhairz/lpr/HyperLPR/Prj-Android/app/src/main/cpp
-B/Users/zhairz/lpr/HyperLPR/Prj-Android/app/.externalNativeBuild/cmake/debug/armeabi-v7a
-DANDROID_ABI=armeabi-v7a
-DANDROID_PLATFORM=android-19
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/Users/zhairz/lpr/HyperLPR/Prj-Android/app/build/intermediates/cmake/debug/obj/armeabi-v7a
-DCMAKE_BUILD_TYPE=Debug
-DANDROID_NDK=/Users/zhairz/tools/android-sdk/ndk-bundle
-DCMAKE_CXX_FLAGS=-std=c++11
-DCMAKE_SYSTEM_NAME=Android
-DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a
-DCMAKE_SYSTEM_VERSION=19
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
-DCMAKE_ANDROID_NDK=/Users/zhairz/tools/android-sdk/ndk-bundle
-DCMAKE_TOOLCHAIN_FILE=/Users/zhairz/lpr/HyperLPR/Prj-Android/app/.externalNativeBuild/cmake/debug/armeabi-v7a/pre-ndk-r15-wrapper-android.toolchain.cmake
-G Ninja
-DANDROID_STL=gnustl_static
jvmArgs :

[== "CMake Server" ==[

{"supportedProtocolVersions":[{"isExperimental":true,"major":1,"minor":1}],"type":"hello"}

]== "CMake Server" ==]

[== "CMake Server" ==[

{
"type": "handshake",
"cookie": "gradle-cmake-cookie",
"protocolVersion": {
"isExperimental": true,
"major": 1,
"minor": 1
},
"sourceDirectory": "/Users/zhairz/lpr/HyperLPR/Prj-Android/app/src/main/cpp",
"buildDirectory": "/Users/zhairz/lpr/HyperLPR/Prj-Android/app/.externalNativeBuild/cmake/debug/armeabi-v7a",
"generator": "Ninja"
}

]== "CMake Server" ==]

[== "CMake Server" ==[

{"cookie":"gradle-cmake-cookie","inReplyTo":"handshake","type":"reply"}

]== "CMake Server" ==]

[== "CMake Server" ==[

{
"type": "configure",
"cacheArguments": [
"",
"-DANDROID_ABI\u003darmeabi-v7a",
"-DANDROID_PLATFORM\u003dandroid-19",
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY\u003d/Users/zhairz/lpr/HyperLPR/Prj-Android/app/build/intermediates/cmake/debug/obj/armeabi-v7a",
"-DCMAKE_BUILD_TYPE\u003dDebug",
"-DANDROID_NDK\u003d/Users/zhairz/tools/android-sdk/ndk-bundle",
"-DCMAKE_CXX_FLAGS\u003d-std\u003dc++11",
"-DCMAKE_SYSTEM_NAME\u003dAndroid",
"-DCMAKE_ANDROID_ARCH_ABI\u003darmeabi-v7a",
"-DCMAKE_SYSTEM_VERSION\u003d19",
"-DCMAKE_EXPORT_COMPILE_COMMANDS\u003dON",
"-DCMAKE_ANDROID_NDK\u003d/Users/zhairz/tools/android-sdk/ndk-bundle",
"-DCMAKE_TOOLCHAIN_FILE\u003d/Users/zhairz/lpr/HyperLPR/Prj-Android/app/.externalNativeBuild/cmake/debug/armeabi-v7a/pre-ndk-r15-wrapper-android.toolchain.cmake",
"-G Ninja",
"-DANDROID_STL\u003dgnustl_static"
]
}

]== "CMake Server" ==]

[== "CMake Server" ==[

{"cookie":"","inReplyTo":"configure","message":"CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.","title":"Error","type":"message"}

]== "CMake Server" ==]

CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.

[== "CMake Server" ==[

{"cookie":"","inReplyTo":"configure","progressCurrent":1000,"progressMaximum":1000,"progressMessage":"Configuring","progressMinimum":0,"type":"progress"}

]== "CMake Server" ==]

[== "CMake Server" ==[

{"cookie":"","inReplyTo":"configure","message":"Configuring incomplete, errors occurred!\nSee also "/Users/zhairz/lpr/HyperLPR/Prj-Android/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeOutput.log".","type":"message"}

]== "CMake Server" ==]

Configuring incomplete, errors occurred!
See also "/Users/zhairz/lpr/HyperLPR/Prj-Android/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeOutput.log".
Configuring incomplete, errors occurred!
See also "/Users/zhairz/lpr/HyperLPR/Prj-Android/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeOutput.log".

[== "CMake Server" ==[

{"cookie":"","errorMessage":"Configuration failed.","inReplyTo":"configure","type":"error"}

]== "CMake Server" ==]

Configuration failed.
External native generate JSON debug: JSON generation completed with problems

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:generateJsonModelDebug'.

com.android.ide.common.process.ProcessException: Error configuring

  • Try:
    Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Exception is:
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:generateJsonModelDebug'.
    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.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
    at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
    at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)
    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:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
    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:123)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:626)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:581)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
    Caused by: org.gradle.internal.UncheckedException: com.android.ide.common.process.ProcessException: Error configuring
    at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:63)
    at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:40)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:76)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:46)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:780)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:747)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:121)
    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:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:110)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
    ... 29 more
    Caused by: com.android.ide.common.process.ProcessException: Error configuring
    at com.android.build.gradle.tasks.CmakeServerExternalNativeJsonGenerator.executeProcessAndGetOutput(CmakeServerExternalNativeJsonGenerator.java:198)
    at com.android.build.gradle.tasks.CmakeExternalNativeJsonGenerator.executeProcess(CmakeExternalNativeJsonGenerator.java:126)
    at com.android.build.gradle.tasks.ExternalNativeJsonGenerator.buildAndPropagateException(ExternalNativeJsonGenerator.java:323)
    at com.android.build.gradle.tasks.ExternalNativeJsonGenerator.build(ExternalNativeJsonGenerator.java:188)
    at com.android.build.gradle.tasks.ExternalNativeBuildJsonTask.build(ExternalNativeBuildJsonTask.java:35)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
    ... 41 more

  • Get more help at https://help.gradle.org

BUILD FAILED in 1s
29 actionable tasks: 1 executed, 28 up-to-date
`

希望给出环境配置信息,帮解决一下问题,不胜感激!如果方便希望能加一下微信号【15810806610】

@lxhAndSmh
Copy link
Owner

@zhairzz 可能是 cmake 版本的问题,我这边用的 cmake 3.6 的版本,可以正常编译

  • 移除你 local.properties 中的这个设置 cmake.dir=/Users/zhairz/tools/android-sdk/cmake/3.10.2.4988404
  • 删除你的 cmake 目录下的3.10.2版本,下载cmake 3.6版本,放到你的 cmake 目录下试一下

@zhairzz
Copy link
Author

zhairzz commented Sep 29, 2019

很感谢收到的回复 我尝试一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants