当我开始模拟我的应用时,我收到以下错误。有没有人知道我哪里出错了?
10-02 20:50:41.241: WARN/WindowManager(58): HistoryRecord{525864f0 com.example.iwe/.ui.splash.SplashActivity} he10-02 20:50:41.241: WARN/WindowManager(58): android.view.InflateException: Binary XML file line #24: Error inflating class <unknown>
10-02 20:50:41.241: WARN/WindowManager(58): at android.view.LayoutInflater.createView(LayoutInflater.java:513)
10-02 20:50:41.241: WARN/WindowManager(58): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
10-02 20:50:41.241: WARN/WindowManager(58): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
10-02 20:50:41.241: WARN/WindowManager(58): at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
10-02 20:50:41.241: WARN/WindowManager(58): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
10-02 20:50:41.241: WARN/WindowManager(58): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
10-02 20:50:41.241: WARN/WindowManager(58): at com.android.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java:2165)
10-02 20:50:41.241: WARN/WindowManager(58): at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:2220)
10-02 20:50:41.241: WARN/WindowManager(58): at com.android.internal.policy.impl.PhoneWindow.getDecorView(PhoneWindow.java:1407)
10-02 20:50:41.241: WARN/WindowManager(58): at com.android.internal.policy.impl.PhoneWindowManager.addStartingWindow(PhoneWindowManager.java:894)
10-02 20:50:41.241: WARN/WindowManager(58): at com.android.server.WindowManagerService$H.handleMessage(WindowManagerService.java:9007)
10-02 20:50:41.241: WARN/WindowManager(58): at android.os.Handler.dispatchMessage(Handler.java:99)
10-02 20:50:41.241: WARN/WindowManager(58): at android.os.Looper.loop(Looper.java:123)
10-02 20:50:41.241: WARN/WindowManager(58): at com.android.server.WindowManagerService$WMThread.run(WindowManagerService.java:570)
10-02 20:50:41.241: WARN/WindowManager(58): Caused by: java.lang.reflect.InvocationTargetException
10-02 20:50:41.241: WARN/WindowManager(58): at android.widget.FrameLayout.<init>(FrameLayout.java:79)
10-02 20:50:41.241: WARN/WindowManager(58): at java.lang.reflect.Constructor.constructNative(Native Method)
10-02 20:50:41.241: WARN/WindowManager(58): at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
10-02 20:50:41.241: WARN/WindowManager(58): at android.view.LayoutInflater.createView(LayoutInflater.java:500)
10-02 20:50:41.241: WARN/WindowManager(58): ... 13 more
10-02 20:50:41.241: WARN/WindowManager(58): Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x2/d=0x1010059 a=-1}
10-02 20:50:41.241: WARN/WindowManager(58): at android.content.res.Resources.loadDrawable(Resources.java:1681)
10-02 20:50:41.241: WARN/WindowManager(58): at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
10-02 20:50:41.241: WARN/WindowManager(58): at android.widget.FrameLayout.<init>(FrameLayout.java:91)
10-02 13:29:47.983: ERROR/dalvikvm(279): Could not find class 'com.example.iwe.utils.ActivityLifecycleHandler', referenced from method com.example.iwe.App.onCreate
10-02 13:29:52.772: ERROR/AndroidRuntime(279): FATAL EXCEPTION: main
10-02 13:29:52.772: ERROR/AndroidRuntime(279): java.lang.NoClassDefFoundError: com.example.iwe.utils.ActivityLifecycleHandler
10-02 13:29:52.772: ERROR/AndroidRuntime(279): at com.example.iwe.App.onCreate(App.java:32)
10-02 13:29:52.772: ERROR/AndroidRuntime(279): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:969)
10-02 13:29:52.772: ERROR/AndroidRuntime(279): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4244)
10-02 13:29:52.772: ERROR/AndroidRuntime(279): at android.app.ActivityThread.access$3000(ActivityThread.java:125)
10-02 13:29:52.772: ERROR/AndroidRuntime(279): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2071)
10-02 13:29:52.772: ERROR/AndroidRuntime(279): at android.os.Handler.dispatchMessage(Handler.java:99)
10-02 13:29:52.772: ERROR/AndroidRuntime(279): at android.os.Looper.loop(Looper.java:123)
10-02 13:29:52.772: ERROR/AndroidRuntime(279): at android.app.ActivityThread.main(ActivityThread.java:4627)
10-02 13:29:52.772: ERROR/AndroidRuntime(279): at java.lang.reflect.Method.invokeNative(Native Method)
10-02 13:29:52.772: ERROR/AndroidRuntime(279): at java.lang.reflect.Method.invoke(Method.java:521)
10-02 13:29:52.772: ERROR/AndroidRuntime(279): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
10-02 13:29:52.772: ERROR/AndroidRuntime(279): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
10-02 13:29:52.772: ERROR/AndroidRuntime(279): at dalvik.system.NativeStart.main(Native Method)
这是我的Manifest xml:请纠正我错过的地方。
<?xml version="1.0" encoding="utf-8"?>
<manifest
package="com.example.iwe"
xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="preferExternal">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.MANAGE_DOCUMENTS" />
<uses-permission android:name="android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="com.example.iwe.permission.C2D_MESSAGE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="com.google.android.maps"/>
<permission
android:name="com.example.iwe.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<application
android:name="com.example.iwe.App"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<activity
android:name=".ui.splash.SplashActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ui.landing.LandingActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".ui.login.LoginActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/lgn_login"
android:screenOrientation="portrait" />
<activity
android:name=".ui.signup.SignUpActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/sup_sign_up"
android:screenOrientation="portrait" />
<activity
android:name=".ui.main.MainActivity"
android:screenOrientation="portrait"
android:icon="@drawable/actionbar_logo"/>
<activity
android:name="com.facebook.LoginActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:screenOrientation="portrait" />
<activity
android:name=".ui.friends.FriendDetailsActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/frd_title"
android:parentActivityName=".ui.main.MainActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.mediacall.CallActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:parentActivityName=".ui.main.MainActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.chats.NewDialogActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/ndl_title"
android:parentActivityName=".ui.main.MainActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.chats.PrivateDialogActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:parentActivityName=".ui.main.MainActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.chats.GroupDialogActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:parentActivityName=".ui.main.MainActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.chats.GroupDialogDetailsActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/gdd_title"
android:parentActivityName=".ui.chats.GroupDialogActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.profile.ProfileActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/prf_title"
android:parentActivityName=".ui.main.MainActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.chats.AddFriendsToGroupActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/afg_title"
android:parentActivityName=".ui.chats.GroupDialogDetailsActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.settings.ChangePasswordActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/cpw_change_password_title"
android:parentActivityName=".ui.main.MainActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.forgotpassword.ForgotPasswordActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/fpw_forgot_password_title"
android:parentActivityName=".ui.login.LoginActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.agreements.UserAgreementActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/uag_user_agreement_title"
android:parentActivityName=".ui.signup.SignUpActivity"
android:screenOrientation="portrait" />
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_app_id" />
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyBmoKFbTyrK96fjzIqY7v9C_wNNqtSl_3w"/>
<receiver
android:name=".GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.example.iwe" />
</intent-filter>
</receiver>
<service android:name=".GCMIntentService" />
<service
android:name=".service.QBService"
android:icon="@drawable/ic_launcher" />
<provider
android:name="com.example.iwe.caching.DatabaseProvider"
android:authorities="com.example.iwe"
android:exported="false" />
</application>
</manifest>
这是我的Manifest xml:请纠正我错过的地方。
答案 0 :(得分:1)
检查布局
这里是arror引起的:android.content.res.Resources $ NotFoundException:资源不是Drawable(颜色或路径):
答案 1 :(得分:0)
这可能是因为您可能没有进行运行配置。转到运行配置并选择要运行的项目,并尝试它应该工作。
答案 2 :(得分:0)
您的问题有误,因为您的应用程序已在模拟器中上传,应用程序崩溃,因为您遇到布局通胀问题,请检查您的布局和代码。提问时请具体。