Skip to content

java.lang.IllegalStateException: TrustKit has already been initialized #21

Closed

Description

@evollu

When app is closed though "back" button and resume, onCreate will be called again.
If I put TrustKit.initializeWithNetworkSecurityConfiguration inside onCreate as readme shows it throws TrustKit has already been initialized error.

shall I add a try catch around it to avoid the crash?

Activity

  1. jobot0 commented on Sep 12, 2017

    @jobot0
    Contributor

    Hey @evollu are you calling Trustkit. initializeWithNetworkSecurityConfiguration in the onCreate of your app or an activity? It should work if you use it inside the one of your application.

    public class MyApp extends Application {
      @Override
      public void onCreate() {
        Trustkit.initializeWithNetworkSecurityConfiguration(this);
      }
    }
  2. evollu commented on Sep 12, 2017

    @evollu
    Author

    ah I'm calling it in Activity.

  3. Lynnette1 commented on May 24, 2019

    @Lynnette1

    Can you clarify this statement.

    Hey @evollu are you calling Trustkit. initializeWithNetworkSecurityConfiguration in the onCreate of your app or an activity? It should work if you use it inside the one of your application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions