我有一个在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)
答案 0 :(得分:0)
这些似乎与您的" proguard-rules"有关。 请检查您的设置,方向传感器不应被proguard删除,因为它在代码中明确引用。
请同时考虑更新至v5.0.15