Je construis un projet qui nécessite du code NDK, mais voici le problème qui me rend fou depuis quelques jours.
C'est juste un projet vide utilisant NDK qui a été créé en suivant le guide AS, et n'a rien changé. p>
Environnement:
Voici le conseil:
Support for CMake 3.7 and higher is a preview feature. To report a bug, see https://developer.android.com/studio/report-bugs.html The CompileOptions.bootClasspath property has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the CompileOptions.bootstrapClasspath property instead. Support for CMake 3.7 and higher is a preview feature. To report a bug, see https://developer.android.com/studio/report-bugs.html [== "CMake Server" ==[ {"supportedProtocolVersions":[{"isExperimental":true,"major":1,"minor":1}],"type":"hello"} ]== "CMake Server" ==] FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring project ':app'. > Error occurred while communicating with CMake server. Check log C:\Users\xxx\Desktop\MyApplication\app\.externalNativeBuild\cmake\debug\armeabi-v7a\cmake_server_log.txt for additional information. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org CONFIGURE FAILED in 7s Error occurred while communicating with CMake server. Check log C:\Users\xxx\Desktop\MyApplication\app\.externalNativeBuild\cmake\debug\armeabi-v7a\cmake_server_log.txt for additional information.
J'ai déjà vérifié tous les messages de ce site et de nombreux autres sites. J'ai essayé de réinstaller AS / SDK / NDK / gradle / tools ... Aucune de ces réponses ne fonctionne.
3 Réponses :
J'ai fait quelque chose de similaire à Oliver.Wong, et cela a fonctionné pour moi. J'ai désinstallé Cmake directement depuis AndroidStudio (ma version était 3.10.xx). Et puis j'ai installé Cmake 3.6xx à partir de la ligne de commande ("yourSdkPath" / android-sdk / tools / bin / sdkmanager / "cmake; 3.6.4111459")
Essayez ci-dessous
externalNativeBuild { cmake { ... version "3.10.2" ... } }
Ou supprimez simplement la nouvelle version de CMake 3.10.2 et revenez à la version 3.6.
Veuillez voir si celui-ci pourrait vous aider . Dans ce cas, veuillez essayer d'utiliser le plugin Studio / gradle version 3.3.1+.
Avez-vous installé CMake à partir du gestionnaire de SDK? Accédez au SDK Manager -> Android SDK -> SDK Tools -> CMake.
Bien sûr, il est téléchargé à partir du gestionnaire de SDK
Enfin, j'ai copié un dossier 3.6.xx de mon collègue, puis supprimé le dossier 3.10.xx. Dieu ... ça marche
Vérifiez stackoverflow.com/a/54623127/8034839 et stackoverflow.com/a/54473346/8034839