热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

无法确定AndroidSDK

Cordova创建一个包并导入到androidstudio以下错误:1:Taskfailedwithanexception.-

Cordova 创建一个包并导入到android studio

以下错误:

1: Task failed with an exception.
-----------
* Where:
Script '/Users/admin/Projects/android_App/Android_1/platforms/android/CordovaLib/cordova.gradle' line: 112
* What went wrong:
A problem occurred evaluating project ': app'.
> Unable to determine Android SDK directory.
* Try:
Run with --stack trace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ': app'.
> compileSdkVersion is not specified. Please add it to build.gradle`

没有插件。我已经用最新的版本更新了所有 Cordova、npm、android studio。但是仍然无法解决这个问题。

SDK 工具卸载并重新安装。

回答

最后,我找到了解决方案。它是一个 Corova 包问题。默认情况下,在添加cordova 平台android 时,将在android 下创建local.properties 文件。现在该文件没有添加。

创建新文件--> 项目--> 平台--> android--> local.properties

并保留此 --> sdk.dir=/path/sdk 示例 [ sdk.dir=/Users/admin/Library/Android/sdk ]

然后它开始工作。

谢谢。



  • Can't vote this up enough! I've been going around in circles on this issue.





推荐阅读
author-avatar
手机用户2502918695
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有