Android模拟器无法加载我的应用?

时间:2014-03-28 21:11:28

标签: android eclipse emulation logcat genymotion

我的Android模拟器根本没有加载我的应用程序,它说它无法安装.apk

由于将模拟器从标准模拟器更改为Genymotion模拟器,我的错误是不同的,这是我的控制台& logcat中。

    [2014-03-28 21:06:53 - LiverpoolPolls] ------------------------------
    [2014-03-28 21:06:53 - LiverpoolPolls] Android Launch!
    [2014-03-28 21:06:53 - LiverpoolPolls] adb is running normally.
    [2014-03-28 21:06:53 - LiverpoolPolls] Performing com.example.liverpoolpolls.Loadhomemenu activity launch
    [2014-03-28 21:06:53 - LiverpoolPolls] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
    [2014-03-28 21:06:57 - LiverpoolPolls] Uploading LiverpoolPolls.apk onto device '192.168.56.101:5555'
    [2014-03-28 21:06:58 - LiverpoolPolls] Installing LiverpoolPolls.apk...
    [2014-03-28 21:07:00 - LiverpoolPolls] Success!
    [2014-03-28 21:07:00 - LiverpoolPolls] Starting activity com.example.liverpoolpolls.Loadhomemenu on device 192.168.56.101:5555
    [2014-03-28 21:07:01 - LiverpoolPolls] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.liverpoolpolls/.Loadhomemenu }

And Logcat:

