android - 添加 ImageView 时出现 "W/art Failed execv"错误

标签 android android-studio android-constraintlayout

我刚开始一个新项目,它运行良好。然后我从我的可绘制对象中添加一个 ImageView,然后引发此错误:

03-20 15:54:28.711 25633-25633/com.example.zorgan.app W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.example.zorgan.app-1/split_lib_dependencies_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.example.zorgan.app-1@split_lib_dependencies_apk.apk@classes.dex) because non-0 exit status

知道问题出在哪里吗?这是一个全新的项目,所以不确定出了什么问题。这是我的 activity_main.xml:

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:background="#333"

    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.zorgan.app.MainActivity">


    <ImageView
        android:id="@+id/imageView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:srcCompat="@drawable/street" />
</android.support.constraint.ConstraintLayout>

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.zorgan.app" >

    <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/Theme.AppCompat.NoActionBar" >
        <activity android:name=".MainActivity" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

错误:

03-20 16:25:37.981 27866-27866/com.example.zorgan.app W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.example.zorgan.app-1/split_lib_dependencies_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.example.zorgan.app-1@split_lib_dependencies_apk.apk@classes.dex) because non-0 exit status
03-20 16:25:38.181 27866-27866/com.example.zorgan.app W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.example.zorgan.app-1/split_lib_slice_0_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.example.zorgan.app-1@split_lib_slice_0_apk.apk@classes.dex) because non-0 exit status
03-20 16:25:38.271 27866-27866/com.example.zorgan.app W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.example.zorgan.app-1/split_lib_slice_1_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.example.zorgan.app-1@split_lib_slice_1_apk.apk@classes.dex) because non-0 exit status
03-20 16:25:38.371 27866-27866/com.example.zorgan.app W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.example.zorgan.app-1/split_lib_slice_2_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.example.zorgan.app-1@split_lib_slice_2_apk.apk@classes.dex) because non-0 exit status
03-20 16:25:38.481 27866-27866/com.example.zorgan.app W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.example.zorgan.app-1/split_lib_slice_3_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.example.zorgan.app-1@split_lib_slice_3_apk.apk@classes.dex) because non-0 exit status
03-20 16:25:38.571 27866-27866/com.example.zorgan.app W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.example.zorgan.app-1/split_lib_slice_4_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.example.zorgan.app-1@split_lib_slice_4_apk.apk@classes.dex) because non-0 exit status
03-20 16:25:38.671 27866-27866/com.example.zorgan.app W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.example.zorgan.app-1/split_lib_slice_5_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.example.zorgan.app-1@split_lib_slice_5_apk.apk@classes.dex) because non-0 exit status
03-20 16:25:38.761 27866-27866/com.example.zorgan.app W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.example.zorgan.app-1/split_lib_slice_6_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.example.zorgan.app-1@split_lib_slice_6_apk.apk@classes.dex) because non-0 exit status
03-20 16:25:38.881 27866-27866/com.example.zorgan.app W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.example.zorgan.app-1/split_lib_slice_7_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.example.zorgan.app-1@split_lib_slice_7_apk.apk@classes.dex) because non-0 exit status
03-20 16:25:38.981 27866-27866/com.example.zorgan.app W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.example.zorgan.app-1/split_lib_slice_8_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.example.zorgan.app-1@split_lib_slice_8_apk.apk@classes.dex) because non-0 exit status
03-20 16:25:39.071 27866-27866/com.example.zorgan.app W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.example.zorgan.app-1/split_lib_slice_9_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.example.zorgan.app-1@split_lib_slice_9_apk.apk@classes.dex) because non-0 exit status
03-20 16:25:39.081 27866-27866/com.example.zorgan.app W/System: ClassLoader referenced unknown path: /data/app/com.example.zorgan.app-1/lib/arm64

最佳答案

我有同样的问题,解决它的方法是删除

android:name="android.support.multidex.MultiDexApplication"

来自

<application>

更新

如果由于某些其他原因您的应用需要上述内容,您可以添加以下依赖项:

compile 'com.android.support:multidex:1.0.0'

此错误的另一个原因 是我的布局 xml 文件中缺少一些元素。添加它们后,我的应用程序不再崩溃并显示此错误

关于android - 添加 ImageView 时出现 "W/art Failed execv"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42896161/

相关文章:

android-studio - 什么是在 gradle 文件中声明的 minifyEnabled。请问下面block的代码的含义和用法

Android约束布局水平划分

android - 如何在 ConstraintLayout 中将 View 居中而不重叠不均匀的邻居

Android:ConstraintLayout 在 SDK 4.1.x 上有不同的行为

java - CordovaActivity 上的 onBackpressed 未调用

android - 当数据发生变化时,如何从我的 firebase 存储中获取数据?安卓

android - 即使添加插件后也无法启用数据绑定(bind) 'org.jetbrains.kotlin.kapt'

java - android 数组列表排序

android - 使用导航组件和导航图在 Fragment(非 Activity )内使用 BottomNavigationView 导航

java - 无法将 ksoap2 导入 Android Studio