简体   繁体   English

java.lang.RuntimeException:无法实例化活动

[英]java.lang.RuntimeException: Unable to instantiate activity

I got this error from some devices with Android 4.4 like Galaxy Tab3 8.0 (lt01wifi) if you have this tab,please reply. 如果您有此标签,我会从某些Android 4.4设备(例如Galaxy Tab3 8.0(lt01wifi))收到此错误,请回复。 The app works just fine on the rest of the devices. 该应用在其他设备上都可以正常运行。 Please help me! 请帮我! i'm having a lot of bad ratings.. 我的收视率很差。

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{aladin888.dessin/aladin888.dessin.Splash}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2208)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2340)
at android.app.ActivityThread.access$800(ActivityThread.java:157)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1247)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5293)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at android.app.Activity.setRequestedOrientation(Activity.java:4453)

And i can't figure out where's the issue. 而且我不知道问题出在哪里。 everything seems to be correct (to me) in my manifest.The activity in question is registred as you can see: 在我的清单中,一切似乎对我而言都是正确的。您可以看到,该活动已注册:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="aladin888.dessin"
    android:versionCode="10"
    android:versionName="1.9.0" >

    <supports-screens
        android:anyDensity="true"
        android:largeScreens="true"
        android:normalScreens="true"
        android:resizeable="true"
        android:smallScreens="true" />

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

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.INTERNET" />
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
    <uses-permission android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT"/>    


    <application
        android:icon="@drawable/icon"
        android:label="@string/app_name" >
        <activity
            android:name="aladin888.dessin.Splash"
            android:label="@string/app_name"
            android:exported="true"
            android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" 
            android:configChanges="keyboard|keyboardHidden|orientation">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="aladin888.dessin.EasyPaint"
            android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" >
            <intent-filter>

            </intent-filter>
        </activity>


    <activity android:name="com.google.ads.AdActivity"
              android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
   </application>

</manifest>

Thank you for your help Dawnkeeper! 感谢您对Dawnkeeper的帮助! but i'm still having the same issue, and i'm getting a lot bad ratings Any more ideas will be very appreciated!! 但是我仍然遇到同样的问题,而且我的收视率也很差。再多的想法将不胜感激!

You are referencing the package in the name 您以名称引用包

 android:name="aladin888.dessin.Splash"

should be 应该

android:name=".Splash"

edit 编辑

As we found out this isn't really the problem. 我们发现这并不是真正的问题。 Another hint is this: 另一个提示是:

Caused by: java.lang.NullPointerException
at android.app.Activity.setRequestedOrientation(Activity.java:4453)

I searched for a while, but could not find a android version that has this method at the given line. 我搜索了一段时间,但找不到在给定行具有此方法的android版本。 What I found out is that method has not changed in a while: 我发现该方法一段时间没有更改:

 public void setRequestedOrientation(int requestedOrientation) {
       if (mParent == null) {
           try {
                ActivityManagerNative.getDefault().setRequestedOrientation(
                        mToken, requestedOrientation);
            } catch (RemoteException e) {
                // Empty
            }
        } else {
            mParent.setRequestedOrientation(requestedOrientation);
        }
    }

The only chance I see for this failing is when the ActivityManagerNative.getDefault() returns null. 对于这种失败,我看到的唯一机会是当ActivityManagerNative.getDefault()返回null时。 I couldn't find anything helpful for this issue. 我找不到解决此问题的任何方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java.lang.RuntimeException:无法实例化活动 - java.lang.RuntimeException: Unable to instantiate activity java.lang.RuntimeException:无法实例化活动 - java.lang.RuntimeException: Unable to instantiate the activity java.lang.RuntimeException:无法实例化活动 - java.lang.RuntimeException:Unable to instantiate activity java.lang.RuntimeException:无法实例化活动 ComponentInfo - 不是搜索活动 - java.lang.RuntimeException: Unable to instantiate activity ComponentInfo - not search activity java.lang.RuntimeException:无法实例化活动ComponentInfo - NFC访问 - java.lang.RuntimeException: Unable to instantiate activity ComponentInfo - NFC access 错误:java.lang.RuntimeException:无法实例化活动 - Error: java.lang.RuntimeException: Unable to instantiate activity java.lang.RuntimeException:无法实例化活动错误 - java.lang.RuntimeException: Unable to instantiate activity error java.lang.RuntimeException:无法为 Kotlin MainActivity 实例化活动 ComponentInfo - java.lang.RuntimeException: Unable to instantiate activity ComponentInfo for Kotlin MainActivity 错误:java.lang.RuntimeException:无法实例化活动 - Error:java.lang.RuntimeException: Unable to instantiate activity java.lang.RuntimeException:无法在 Android Studio 中实例化活动 ComponentInfo - java.lang.RuntimeException: Unable to instantiate activity ComponentInfo in Android Studio
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM