【问题标题】:Failed to find target with hash string 'android-25' in: /home/hisham/Android/Sdk无法在 /home/hisham/Android/Sdk 中找到带有哈希字符串“android-25”的目标
【发布时间】:2018-04-07 00:10:51
【问题描述】:

已经尝试调试这个问题好几个小时了!在线尝试了许多解决方案,似乎没有一个有效。

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

我该如何解决这个问题?

【问题讨论】:

    标签: android cordova gradle ionic-framework sdk


    【解决方案1】:

    终于搞定了!不确定以下哪一项修复了它。

    1. 将 ~/.bashrc 中的 $ANDROID_HOME 从 ANDROID_HOME=$HOME/Android/Sdk 更改为 ANDROID_HOME=$HOME/Android/Sdk/platform-tools
    2. 在 SDK 中的 platform-tools 文件夹中删除了版本 25 的文件夹并重新安装了版本 25。 完成上述两个操作后,重新启动系统,我现在可以将 ionic 应用程序编译并构建为 .apk 文件。

    PS : 这可能只是在我的个人电脑中,由于不同的问题,您可能会遇到相同的问题。希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 2017-03-20
      • 1970-01-01
      • 2018-04-04
      • 1970-01-01
      • 2017-05-02
      • 2020-01-16
      • 1970-01-01
      • 2023-04-03
      • 1970-01-01
      相关资源
      最近更新 更多