我有一个在 Android 6.0 (API 23) 上运行的工作应用程序,但是当我尝试在 Android 4.4 (API 19) 上运行它时,我在 PESDK.init 期间遇到了意外异常。我的项目中应该缺少一些东西,但我无法弄清楚发生了什么......
尝试在 OrientationSensor 类中调用 initSensor 方法时会生成错误,如下所示:
import ly.img.android.ui.utilities.OrientationSensor;
public static final String VERSION_NAME = "4.1.4"
private static void init() {
OrientationSensor.initSensor(PESDK.getAppContext());
}
异常日志消息是:
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at ly.img.android.a.a(Unknown Source)
at ly.img.android.PESDK.init(Unknown Source)
at my.app.MainApplication.onCreate(MainApplication.java:101)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NoClassDefFoundError: ly.img.android.ui.utilities.OrientationSensor
at ly.img.android.PESDKInit.init(PESDKInit.java:27)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at ly.img.android.a.a(Unknown Source)
at ly.img.android.PESDK.init(Unknown Source)
at my.app.MainApplication.onCreate(MainApplication.java:101)