03-28 21:06:59.861: E/Trace(1084): error opening trace file: No such file or directory (2)
03-28 21:07:00.153: D/dalvikvm(1084): GC_FOR_ALLOC freed 102K, 2% free 8113K/8263K, paused 61ms, total 61ms
03-28 21:07:00.177: D/dalvikvm(1084): GC_FOR_ALLOC freed 1K, 3% free 8466K/8647K, paused 6ms, total 6ms
03-28 21:07:00.185: E/FragmentManager(1084): No view found for id 0x7f050046 (com.example.liverpoolpolls:id/container) for fragment PlaceholderFragment{53576600 #0 id=0x7f050046}
03-28 21:07:00.185: E/FragmentManager(1084): Activity state:
03-28 21:07:00.185: D/FragmentManager(1084):   Local FragmentActivity 53576384 State:
03-28 21:07:00.185: D/FragmentManager(1084):     mCreated=truemResumed=false mStopped=false mReallyStopped=false
03-28 21:07:00.189: D/FragmentManager(1084):     mLoadersStarted=false
03-28 21:07:00.189: D/FragmentManager(1084):   Active Fragments in 53576be8:
03-28 21:07:00.189: D/FragmentManager(1084):     #0: PlaceholderFragment{53576600 #0 id=0x7f050046}
03-28 21:07:00.189: D/FragmentManager(1084):       mFragmentId=#7f050046 mContainerId=#7f050046 mTag=null
03-28 21:07:00.189: D/FragmentManager(1084):       mState=0 mIndex=0 mWho=android:fragment:0 mBackStackNesting=0
03-28 21:07:00.189: D/FragmentManager(1084):       mAdded=true mRemoving=false mResumed=false mFromLayout=false mInLayout=false
03-28 21:07:00.189: D/FragmentManager(1084):       mHidden=false mDetached=false mMenuVisible=true mHasMenu=false
03-28 21:07:00.189: D/FragmentManager(1084):       mRetainInstance=false mRetaining=false mUserVisibleHint=true
03-28 21:07:00.189: D/FragmentManager(1084):       mFragmentManager=FragmentManager{53576be8 in Loadhomemenu{53576384}}
03-28 21:07:00.189: D/FragmentManager(1084):       mActivity=com.example.liverpoolpolls.Loadhomemenu@53576384
03-28 21:07:00.189: D/FragmentManager(1084):   Added Fragments:
03-28 21:07:00.189: D/FragmentManager(1084):     #0: PlaceholderFragment{53576600 #0 id=0x7f050046}
03-28 21:07:00.189: D/FragmentManager(1084):   FragmentManager misc state:
03-28 21:07:00.193: D/FragmentManager(1084):     mActivity=com.example.liverpoolpolls.Loadhomemenu@53576384
03-28 21:07:00.193: D/FragmentManager(1084):     mContainer=android.support.v4.app.FragmentActivity$2@53577084
03-28 21:07:00.193: D/FragmentManager(1084):     mCurState=2 mStateSaved=false mDestroyed=false
03-28 21:07:00.193: D/FragmentManager(1084):   View Hierarchy:
03-28 21:07:00.193: D/FragmentManager(1084):     com.android.internal.policy.impl.PhoneWindow$DecorView{535793c8 V.E..... ... 0,0-0,0}
03-28 21:07:00.193: D/FragmentManager(1084):       android.widget.LinearLayout{53579b2c V.E..... ... 0,0-0,0}
03-28 21:07:00.193: D/FragmentManager(1084):         com.android.internal.widget.ActionBarContainer{5357a104 V.ED.... ... 0,0-0,0 #1020319 android:id/action_bar_container}
03-28 21:07:00.193: D/FragmentManager(1084):           com.android.internal.widget.ActionBarView{5357a448 V.E..... ... 0,0-0,0 #102031a android:id/action_bar}
03-28 21:07:00.193: D/FragmentManager(1084):             android.widget.LinearLayout{5358197c G....... ... 0,0-0,0}
03-28 21:07:00.197: D/FragmentManager(1084):               android.widget.ImageView{53581f78 G.ED.... ... 0,0-0,0 #102023b android:id/up}
03-28 21:07:00.197: D/FragmentManager(1084):               android.widget.LinearLayout{535820ec V.E..... ... 0,0-0,0}
03-28 21:07:00.197: D/FragmentManager(1084):                 android.widget.TextView{5358231c V.ED.... ... 0,0-0,0 #1020242 android:id/action_bar_title}
03-28 21:07:00.197: D/FragmentManager(1084):                 android.widget.TextView{535829dc G.ED.... ... 0,0-0,0 #1020243 android:id/action_bar_subtitle}
03-28 21:07:00.197: D/FragmentManager(1084):             com.android.internal.widget.ActionBarView$HomeView{53580154 V.....C. ... 0,0-0,0}
03-28 21:07:00.197: D/FragmentManager(1084):               android.widget.ImageView{53580c40 G.ED.... ... 0,0-0,0 #102023b android:id/up}
03-28 21:07:00.197: D/FragmentManager(1084):               android.widget.ImageView{53580dc4 V.ED.... ... 0,0-0,0 #102002c android:id/home}
03-28 21:07:00.197: D/FragmentManager(1084):           com.android.internal.widget.ActionBarContextView{53582ce8 G.E..... ... 0,0-0,0 #102031b android:id/action_context_bar}
03-28 21:07:00.197: D/FragmentManager(1084):         android.widget.FrameLayout{53583018 V.ED.... ... 0,0-0,0 #1020002 android:id/content}
03-28 21:07:00.205: D/FragmentManager(1084):           android.widget.RelativeLayout{535843d0 V.E..... ... 0,0-0,0}
03-28 21:07:00.205: D/FragmentManager(1084):             android.widget.ImageView{53584644 V.ED.... ... 0,0-0,0 #7f05003c app:id/imageView1}
03-28 21:07:00.205: D/FragmentManager(1084):             android.widget.ImageButton{53562d80 VFED..C. ... 0,0-0,0 #7f05003d app:id/imageButton1}
03-28 21:07:00.205: D/FragmentManager(1084):             android.widget.ImageButton{53562e70 VFED..C. ... 0,0-0,0 #7f05003e app:id/imageButton2}
03-28 21:07:00.205: D/FragmentManager(1084):         com.android.internal.widget.ActionBarContainer{53583210 G.ED.... ... 0,0-0,0 #102031c android:id/split_action_bar}
03-28 21:07:00.205: D/AndroidRuntime(1084): Shutting down VM
03-28 21:07:00.205: W/dalvikvm(1084): threadid=1: thread exiting with uncaught exception (group=0xa6309288)
03-28 21:07:00.205: E/AndroidRuntime(1084): FATAL EXCEPTION: main
03-28 21:07:00.205: E/AndroidRuntime(1084): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.liverpoolpolls/com.example.liverpoolpolls.Loadhomemenu}: java.lang.IllegalArgumentException: No view found for id 0x7f050046 (com.example.liverpoolpolls:id/container) for fragment PlaceholderFragment{53576600 #0 id=0x7f050046}
03-28 21:07:00.205: E/AndroidRuntime(1084):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
03-28 21:07:00.205: E/AndroidRuntime(1084):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
03-28 21:07:00.205: E/AndroidRuntime(1084):     at android.app.ActivityThread.access$600(ActivityThread.java:130)
03-28 21:07:00.205: E/AndroidRuntime(1084):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
03-28 21:07:00.205: E/AndroidRuntime(1084):     at android.os.Handler.dispatchMessage(Handler.java:99)
03-28 21:07:00.205: E/AndroidRuntime(1084):     at android.os.Looper.loop(Looper.java:137)
03-28 21:07:00.205: E/AndroidRuntime(1084):     at android.app.ActivityThread.main(ActivityThread.java:4745)
03-28 21:07:00.205: E/AndroidRuntime(1084):     at java.lang.reflect.Method.invokeNative(Native Method)
03-28 21:07:00.205: E/AndroidRuntime(1084):     at java.lang.reflect.Method.invoke(Method.java:511)
03-28 21:07:00.205: E/AndroidRuntime(1084):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
03-28 21:07:00.205: E/AndroidRuntime(1084):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
03-28 21:07:00.205: E/AndroidRuntime(1084):     at dalvik.system.NativeStart.main(Native Method)
03-28 21:07:00.205: E/AndroidRuntime(1084): Caused by: java.lang.IllegalArgumentException: No view found for id 0x7f050046 (com.example.liverpoolpolls:id/container) for fragment PlaceholderFragment{53576600 #0 id=0x7f050046}
03-28 21:07:00.205: E/AndroidRuntime(1084):     at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:919)
03-28 21:07:00.205: E/AndroidRuntime(1084):     at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
03-28 21:07:00.205: E/AndroidRuntime(1084):     at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
03-28 21:07:00.205: E/AndroidRuntime(1084):     at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1467)
03-28 21:07:00.205: E/AndroidRuntime(1084):     at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:570)
03-28 21:07:00.205: E/AndroidRuntime(1084):     at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1163)
03-28 21:07:00.205: E/AndroidRuntime(1084):     at android.app.Activity.performStart(Activity.java:5018)
03-28 21:07:00.205: E/AndroidRuntime(1084):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2032)
03-28 21:07:00.205: E/AndroidRuntime(1084):     ... 11 more

感谢您的帮助!

编辑:

清单

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.liverpoolpolls"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="19" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/logo"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.example.liverpoolpolls.Loadhomemenu"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.example.liverpoolpolls.Navigatefromhomepage"
            android:label="@string/title_activity_navigatefromhomepage" >
        </activity>
        <activity
            android:name="com.example.liverpoolpolls.Loadingblogs"
            android:label="@string/title_activity_loadingblogs" >
        </activity>
        <activity
            android:name="com.example.liverpoolpolls.Loadingstatistics"
            android:label="@string/title_activity_loadingstatistics" >
        </activity>
        <activity
            android:name="com.example.liverpoolpolls.Loadingpolls"
            android:label="@string/title_activity_loadingpolls" >
        </activity>
        <activity
            android:name="com.example.liverpoolpolls.Loadingcontactus"
            android:label="@string/title_activity_loadingcontactus" >
        </activity>
    </application>

</manifest>

1 个答案:

答案 0 :(得分:0)

这是例外:

IllegalArgumentException: No view found for id 0x7f050046 (com.example.liverpoolpolls:id/container) for fragment PlaceholderFragment{53576600 #0 id=0x7f050046}

&#34; 找不到ID &#34;的视图,通常是由inflate()方法中的错误布局规范或活动的setContentView()引起的