java. Lang. IllegalStateException: assetmanager completed

I went to bed yesterday while my application was working, and today I couldn't start when I tried to run it Once I try to open it, crash with Java lang.IllegalStateException. I have submitted several submissions in my code just to rule out that this is something I have done recently This doesn't make any sense. How can the application stop working overnight? I look for mistakes on the Internet and don't have much useful information Is this really a strange mistake?

This is the complete stack trace:

Because I said it didn't seem to be anything I did, I didn't know what code to release However, considering that the application crashes here, these are the two main classes of code that should be started first:

application

public class App extends Application {

  private static App instance;
  private static final String TAG = "Starter";

  @Override
  public void onCreate() {
    super.onCreate();

    instance = this;
    // Enable Local Datastore.
    Parse.enableLocalDatastore(this);

    //TODO: Register subclasses
//    ParSEObject.registerSubclass(Challenge.class);

    //Parse server
    Log.d(TAG,"Initializing Parse");
    Parse.initialize(new Parse.Configuration.Builder(this)
            .applicationId(getString(R.string.parse_app_id))
            .clientKey(getString(R.string.parse_client_key))
            .server(getString(R.string.server_address)).build()
    );

    //Facebook
    if (AccessToken.getCurrentAccessToken() == null)
      ParseFacebookUtils.initialize(this);

    ParseUser.enableAutomaticUser();
    ParseACL defaultACL = new ParseACL();
    // Optionally enable public read access.
    defaultACL.setPublicReadAccess(true);
    defaultACL.setPublicWriteAccess(true);
    ParseACL.setDefaultACL(defaultACL,true);
    Log.d(TAG,"Parse ready");
  }

  public static App getInstance(){
    return instance;
  }
}

SplashActivity

public class SplashActivity extends AppCompatActivity {

    private static final String TAG = "Splash";
    private boolean firstTime = true;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // Hide title bar
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_splash);

        firstTime = getSharedPreferences(Constants.GENERAL_SHARED_PREFS,MODE_PRIVATE)
                .getBoolean(Constants.FIRSTTIME,true);


        if (isLoggedIn())
            if (firstTime)
                startActivity(new Intent(SplashActivity.this,FirstTimeActivity.class));
            else
                startActivity(new Intent(SplashActivity.this,MenuActivity.class));

        else {
            Log.d(TAG,"Calling Home");
            startActivity(new Intent(SplashActivity.this,WelcomeActivity.class));
            finish();
        }
    }

    @Override
    protected void onResume() {
        super.onResume();
    }

    @Override
    protected void onPause() {
        super.onPause();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }

    public boolean isLoggedIn() {
        AccessToken accessToken = AccessToken.getCurrentAccessToken();
        String parseSession = ParseUser.getCurrentUser().getSessionToken();
        return parseSession != null;
    }
}

Solution

Your stacktrace links to this class in AOSP

I think this crash has nothing to do with your application, but as an error in the launcher class Try debugging the installation from USB to see if it works

But some details are still blurred These lines (from the bottom to the top of stacktrace) lead to com android. Line with problem in launcher2 package:

https://android.googlesource.com/platform/packages/apps/Launcher2/ +/android-4.2. 2_ r1/src/com/android/launcher2/AppsCustomizePagedView. java#584

https://android.googlesource.com/platform/packages/apps/Launcher2/ +/master/src/com/android/launcher2/Launcher. java#2469

https://android.googlesource.com/platform/packages/apps/Launcher2/ +/master/src/com/android/launcher2/Launcher. java#2442

From this error, I assume that you are using nexus or pixel (or any device with unchanged source code, which means stock Android.)

As I can see from this error, this is not an error related to your application It seems to be related to the initiator you are using Try debugging the installation from USB, or change the initiator to see if it works Try restarting the device

In addition, according to my opinion of your code, there is no available Parcelable class

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>