跑API6的远程真机 HarmonyOS 鸿蒙Next 报错求助

跑API6的远程真机 HarmonyOS 鸿蒙Next 报错求助 设定compileSdkVersion 6compatibleSdkVersion 6DevEco的SDK API 设为6,创建新的project工程,直到屏幕显示hello world。然后启动远程真机模式,选择API为6的远程真机并启动。

执行Run ‘entry’,然后就报错了,出错内容如下:

  • java.lang.IllegalArgumentException: Cannot convert string value ‘C:\Users\qc.ohos\config\auto_debug_MyApplication5_com.example.myapplication_80086000021988256.p12’ to an enum value of type ‘org.gradle.api.PathValidation’ (valid case insensitive values: NONE, EXISTS, FILE, DIRECTORY)
  • Caused by: org.gradle.api.GradleException: Verify that ‘compileSdkVersion’ is correctly set in build.gradle.

  • FAILURE: Build completed with 2 failures.
  • 1: Task failed with an exception.

    • Where:
  • Build file ‘C:\Users\qc\DevEcoStudioProjects\MyApplication5\build.gradle’ line: 8
    • What went wrong:
  • A problem occurred evaluating root project ‘MyApplication’.
  • Cannot convert string value ‘C:\Users\qc.ohos\config\auto_debug_MyApplication5_com.example.myapplication_80086000021988256.p12’ to an enum value of type ‘org.gradle.api.PathValidation’ (valid case insensitive values: NONE, EXISTS, FILE, DIRECTORY)

    • 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.

  • ==============================================================================
  • 2: Task failed with an exception.

    • What went wrong:
  • A problem occurred configuring root project ‘MyApplication’.
  • Verify that ‘compileSdkVersion’ is correctly set in build.gradle.

    • 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.

  • ==============================================================================

报错的第8行为:

storeFile file('C:\\Users\\qc\\.ohos\\config\\auto_debug_MyApplication5_com.example.myapplication_80086000021988256.p12', 'C:\\Users\\qc\\.ohos\\config\\auto_debug_MyApplication5_com.example.myapplication_80086000021988256.p12')

DevEco中同时存在API 6和API 9有没有问题?


更多关于跑API6的远程真机 HarmonyOS 鸿蒙Next 报错求助的实战教程也可以访问 https://www.itying.com/category-93-b0.html

2 回复

更多关于跑API6的远程真机 HarmonyOS 鸿蒙Next 报错求助的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html


在HarmonyOS鸿蒙Next上跑API6的远程真机时,报错可能与以下原因有关:

  1. API版本兼容性:确保使用的API6与鸿蒙Next版本兼容。鸿蒙Next可能对API6的支持不完全,或者存在已知的兼容性问题。

  2. 远程真机配置:检查远程真机的配置,确保其支持API6的运行环境。可能需要更新真机的系统或相关组件。

  3. 依赖库问题:确认项目中的依赖库是否与鸿蒙Next兼容。某些依赖库可能不支持API6或鸿蒙Next,导致报错。

  4. 日志分析:查看详细的错误日志,定位具体的错误信息。日志中通常会提供错误类型、发生位置及可能的解决方案。

  5. SDK版本:确保使用的SDK版本与鸿蒙Next匹配。不匹配的SDK版本可能导致API调用失败。

  6. 权限问题:检查应用是否拥有运行API6所需的所有权限。缺少必要的权限会导致API调用失败。

  7. 网络问题:远程真机运行时,网络连接稳定性可能影响API调用。确保网络连接正常,避免因网络问题导致的报错。

  8. 设备资源:检查远程真机的资源使用情况,如内存、CPU等。资源不足可能导致API调用失败。

回到顶部