No errors in Android studio, app still crashes on open

10,750

Sometimes it occurs due to repeating of ID from xml file, example, if you have two xml files such Main activity and Home, both you have Textview with id myTextview, so once use this(id) in you class, android studio will not count as error but apps will crash at both activity once you click.' Enyoy Coding.

Share:
10,750
Xxero
Author by

Xxero

Updated on June 04, 2022

Comments

  • Xxero
    Xxero about 2 years

    So I'm incredibly new to Android studio. I typically just watch tutorials and follow along to learn what everything is and see how everything works. I was trying to follow a tutorial for a card view/recycler view with a collapsilbe toolbar, and after finishing the code (almost exactly as the guy in the video showed), the app still won't run. Only thing I changed were icon, a couple drawables and some of the values (I edited it all around in the code).

    Here's the post of the source code I followed: https://github.com/delaroy/AndroidCardView?files=1

    As I said, there's no errors or anything. But when I run the app, it crashes immediately.

    This is also my first post, so if any other info is needed, let me know.

    As I said, I changed only pictures and a few names of the variables and such. Also, everything that was changed was fixed in values and such.

    I've ran other apps on my phone with no issue.

    Not sure if it's a phone issue or what.

    I'm using a Note 3 running Android 5.0.

  • Xxero
    Xxero almost 8 years
    E/AndroidRuntime: FATAL EXCEPTION: main Process: com.xxerosec.fldoccs, PID: 10093 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xxerosec.fldoccs/com.xxerosec.fldoccs.Main‌​Activity}: java.lang.IllegalStateException: This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_SUPPORT_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead. This is what I'm seeing.
  • Xxero
    Xxero almost 8 years
    I also just got this when opening the main activity: Rendering Problems The following classes could not be instantiated: - android.support.design.widget.CollapsingToolbarLayout (Open Class, Show Exception, Clear Cache) Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE Exception Details android.content.res.Resources$NotFoundException at com.android.layoutlib.bridge.android.BridgeContext.obtainSty‌​ledAttributes(Bridge‌​Context.java:626) Copy stack to clipboard
  • Alessandro Argentieri
    Alessandro Argentieri almost 8 years
    ok as I can see it could be about your action bar. The nice thing is that Android Studio suggests how to fix problems. It tells you to use a toolbar instead. Now I post another answer with some info about it.