首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >添加ImageView时获取"W/art失败execv“错误

添加ImageView时获取"W/art失败execv“错误
EN

Stack Overflow用户
提问于 2017-03-20 05:01:36
回答 3查看 7.3K关注 0票数 3

我刚开始了一个新项目,一切都很顺利。然后,我从可绘图中添加一个ImageView,然后引发以下错误:

代码语言:javascript
复制
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

代码语言:javascript
复制
<?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

代码语言:javascript
复制
<?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>

错误:

代码语言:javascript
复制
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
EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2017-04-04 12:16:56

我也有同样的问题,解决的办法就是移除。

代码语言:javascript
复制
android:name="android.support.multidex.MultiDexApplication"

从…

代码语言:javascript
复制
<application>

更新

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

代码语言:javascript
复制
compile 'com.android.support:multidex:1.0.0'

导致此错误的另一个原因是布局文件中缺少一些元素。一旦我添加了它们,我的应用程序就停止崩溃,并显示出此错误。

票数 2
EN

Stack Overflow用户

发布于 2017-03-20 05:09:39

在您的Gradle文件集中,vectorDrawables.useSupportLibrary = true

代码语言:javascript
复制
android {  
defaultConfig {  
 vectorDrawables.useSupportLibrary = true  
}  
}  

将ImageView更改为android.support.v7.widget.AppCompatImageView

代码语言:javascript
复制
  <android.support.v7.widget.AppCompatImageView
    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" />
票数 2
EN

Stack Overflow用户

发布于 2017-03-20 05:34:13

转到文件->失效缓存/重新启动.它的

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42896161

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档