Tekno
Tekno

Reputation: 193

Android deployed App unable to instantiate application

I have this strange error I do not know how to resolve. I test my App deployed straight to my phone and it's working ok. But now testing downloading from Play Store the app crash as startup and the error is this one:

java.lang.RuntimeException: Unable to instantiate application com.bookit.android.BookItApp: java.lang.ClassNotFoundException: com.bookit.android.BookItApp

I have this class:

package com.bookit.android;

public class BookItApp extends Application {...}

My manifest I think it's ok defining the App class:

< application android:name="BookItApp"

Or Maybe should I define:

android:name = "com.bookit.android.BookItApp"

UPDATE: this is my proguard-project.txt

I don't know if it's ok.

-keep class * extends java.util.ListResourceBundle {
protected Object[][] getContents();
}

-keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
public static final *** NULL;
}

-keepnames @com.google.android.gms.common.annotation.KeepName class *
-keepclassmembernames class * {
@com.google.android.gms.common.annotation.KeepName *;
}

-keepnames class * implements android.os.Parcelable {
public static final ** CREATOR;

Upvotes: 3

Views: 936

Answers (2)

qluan
qluan

Reputation: 94

The error says that “java.lang.ClassNotFoundException: com.bookit.android.BookItApp”, so the definition is fine

You can unzip the apk to find "com.bookit.android.BookItApp", if it's missing ,maybe caused by packging.

PS:Does it occurrs always?

Upvotes: 0

Marcel Krivek
Marcel Krivek

Reputation: 167

Exactly like you said, you should define it like this

<application 
           android:name="com.bookit.android.BookItApp"
           ...
           ...
           >

Upvotes: 2

Related Questions