3

我为 android 2.2 创建了我的应用程序的第一个版本。但是现在当我发布 4.0 版本的应用程序时,应用程序停止工作。

但我低于强制关闭错误

04-12 12:11:07.377: E/AndroidRuntime(716): FATAL EXCEPTION: main
04-12 12:11:07.377: E/AndroidRuntime(716): java.lang.RuntimeException: Unable to start activity ComponentInfo{ru.deltakey.mobile.android/ru.deltakey.mobile.android.ui.MainActivity}: android.view.InflateException: Binary XML file line #96: Error inflating class <unknown>
04-12 12:11:07.377: E/AndroidRuntime(716):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1955)
04-12 12:11:07.377: E/AndroidRuntime(716):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1980)
04-12 12:11:07.377: E/AndroidRuntime(716):  at android.app.ActivityThread.access$600(ActivityThread.java:122)
04-12 12:11:07.377: E/AndroidRuntime(716):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1146)
04-12 12:11:07.377: E/AndroidRuntime(716):  at android.os.Handler.dispatchMessage(Handler.java:99)
04-12 12:11:07.377: E/AndroidRuntime(716):  at android.os.Looper.loop(Looper.java:137)
04-12 12:11:07.377: E/AndroidRuntime(716):  at android.app.ActivityThread.main(ActivityThread.java:4340)
04-12 12:11:07.377: E/AndroidRuntime(716):  at java.lang.reflect.Method.invokeNative(Native Method)
04-12 12:11:07.377: E/AndroidRuntime(716):  at java.lang.reflect.Method.invoke(Method.java:511)
04-12 12:11:07.377: E/AndroidRuntime(716):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
04-12 12:11:07.377: E/AndroidRuntime(716):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
04-12 12:11:07.377: E/AndroidRuntime(716):  at dalvik.system.NativeStart.main(Native Method)
04-12 12:11:07.377: E/AndroidRuntime(716): Caused by: android.view.InflateException: Binary XML file line #96: Error inflating class <unknown>
04-12 12:11:07.377: E/AndroidRuntime(716):  at android.view.LayoutInflater.createView(LayoutInflater.java:606)
04-12 12:11:07.377: E/AndroidRuntime(716):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
04-12 12:11:07.377: E/AndroidRuntime(716):  at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
04-12 12:11:07.377: E/AndroidRuntime(716):  at android.view.LayoutInflater.rInflate(LayoutInflater.java:742)
04-12 12:11:07.377: E/AndroidRuntime(716):  at android.view.LayoutInflater.rInflate(LayoutInflater.java:742)
04-12 12:11:07.377: E/AndroidRuntime(716):  at android.view.LayoutInflater.rInflate(LayoutInflater.java:742)
04-12 12:11:07.377: E/AndroidRuntime(716):  at android.view.LayoutInflater.parseInclude(LayoutInflater.java:823)
04-12 12:11:07.377: E/AndroidRuntime(716):  at android.view.LayoutInflater.rInflate(LayoutInflater.java:729)
04-12 12:11:07.377: E/AndroidRuntime(716):  at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
04-12 12:11:07.377: E/AndroidRuntime(716):  at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
04-12 12:11:07.377: E/AndroidRuntime(716):  at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
04-12 12:11:07.377: E/AndroidRuntime(716):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:251)
04-12 12:11:07.377: E/AndroidRuntime(716):  at android.app.Activity.setContentView(Activity.java:1835)
04-12 12:11:07.377: E/AndroidRuntime(716):  at ru.deltakey.mobile.android.ui.MainActivity.onCreate(MainActivity.java:105)
04-12 12:11:07.377: E/AndroidRuntime(716):  at android.app.Activity.performCreate(Activity.java:4465)
04-12 12:11:07.377: E/AndroidRuntime(716):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
04-12 12:11:07.377: E/AndroidRuntime(716):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1919)
04-12 12:11:07.377: E/AndroidRuntime(716):  ... 11 more
04-12 12:11:07.377: E/AndroidRuntime(716): Caused by: java.lang.reflect.InvocationTargetException
04-12 12:11:07.377: E/AndroidRuntime(716):  at java.lang.reflect.Constructor.constructNative(Native Method)
04-12 12:11:07.377: E/AndroidRuntime(716):  at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
04-12 12:11:07.377: E/AndroidRuntime(716):  at android.view.LayoutInflater.createView(LayoutInflater.java:586)
04-12 12:11:07.377: E/AndroidRuntime(716):  ... 27 more
04-12 12:11:07.377: E/AndroidRuntime(716): Caused by: android.content.res.Resources$NotFoundException: File  from drawable resource ID #0x1020004
04-12 12:11:07.377: E/AndroidRuntime(716):  at android.content.res.Resources.loadDrawable(Resources.java:1942)
04-12 12:11:07.377: E/AndroidRuntime(716):  at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
04-12 12:11:07.377: E/AndroidRuntime(716):  at android.view.View.<init>(View.java:2780)
04-12 12:11:07.377: E/AndroidRuntime(716):  at android.widget.TextView.<init>(TextView.java:445)
04-12 12:11:07.377: E/AndroidRuntime(716):  at android.widget.Button.<init>(Button.java:108)
04-12 12:11:07.377: E/AndroidRuntime(716):  at android.widget.Button.<init>(Button.java:104)
04-12 12:11:07.377: E/AndroidRuntime(716):  at ru.deltakey.mobile.android.ui.CustomFontButton.<init>(CustomFontButton.java:21)
04-12 12:11:07.377: E/AndroidRuntime(716):  ... 30 more
04-12 12:11:07.377: E/AndroidRuntime(716): Caused by: java.io.FileNotFoundException: 
04-12 12:11:07.377: E/AndroidRuntime(716):  at android.content.res.AssetManager.openNonAssetNative(Native Method)
04-12 12:11:07.377: E/AndroidRuntime(716):  at android.content.res.AssetManager.openNonAsset(AssetManager.java:407)
04-12 12:11:07.377: E/AndroidRuntime(716):  at android.content.res.Resources.loadDrawable(Resources.java:1934)
04-12 12:11:07.377: E/AndroidRuntime(716):  ... 36 more

代码

   public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.login);
        initVariables();
        registerForContextMenu((ListView)findViewById(R.id.favLVid));
    }

我的清单文件是

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="ru.deltakey.mobile.android"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.READ_LOGS"/>

    <uses-sdk android:minSdkVersion="3"
        android:targetSdkVersion="14" />

    <application android:name=".additional.AllApp" android:icon="@drawable/ic_launcher" android:label="@string/app_name">
        <activity android:name=".ui.MainActivity"
                  android:icon="@drawable/ic_launcher"
                  android:theme="@android:style/Theme.Black.NoTitleBar"
                  android:label="@string/app_name"
                  android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

主要的.xml

                <ru.deltakey.mobile.android.ui.CustomFontButton
                android:id="@+id/pay_mom_bt"
                style="@style/MainLayoutButtonsRow"
                android:drawableTop="@drawable/pay_mom"
                android:text="@string/pay_mom"
                delta_mobile:font="default_bold.ttf">
            </ru.deltakey.mobile.android.ui.CustomFontButton>
4

0 回答 0