Error starting the app

Asked

Viewed 148 times

0

When I try to run an application by Android Studio in the Genymotion emulator an unexpected error occurs and the app does not open.

Erro do aplicativo

And the log flap Logcat from Android Studio returns the following:

03-14 19:06:21.367 3725-3725/br.com.meuprojeto.deliverymercados E/dalvikvm: Could not find class 'android.support.v4.view.ViewCompat$OnUnhandledKeyEventListenerWrapper', referenced from method android.support.v4.view.ViewCompat.addOnUnhandledKeyEventListener
03-14 19:06:21.367 3725-3725/br.com.meuprojeto.deliverymercados E/dalvikvm: Could not find class 'android.view.WindowInsets', referenced from method android.support.v4.view.ViewCompat.dispatchApplyWindowInsets
03-14 19:06:21.367 3725-3725/br.com.meuprojeto.deliverymercados E/dalvikvm: Could not find class 'android.view.WindowInsets', referenced from method android.support.v4.view.ViewCompat.onApplyWindowInsets
03-14 19:06:21.367 3725-3725/br.com.meuprojeto.deliverymercados E/dalvikvm: Could not find class 'android.view.View$OnUnhandledKeyEventListener', referenced from method android.support.v4.view.ViewCompat.removeOnUnhandledKeyEventListener
03-14 19:06:21.367 3725-3725/br.com.meuprojeto.deliverymercados E/dalvikvm: Could not find class 'android.support.v4.view.ViewCompat$1', referenced from method android.support.v4.view.ViewCompat.setOnApplyWindowInsetsListener
03-14 19:06:21.367 3725-3725/br.com.meuprojeto.deliverymercados E/dalvikvm: Could not find class 'android.support.v4.widget.DrawerLayout$1', referenced from method android.support.v4.widget.DrawerLayout.<init>
03-14 19:06:21.371 3725-3725/br.com.meuprojeto.deliverymercados E/dalvikvm: Could not find class 'android.view.WindowInsets', referenced from method android.support.v4.widget.DrawerLayout.onDraw
03-14 19:06:21.371 3725-3725/br.com.meuprojeto.deliverymercados E/dalvikvm: Could not find class 'android.view.WindowInsets', referenced from method android.support.v4.widget.DrawerLayout.onMeasure
03-14 19:06:21.371 3725-3725/br.com.meuprojeto.deliverymercados E/dalvikvm: Could not find class 'android.view.WindowInsets', referenced from method android.support.v4.widget.DrawerLayout.onMeasure
03-14 19:06:21.383 3725-3725/br.com.meuprojeto.deliverymercados E/dalvikvm: Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method android.support.v7.widget.AppCompatImageHelper.hasOverlappingRendering
03-14 19:06:21.383 3725-3725/br.com.meuprojeto.deliverymercados E/AndroidRuntime: FATAL EXCEPTION: main
    Process: br.com.meuprojeto.deliverymercados, PID: 3725
    java.lang.RuntimeException: Unable to start activity ComponentInfo{br.com.meuprojeto.deliverymercados/br.com.meuprojeto.dm.MainActivity}: android.view.InflateException: Binary XML file line #12: Error inflating class ImageView
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
        at android.app.ActivityThread.access$800(ActivityThread.java:135)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:136)
        at android.app.ActivityThread.main(ActivityThread.java:5001)
        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:785)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
        at dalvik.system.NativeStart.main(Native Method)
     Caused by: android.view.InflateException: Binary XML file line #12: Error inflating class ImageView
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:713)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
        at android.view.LayoutInflater.parseInclude(LayoutInflater.java:839)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:745)
        at android.view.LayoutInflater.parseInclude(LayoutInflater.java:839)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:745)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
        at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
        at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
        at br.com.meuprojeto.dm.MainActivity.onCreate(MainActivity.java:21)
        at android.app.Activity.performCreate(Activity.java:5231)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233) 
        at android.app.ActivityThread.access$800(ActivityThread.java:135) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 
        at android.os.Handler.dispatchMessage(Handler.java:102) 
        at android.os.Looper.loop(Looper.java:136) 
        at android.app.ActivityThread.main(ActivityThread.java:5001) 
        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:785) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) 
        at dalvik.system.NativeStart.main(Native Method) 
     Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f0700bd
        at android.content.res.Resources.getValue(Resources.java:1123)
        at android.support.v7.widget.ResourcesWrapper.getValue(ResourcesWrapper.java:209)
        at android.support.v7.widget.AppCompatDrawableManager.loadDrawableFromDelegates(AppCompatDrawableManager.java:331)
        at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:198)
        at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:191)
        at android.support.v7.content.res.AppCompatResources.getDrawable(AppCompatResources.java:102)
        at android.support.v7.widget.AppCompatImageHelper.loadFromAttributes(AppCompatImageHelper.java:59)
        at android.support.v7.widget.AppCompatImageView.<init>(AppCompatImageView.java:78)
        at android.support.v7.widget.AppCompatImageView.<init>(AppCompatImageView.java:68)
        at android.support.v7.app.AppCompatViewInflater.createImageView(AppCompatViewInflater.java:182)
        at android.support.v7.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:106)
        at android.support.v7.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1266)
        at android.support.v7.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1316)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:684)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:755) 
        at android.view.LayoutInflater.parseInclude(LayoutInflater.java:839) 
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:745) 
        at android.view.LayoutInflater.parseInclude(LayoutInflater.java:839) 
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:745) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:492) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:397) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:353) 
        at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469) 
        at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) 
        at br.com.meuprojeto.dm.MainActivity.onCreate(MainActivity.java:21) 
        at android.app.Activity.performCreate(Activity.java:5231) 
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148) 
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233) 
        at android.app.ActivityThread.access$800(ActivityThread.java:135) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 
        at android.os.Handler.dispatchMessage(Handler.java:102) 
        at android.os.Looper.loop(Looper.java:136) 
        at android.app.ActivityThread.main(ActivityThread.java:5001) 
        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:785) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) 
        at dalvik.system.NativeStart.main(Native Method) 

