4
回答
android的程序启动就报错.好像是manifest文件的问题,高手帮忙看看.
利用AWS快速构建适用于生产的无服务器应用程序,免费试用12个月>>>   

运行报错信息如下:

05-14 08:26:48.834: D/AndroidRuntime(307): Shutting down VM
05-14 08:26:48.884: W/dalvikvm(307): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
05-14 08:26:48.904: E/AndroidRuntime(307): FATAL EXCEPTION: main
05-14 08:26:48.904: E/AndroidRuntime(307): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.cn.land/com.cn.land.LandActivity}: java.lang.NullPointerException
05-14 08:26:48.904: E/AndroidRuntime(307):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
05-14 08:26:48.904: E/AndroidRuntime(307):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
05-14 08:26:48.904: E/AndroidRuntime(307):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
05-14 08:26:48.904: E/AndroidRuntime(307):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
05-14 08:26:48.904: E/AndroidRuntime(307):  at android.os.Handler.dispatchMessage(Handler.java:99)
05-14 08:26:48.904: E/AndroidRuntime(307):  at android.os.Looper.loop(Looper.java:123)
05-14 08:26:48.904: E/AndroidRuntime(307):  at android.app.ActivityThread.main(ActivityThread.java:4627)
05-14 08:26:48.904: E/AndroidRuntime(307):  at java.lang.reflect.Method.invokeNative(Native Method)
05-14 08:26:48.904: E/AndroidRuntime(307):  at java.lang.reflect.Method.invoke(Method.java:521)
05-14 08:26:48.904: E/AndroidRuntime(307):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
05-14 08:26:48.904: E/AndroidRuntime(307):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
05-14 08:26:48.904: E/AndroidRuntime(307):  at dalvik.system.NativeStart.main(Native Method)
05-14 08:26:48.904: E/AndroidRuntime(307): Caused by: java.lang.NullPointerException
05-14 08:26:48.904: E/AndroidRuntime(307):  at android.app.Activity.findViewById(Activity.java:1637)
05-14 08:26:48.904: E/AndroidRuntime(307):  at com.cn.land.LandActivity.<init>(LandActivity.java:22)
05-14 08:26:48.904: E/AndroidRuntime(307):  at java.lang.Class.newInstanceImpl(Native Method)
05-14 08:26:48.904: E/AndroidRuntime(307):  at java.lang.Class.newInstance(Class.java:1429)
05-14 08:26:48.904: E/AndroidRuntime(307):  at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
05-14 08:26:48.904: E/AndroidRuntime(307):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
05-14 08:26:48.904: E/AndroidRuntime(307):  ... 11 more

manifest文件内容如下:

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

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

    <uses-permission android:name="android.permission.INTERNET" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <activity
            android:name=".LandActivity"
            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.renren.api.connect.android.AuthorizationHelper$BlockActivity"
            android:theme="@android :style/Theme.Dialog" >
        </activity>
    </application>

</manifest>

实在找不出错误,哪位高手能帮我看看,很着急啊.多谢了

举报
叶胜峰
发帖于6年前 4回/6K+阅
顶部