Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/384.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Android应用程序无法启动活动组件信息Android.content.res.Resources$NotFound_Java_Android_Android Layout - Fatal编程技术网

Java Android应用程序无法启动活动组件信息Android.content.res.Resources$NotFound

Java Android应用程序无法启动活动组件信息Android.content.res.Resources$NotFound,java,android,android-layout,Java,Android,Android Layout,以下是整个logcat堆栈跟踪: 08-23 02:19:52.826 20628-20628/com.example.sham_tech.lastchance E/AndroidRuntime﹕ FATAL EXCEPTION: main Process: com.example.sham_tech.lastchance, PID: 20628 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.exa

以下是整个logcat堆栈跟踪:

08-23 02:19:52.826  20628-20628/com.example.sham_tech.lastchance E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.example.sham_tech.lastchance, PID: 20628
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.sham_tech.lastchance/com.example.sham_tech.lastchance.MainActivity}: android.content.res.Resources$NotFoundException: File res/drawable/abc_ic_ab_back_material.xml from drawable resource ID #0x7f020013
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2389)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2441)
        at android.app.ActivityThread.access$900(ActivityThread.java:151)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1354)
        at android.os.Handler.dispatchMessage(Handler.java:110)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:5345)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:515)
        at   com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
        at dalvik.system.NativeStart.main(Native Method)
 Caused by: android.content.res.Resources$NotFoundException: File    res/drawable/abc_ic_ab_back_material.xml from drawable resource ID #0x7f020013
        at android.content.res.Resources.loadDrawable(Resources.java:2152)
        at android.content.res.Resources.getDrawable(Resources.java:710)
        at   android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:354)
        at   android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:193)
        at   android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawable Manager.java:181)
         at android.support.v7.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:689)
        at   android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:186)
        at android.support.v7.widget.TintTypedArray.getDrawableIfKnown(TintTypedArray.java:  77)
        at android.support.v7.app.AppCompatDelegateImplBase.<init>  (AppCompatDelegateImplBase.java:83)
        at android.support.v7.app.AppCompatDelegateImplV7.<init>(AppCompatDelegateImplV7.java:146)
        at android.support.v7.app.AppCompatDelegateImplV11.<init>(AppCompatDelegateImplV11.java:28)
        at android.support.v7.app.AppCompatDelegateImplV14.<init>(AppCompatDelegateImplV14.java:41)
        at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:193)
        at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:173)
        at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:511)
        at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:71)
        at 
com.example.sham_tech.lastchance.MainActivity.onCreate(MainActivity.java:16)
        at android.app.Activity.performCreate(Activity.java:5343)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1088)
        at   android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2343)        

我已经尝试解决了4天多,但没有结果。请帮帮我!。感谢高级

问题是它正在您的res/drawable/目录中查找名为“abc_ic_ab_back_material.xml”的文件,但找不到它。请确保该文件位于该位置。

粘贴到此处的代码没有引用

abc_ic_ab_back_material
  • 如果您在其他代码中使用了它,那么请查找res/drawable/下是否有名为abc_ic_ab_back_material的资源,如果未找到,请获取一个
  • 如果您没有在任何地方使用过它,只需清理项目并重建

  • 如何在项目中导入支持库?是指路径吗@NJZK2什么路径?我的意思是,您使用什么方法在构建中包含支持库?导入android.os.Bundle;导入android.support.v7.app.AppActivity;导入android.view.view;导入android.widget.TextView;不是那部分。库是如何包含在您的项目中的?是的,我在我的绘图文件中有它,我能做什么?@Yasmine Mohamed您在代码、XML文件或JAVA文件中使用过它吗?@Cobian不,我没有在其中任何一个文件中使用过它。@Yasmine Mohamed Ok,您可以删除abc_ic_ab_back_material.xml,然后清理项目并重新生成project@Yasmine穆罕默德,你有没有清理并重建你的项目?事实上,我检查了一下,发现了!
    package com.example.sham_tech.lastchance;
    
    import android.os.Bundle;
    import android.support.v7.app.AppCompatActivity;
    import android.view.View;
    import android.widget.TextView;
    
    /**
     * This app displays an order form to order coffee.
     */
    public class MainActivity extends AppCompatActivity {
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
    
    /**
     * This method is called when the order button is clicked.
     */
    public void submitOrder(View view) {
        display(1);
    }
    
    /**
     * This method displays the given quantity value on the screen.
     */
    private void display(int number) {
        TextView quantityTextView = (TextView) findViewById(R.id.quantity_text_view);
        quantityTextView.setText("" + number);
    }
    }
    
    abc_ic_ab_back_material