0

启动我的应用程序时,我的 LogCat 充满了这个

06-11 23:51:51.635: E/AndroidRuntime(29950): FATAL EXCEPTION: main
06-11 23:51:51.635: E/AndroidRuntime(29950): java.lang.RuntimeException: Unable to instantiate application android.app.Application: java.lang.NullPointerException
06-11 23:51:51.635: E/AndroidRuntime(29950):    at android.app.LoadedApk.makeApplication(LoadedApk.java:501)
06-11 23:51:51.635: E/AndroidRuntime(29950):    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4201)
06-11 23:51:51.635: E/AndroidRuntime(29950):    at android.app.ActivityThread.access$1300(ActivityThread.java:140)
06-11 23:51:51.635: E/AndroidRuntime(29950):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1287)
06-11 23:51:51.635: E/AndroidRuntime(29950):    at android.os.Handler.dispatchMessage(Handler.java:99)
06-11 23:51:51.635: E/AndroidRuntime(29950):    at android.os.Looper.loop(Looper.java:137)
06-11 23:51:51.635: E/AndroidRuntime(29950):    at android.app.ActivityThread.main(ActivityThread.java:4898)
06-11 23:51:51.635: E/AndroidRuntime(29950):    at java.lang.reflect.Method.invokeNative(Native Method)
06-11 23:51:51.635: E/AndroidRuntime(29950):    at java.lang.reflect.Method.invoke(Method.java:511)
06-11 23:51:51.635: E/AndroidRuntime(29950):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
06-11 23:51:51.635: E/AndroidRuntime(29950):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
06-11 23:51:51.635: E/AndroidRuntime(29950):    at dalvik.system.NativeStart.main(Native Method)
06-11 23:51:51.635: E/AndroidRuntime(29950): Caused by: java.lang.NullPointerException
06-11 23:51:51.635: E/AndroidRuntime(29950):    at android.app.LoadedApk.initializeJavaContextClassLoader(LoadedApk.java:377)
06-11 23:51:51.635: E/AndroidRuntime(29950):    at android.app.LoadedApk.getClassLoader(LoadedApk.java:320)
06-11 23:51:51.635: E/AndroidRuntime(29950):    at android.app.LoadedApk.makeApplication(LoadedApk.java:493)
06-11 23:51:51.635: E/AndroidRuntime(29950):    ... 11 more

清单(添加清单,就像你问的那样)

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

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

    <uses-permission android:name="android.permission.CAMERA" />
    <uses-feature android:name="android.hardware.camera" />
    <uses-feature android:name="android.hardware.camera.autofocus" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="eu.hantaro.www.permission.MAPS_RECEIVE" />

    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true" />



    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/spui" >
        <activity
            android:name="eu.hantaro.www.SplashScreen"
            android:label="@string/app_name"
            android:screenOrientation="portrait" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

        <activity 
            android:name="eu.hantaro.www.FavoriteActivity"
            android:screenOrientation="portrait">            
        </activity>

        <activity 
            android:name="eu.hantaro.www.lightTimesActivity"
            android:screenOrientation="portrait">            
        </activity>

        <activity 
            android:name="eu.hantaro.www.MainActivity"
            android:screenOrientation="portrait">
        </activity>

        <activity 
            android:name="eu.hantaro.www.buildingDetailsActivity"
            android:screenOrientation="portrait">            
        </activity>


        <activity 
            android:name="eu.hantaro.www.SettingsActivity"
            android:screenOrientation="portrait">            
        </activity>

        <activity 
            android:name="eu.hantaro.www.SubbuildingActivity"
            android:screenOrientation="portrait">            
        </activity>

        <activity 
            android:name="eu.hantaro.www.Addbuilding"
            android:screenOrientation="portrait">            
        </activity>

        <activity 
            android:name="eu.hantaro.www.lightSettingsActivity"
            android:screenOrientation="portrait">            
        </activity>

        <activity 
            android:name="eu.hantaro.www.DirectionActivity"
            android:screenOrientation="portrait">            
        </activity>

        <activity 
            android:name="eu.hantaro.www.SearchAddressActivity"
            android:screenOrientation="portrait">            
        </activity>

        <activity 
            android:name="eu.hantaro.www.tutorialActivity"
            android:screenOrientation="portrait">            
        </activity>

          <activity 
            android:name="eu.hantaro.www.tutorialContentActivity"
            android:screenOrientation="portrait">            
        </activity>

         <activity 
            android:name="eu.hantaro.www.SharedPref"
            android:screenOrientation="portrait">            
        </activity>

          <activity 
            android:name="eu.hantaro.www.buildingList"
            android:screenOrientation="portrait">            
        </activity>


        <service android:name="eu.hantaro.www.lightTimeService" />
        <service android:name="eu.hantaro.www.NotificationF" />
        <service android:name="eu.hantaro.www.NotificationD" />
        <service android:name="eu.hantaro.www.NotificationA" />
        <service android:name="eu.hantaro.www.NotificationM" />
        <service android:name="eu.hantaro.www.NotificationI" />
        <service android:name="eu.hantaro.www.RingerModeSilent" />
        <service android:name="eu.hantaro.www.RingerModeNormal" />

        <uses-library android:name="com.google.android.maps" />
    </application>    
</manifest>

但应用程序不会崩溃,一切正常。我的 LogCat 扔给我的东西是什么意思?

4

1 回答 1

3

查看 ICS 源代码 - 似乎无论出于何种原因,包管理器都无法获取您的包信息 - 它可能只是一个 eclipse/ADT 错误,其中 eclipse 对文件持有某种锁定,但不管它是什么,它看起来不像是你的代码可能导致的事情。我建议运行一个干净的,从模拟器/设备上卸载应用程序,或者如果这些都不起作用,你可以尝试一个新的 eclipse 工作区。

另一件事可能是一个问题,如果您使用的是图书馆项目 - 尝试取消两者的链接,清理,然后再次链接它们 - 但这就是我的包 o' 技巧:)

于 2013-07-03T12:21:12.897 回答