我正在开发一个使用Facebook-SDKv3的
Android-App,所以我在strings.xml中创建了一个条目:
<resources> <string name="facebook_app_id">"12345678910"</string> </resources>
<application> ... <Meta-data android:name="com.facebook.sdk.ApplicationId" android:resource="@string/facebook_app_id" /> </application>
我总是得到这个例外:
02-06 16:35:01.231: W/Bundle(8316): Key com.facebook.sdk.ApplicationId expected String but value was a java.lang.Integer. The default value was returned.
02-06 16:35:01.231: W/Bundle(8316): Attempt to cast generated internal exception:
02-06 16:35:01.231: W/Bundle(8316): java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
02-06 16:35:01.231: W/Bundle(8316): at android.os.Bundle.getString(Bundle.java:1061)
02-06 16:35:01.231: W/Bundle(8316): at com.facebook.internal.Utility.getMetadataApplicationId(Utility.java:159)
我已经尝试将数字放入“”但这并没有解决问题,希望有人可以帮助我.
解决方法
将它从android:resource更改为android:value