【问题标题】:Android Emulator errors?Android模拟器错误?
【发布时间】:2017-06-01 04:21:29
【问题描述】:

我无法在 Android Studio 2.2 上启动我的 Android 应用程序。所以我去寻找Logcat,但事情就是这样,我不知道在哪里寻找或过滤哪个部分,因为东西太多了。我真的不认为是我的应用程序有问题,而是系统有问题。

我目前使用 API 19 作为目标 sdkversion。

AndroidManifest.xml:`

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:theme="@style/Theme.AppCompat.Light">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".CreateAccActivity"
        android:label="@string/title_activity_create_acc"
        android:theme="@style/Theme.AppCompat.Light" />
    <activity
        android:name=".LoginActivity"
        android:label="@string/title_activity_login"
        android:theme="@style/Theme.AppCompat.Light" />
    <activity
        android:name=".LandingActivity"
        android:label="@string/title_activity_landing"
        android:theme="@style/Theme.AppCompat.Light" />
    <activity
        android:name=".SearchActivity"
        android:label="@string/title_activity_search"
        android:theme="@style/Theme.AppCompat.Light" />
    <activity
        android:name=".RentEndActivity"
        android:label="@string/title_activity_rent_end"
        android:theme="@style/Theme.AppCompat.Light" />
    <activity
        android:name=".RentStartActivity"
        android:label="@string/title_activity_rent_start"
        android:theme="@style/Theme.AppCompat.Light" />
    <activity
        android:name=".SearchResultsActivity"
        android:label="@string/title_activity_search_results"
        android:theme="@style/Theme.AppCompat.Light"></activity>
</application>

`

我的 compilesdkversion 是 25, minimumsdkversion 为 16, targetsdkversion 是 19(我正在使用的那个)

【问题讨论】:

  • 分享你的logcat

标签: android android-studio emulation


【解决方案1】:

由于我们在build.gradle 文件中设置的目标、编译和最低 sdk 级别,会出现此类问题。就像您设置 targetsdkversion 为 19 一样,如果您尝试在超过 19 个 sdk 级别的模拟器上运行您的应用程序,在这种情况下您的应用程序将不会运行。所以尝试设置你的targetsdkversion as 24。正如你设置的compilesdkversion is 25 是好的。也许你的问题会得到解决。

【讨论】:

  • 那么如果我使用 API 19 来构建我的应用程序,我的 Targetsdkversion 和 Compilesdkversion 可以更高吗??
  • 您可以在 build.gradle 文件中设置您的 API 19,在这种情况下,您只能在从 minimumsdk 级别到 api 级别 19 的设备操作系统上运行您的应用程序。
  • 如果您想了解更多关于编译和目标 sdk 级别的信息,请参考:stackoverflow.com/questions/26694108/…
【解决方案2】:

尝试从命令行运行模拟器,如果在模拟器启动时出现任何错误,你会发现错误。

> cd <sdkpath>/emulator
> emulator @youravdname

【讨论】:

    猜你喜欢
    • 2021-11-06
    • 2012-01-28
    • 2011-06-18
    • 2017-12-15
    • 1970-01-01
    • 1970-01-01
    • 2012-12-09
    • 2020-12-27
    • 2018-11-27
    相关资源
    最近更新 更多