我有一个免费的Android应用程序,我正在尝试创建付费版本。我正试图在我的设备上测试它,当我第一次在手机上打开应用程序时,我一直收到此崩溃日志:
10-25 12:33:26.325: E/AndroidRuntime(18061): java.lang.Error: Unresolved compilation problems:
10-25 12:33:26.325: E/AndroidRuntime(18061): The import android.app cannot be resolved
10-25 12:33:26.325: E/AndroidRuntime(18061): Application cannot be resolved to a type
10-25 12:33:26.325: E/AndroidRuntime(18061): Override cannot be resolved to a type
10-25 12:33:26.325: E/AndroidRuntime(18061): The type android.app.Application cannot be resolved. It is indirectly referenced from required .class files
10-25 12:33:26.325: E/AndroidRuntime(18061): The method init(Application) from the type ACRA refers to the missing type Application
10-25 12:33:26.325: E/AndroidRuntime(18061): Application cannot be resolved to a type
10-25 12:33:26.325: E/AndroidRuntime(18061): at business.premium.MyApplication.<init>(MyApplication.java:3)
10-25 12:33:26.325: E/AndroidRuntime(18061): at java.lang.Class.newInstanceImpl(Native Method)
10-25 12:33:26.325: E/AndroidRuntime(18061): at java.lang.Class.newInstance(Class.java:1409)
10-25 12:33:26.325: E/AndroidRuntime(18061): at android.app.Instrumentation.newApplication(Instrumentation.java:966)
有谁知道为什么会发生这种情况以及如何解决这个问题?
谢谢!
编辑:
这是我的整个MyApplication.java
package business.premium;
import android.app.Application;
import org.acra.*;
import org.acra.annotation.*;
@ReportsCrashes(formKey = "my_key")
public class MyApplication extends Application
{
@Override
public void onCreate()
{
// The following line triggers the initialization of ACRA
ACRA.init(this);
super.onCreate();
}
}