Note: When I started the project it ran on all versions of Android, and now only in version 8.0.

  • This looks like the tab log Run. Edit the question and include the error (usually in red) in the tab LogCat.

  • That’s right, it’s the run folder log! But it’s all in one color. Nothing red.

  • In Run events related to the installation of the application will be logged. In LogCat are logged in the data related to the execution of the same. It is there that the exceptions (errors) will be informed.

  • Quando verifiquei o LogCat ele retorna o seguinte erro:&#xA;&#xA;03-14 19:06:21.367 3725-3725/br.com.meuprojeto.deliverymercados E/dalvikvm: Could not find class 'android.support.v4.view.ViewCompat$OnUnhandledKeyEventListenerWrapper', referenced from method android.support.v4.view.Viewcompat.addOnUnhandledKeyEventListener This is only the first, appears many. Anti hand already appreciate your availability to help!

  • Please edit your post replacing the previous error codes with the new ones. Make sure to put the code between the triple quotes (...) that format the code correctly.

  • Done. Sorry for formatting errors, I’m new here. Thanks again!

Show 1 more comment

1 answer

1


See the exceptions described in the error:

Unable to start Activity [...Mainactivity]: android view..Inflateexception: Binary XML file line #12: Error inflating class Imageview.

Indicates that unable to start MainActivity due to an error while inflating (creating) a ImageView; and the error is in line 12 of the layout XML.

A little further down the stack trace (error):

Caused by: android.content.res.Resources$Notfoundexception: Resource ID #0x7f0700bd

Indicates that the resource (drawable in your case) was not found.


To solve the problem, check line 12 of the layout used in MainActivity, then make sure that it is accessible. Some possible causes are:

  • Drawable has been completely excluded;
  • drawable exists but only for specific settings: see this documentation on alternative resources.

When replacing the image source (probably android:src) - or fix the folder in case of alternative resources -, the problem must be solved.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.