无法使用哈希字符串找到目标' android-25'在:/ home / hisham / Android / Sdk

时间:2017-10-25 19:08:11

标签: android cordova gradle ionic-framework sdk

试图将这个问题调试好几个小时!在网上尝试了很多解决方案,但似乎都没有。

Build properties not found for package Android SDK Platform 25


File /root/.android/repositories.cfg could not be loaded.


FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> 
Failed to find target with hash string 'android-25' in: /home/hisham/Android/Sdk

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 39.749 secs
Error: /home/hisham/Desktop/Dev-PGDoc/ionic_app/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Failed to find target with hash string 'android-25' in: /home/hisham/Android/Sdk

This is the error image when running 'ionic cordova build android'

I have Sdk platform 25 installed

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:-1)

终于搞定了!不知道以下哪一个修复了它。

  1. 将〜/ .bashrc中的$ ANDROID_HOME从ANDROID_HOME = $ HOME / Android / Sdk更改为ANDROID_HOME = $ HOME / Android / Sdk / platform-tools
  2. 删除了Sdk中platform-tools文件夹中的25版本文件夹,并再次安装了版本25。 完成上述两项操作后,重新启动系统,我现在可以编译和构建离子应用程序到.apk文件。
  3. PS:这可能只是在我的个人计算机上,并且由于不同的问题,您可能会面临同样的问题。希望这会有所帮助。