【问题标题】:Unable to run application in Android Studio [duplicate]无法在 Android Studio 中运行应用程序 [重复]
【发布时间】:2015-08-04 08:36:43
【问题描述】:

我刚刚从 Eclipse 切换到 Android Studio,但现在我遇到了问题,当我运行我的应用程序时我无法运行它,我收到了错误:

C:\Users\ga\AppData\Local\Android\sdk1\tools\emulator.exe -avd Nexus_5_API_21_x86 -netspeed full -netdelay none
emulator: ERROR: This AVD's configuration is missing a kernel file!!
emulator: ERROR: ANDROID_SDK_ROOT is undefined

为什么我会收到此错误,我们如何解决此问题。以便我可以运行我的应用程序。

我已经完成了所有这些更改,但我面临同样的问题,而且我看不到 xml 的设计部​​分

所以这些是我面临的问题,请帮我解决这个问题 我的 XML 文件是:

<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin"
    tools:context=".HomePage">

    <TextView
        android:text="@string/hello_world"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

</RelativeLayout>

查看ARM EABI v7a System Image 我已经安装了

【问题讨论】:

  • 我已经这样做了,但我得到了同样的错误
  • 我遇到了同样的问题,但我没有任何解决方案,所以我再次转向 eclipse
  • 渲染问题不同,AVD配置错误不同。当您在 UI xml 中使用预编译库时会出现渲染问题,这确实很烦人但不是错误。如果您的 AVD 遇到问题,您可以使用 GenyMotion,它免费供个人使用,与内置 AVD 相比速度非常快。
  • 您的 xml 很好,但您需要更改主题或 API 级别,如下面的@AmritPalSingh 建议的那样。
  • @Gaurav 请查看此答案并检查它是否解决了您的问题stackoverflow.com/a/10101698/1979347。另外,我建议您使用更好且速度更快的 GenyMotion。

标签: android android-studio


【解决方案1】:

对于 design xml 部分,将您的 API 级别从 22 切换到 API 21(将其从 xml 顶部的小 android 图标更改文件),

转到 res/value/styles.xml 并从

更改您的 AppTheme

Theme.AppCompat.Light.DarkActionBar

Base.Theme.AppCompat.Light.DarkActionBar

See Reference Link here for design rendering exception.

对于您最初的模拟器错误

C:\Users\ga\AppData\Local\Android\sdk1\tools\emulator.exe -avd Nexus_5_API_21_x86 -netspeed full -netdelay none emulator: ERROR: This AVD's configuration is missing a kernel file!! emulator: ERROR: ANDROID_SDK_ROOT is undefined

参考这个链接 -

1 - Reference link1

2 - Reference link2

【讨论】:

  • 这就是问题,谢谢
  • 如果此答案解决了您的问题,请标记为正确。
  • 很高兴能帮到你:)
  • @AmritPalSingh 我在发布之前已经检查了两个链接,但这对我没有帮助,现在我正在尝试使用 genymotion.com
  • @Gaurav - 我没有遇到这些问题,如果我得到任何解决方案,我会更新我的答案。
猜你喜欢
  • 1970-01-01
  • 2016-02-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-03-25
  • 1970-01-01
相关资源
最近更新 更多