Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8467315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:36:25+00:00 2026-06-10T15:36:25+00:00

I have a crash occurring when opening an app with next to no code

  • 0

I have a crash occurring when opening an app with next to no code in it.

Code is:

package com.spotsofmagic.spotsofmagic;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.nfc.NdefMessage;
import android.nfc.NdefRecord;
import android.nfc.NfcAdapter;
import android.os.Bundle;
import android.os.Parcelable;
import android.util.Log;
import android.bluetooth.*;

public class CardActivity extends Activity implements OnClickListener {

    private static final String TAG = null;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.card_activity);

    public void onClick(DialogInterface dialog, int which) {
        // TODO Auto-generated method stub

    }
}

App crashes instantly. The stack trace is as follows, which makes little sense to me:

08-30 22:37:31.698: W/dalvikvm(8852): threadid=1: thread exiting with uncaught exception (group=0x40ceb300)
08-30 22:37:31.718: E/AndroidRuntime(8852): FATAL EXCEPTION: main
08-30 22:37:31.718: E/AndroidRuntime(8852): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.spotsofmagic.spotsofmagic/com.spotsofmagic.spotsofmagic.CardActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
08-30 22:37:31.718: E/AndroidRuntime(8852):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
08-30 22:37:31.718: E/AndroidRuntime(8852):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
08-30 22:37:31.718: E/AndroidRuntime(8852):     at android.app.ActivityThread.access$600(ActivityThread.java:130)
08-30 22:37:31.718: E/AndroidRuntime(8852):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
08-30 22:37:31.718: E/AndroidRuntime(8852):     at android.os.Handler.dispatchMessage(Handler.java:99)
08-30 22:37:31.718: E/AndroidRuntime(8852):     at android.os.Looper.loop(Looper.java:137)
08-30 22:37:31.718: E/AndroidRuntime(8852):     at android.app.ActivityThread.main(ActivityThread.java:4745)
08-30 22:37:31.718: E/AndroidRuntime(8852):     at java.lang.reflect.Method.invokeNative(Native Method)
08-30 22:37:31.718: E/AndroidRuntime(8852):     at java.lang.reflect.Method.invoke(Method.java:511)
08-30 22:37:31.718: E/AndroidRuntime(8852):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
08-30 22:37:31.718: E/AndroidRuntime(8852):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
08-30 22:37:31.718: E/AndroidRuntime(8852):     at dalvik.system.NativeStart.main(Native Method)
08-30 22:37:31.718: E/AndroidRuntime(8852): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
08-30 22:37:31.718: E/AndroidRuntime(8852):     at android.view.LayoutInflater.createView(LayoutInflater.java:613)
08-30 22:37:31.718: E/AndroidRuntime(8852):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
08-30 22:37:31.718: E/AndroidRuntime(8852):     at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)
08-30 22:37:31.718: E/AndroidRuntime(8852):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)
08-30 22:37:31.718: E/AndroidRuntime(8852):     at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
08-30 22:37:31.718: E/AndroidRuntime(8852):     at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
08-30 22:37:31.718: E/AndroidRuntime(8852):     at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
08-30 22:37:31.718: E/AndroidRuntime(8852):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:256)
08-30 22:37:31.718: E/AndroidRuntime(8852):     at android.app.Activity.setContentView(Activity.java:1867)
08-30 22:37:31.718: E/AndroidRuntime(8852):     at com.spotsofmagic.spotsofmagic.CardActivity.onCreate(CardActivity.java:23)
08-30 22:37:31.718: E/AndroidRuntime(8852):     at android.app.Activity.performCreate(Activity.java:5008)
08-30 22:37:31.718: E/AndroidRuntime(8852):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
08-30 22:37:31.718: E/AndroidRuntime(8852):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
08-30 22:37:31.718: E/AndroidRuntime(8852):     ... 11 more
08-30 22:37:31.718: E/AndroidRuntime(8852): Caused by: java.lang.reflect.InvocationTargetException
08-30 22:37:31.718: E/AndroidRuntime(8852):     at java.lang.reflect.Constructor.constructNative(Native Method)
08-30 22:37:31.718: E/AndroidRuntime(8852):     at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
08-30 22:37:31.718: E/AndroidRuntime(8852):     at android.view.LayoutInflater.createView(LayoutInflater.java:587)
08-30 22:37:31.718: E/AndroidRuntime(8852):     ... 23 more
08-30 22:37:31.718: E/AndroidRuntime(8852): Caused by: android.content.res.Resources$NotFoundException: File Spots of Magic from drawable resource ID #0x7f040000
08-30 22:37:31.718: E/AndroidRuntime(8852):     at android.content.res.Resources.loadDrawable(Resources.java:1935)
08-30 22:37:31.718: E/AndroidRuntime(8852):     at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
08-30 22:37:31.718: E/AndroidRuntime(8852):     at android.view.View.<init>(View.java:3336)
08-30 22:37:31.718: E/AndroidRuntime(8852):     at android.view.ViewGroup.<init>(ViewGroup.java:427)
08-30 22:37:31.718: E/AndroidRuntime(8852):     at android.widget.FrameLayout.<init>(FrameLayout.java:101)
08-30 22:37:31.718: E/AndroidRuntime(8852):     at android.widget.FrameLayout.<init>(FrameLayout.java:97)
08-30 22:37:31.718: E/AndroidRuntime(8852):     ... 26 more
08-30 22:37:31.718: E/AndroidRuntime(8852): Caused by: java.io.FileNotFoundException: Spots of Magic
08-30 22:37:31.718: E/AndroidRuntime(8852):     at android.content.res.AssetManager.openNonAssetNative(Native Method)
08-30 22:37:31.718: E/AndroidRuntime(8852):     at android.content.res.AssetManager.openNonAsset(AssetManager.java:407)
08-30 22:37:31.718: E/AndroidRuntime(8852):     at android.content.res.Resources.loadDrawable(Resources.java:1927)
08-30 22:37:31.718: E/AndroidRuntime(8852):     ... 31 more

Card_Activity.xml file:

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@string/app_name"
    android:gravity="center"
    android:orientation="vertical"
    android:padding="25dp" >

    <ImageView 
            android:id="@+id/card_view"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:scaleType="fitCenter"
    />
</FrameLayout>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T15:36:27+00:00Added an answer on June 10, 2026 at 3:36 pm

    android:background="@string/app_name" this is the problem.

    Background should be color or drawable like this.

    android:background="@drawable/name of drawable"
    

    or

     android:background="@color/name of color"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following crash log and complete source code of app. All I
I have a crash in my app that I cannot debug for the life
I just have a system crash and reinstall Ubuntu 11.10, and my code produces
I have an issue with NSRange that is causing my app to crash when
I have an error which is causing my app to crash under iOS5 only
I have a crash, and I can't see why it's occurring. I'd like to
In my app, I have an Activity that acts as a camera preview. I
I have a crash dump of unmanaged C++ code. I opened it with Windbg,
I have a crash in my App that sometimes occurs, I tested with zombies
I have a crash when starting the app in iOS 3.0 (the app works

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.