java.lang.Package.getDeclaredAnnotations上未满足LinkError的极其简化的测试用例
为什么我会在一台计算机上出现这个错误?我已经创建了最简单、最短的测试用例,因此我可以将整个Android项目粘贴到下面:java.lang.Package.getDeclaredAnnotations上未满足LinkError的极其简化的测试用例,java,android,android-emulator,android-widget,unsatisfiedlinkerror,Java,Android,Android Emulator,Android Widget,Unsatisfiedlinkerror,为什么我会在一台计算机上出现这个错误?我已经创建了最简单、最短的测试用例,因此我可以将整个Android项目粘贴到下面: E/AndroidRuntime( 406): java.lang.UnsatisfiedLinkError: getDeclaredAnnotations E/AndroidRuntime( 406): at java.lang.Package.getDeclaredAnnotations(Native Method) E/AndroidRuntime( 406
E/AndroidRuntime( 406): java.lang.UnsatisfiedLinkError: getDeclaredAnnotations
E/AndroidRuntime( 406): at java.lang.Package.getDeclaredAnnotations(Native Method)
E/AndroidRuntime( 406): at java.lang.Package.getDeclaredAnnotations(Package.java:107)
E/AndroidRuntime( 406): at com.foobar.android.heartbeat.CustomAppWidgetProvider.onEnabled(CustomAppWidgetProvider.java:15)
E/AndroidRuntime( 406): at android.appwidget.AppWidgetProvider.onReceive(AppWidgetProvider.java:73)
1.AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.foobar.android.cannotate"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" />
<application>
<receiver android:name="com.foobar.android.cannotate.CustomAppWidgetProvider">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/custom_app_widget_provider_info" />
</receiver>
</application>
</manifest>
3.res/xml/custom\u app\u widget\u provider\u info.xml
<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:initialLayout="@layout/custom_app_widget"
>
</appwidget-provider>
4.res/layout/custom\u app\u widget.xml
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<TextView
android:id="@+id/value"
android:text="@string/empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</FrameLayout>
5.res/values/strings.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="empty">-</string>
</resources>
-
您看到的异常正在发生,因为运行平台上的运行时系统未实现包.getDeclaredAnnotations()的本机代码方法
据介绍,Davlik目前根本不支持包注释。例外情况就是一个症状
好了,除了避免使用包注释之外,您对此无能为力。(并动员您的亲朋好友投票支持修复该问题!)您看到的异常正在发生,因为您运行的平台上的运行时系统未实现
包.getDeclaredAnnotations()
的本机代码方法
据介绍,Davlik目前根本不支持包注释。例外情况就是一个症状
好了,除了避免使用包注释之外,您对此无能为力。(并动员您的亲朋好友投票支持解决问题!)谢谢。鉴于最近修复了返回空数组(每个链接)的问题,Android 4.x上不会发生这种情况吗?请注意,我不希望使用包注释,如果Android返回空数组,我很高兴。问题就在于爆炸,我想知道安卓4.x是否会爆炸?@agksmehx-我无法回答关于安卓4.x的问题。但是,如果您实际上不想使用该方法,也许您应该更改代码以删除调用…这是一个库,因此很难删除调用谢谢。鉴于最近修复了返回空数组(每个链接)的问题,Android 4.x上不会发生这种情况吗?请注意,我不希望使用包注释,如果Android返回空数组,我很高兴。问题就在于爆炸,我想知道安卓4.x是否会爆炸?@agksmehx-我无法回答关于安卓4.x的问题。但是如果您实际上不想使用该方法,也许您应该更改代码以删除调用…它是一个库,因此很难删除调用
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="empty">-</string>
</resources>