Android resources with Facebook SDK 4.0
Hello,
I am trying out the latest Facebook SDK for Android to create an ANE but I have quickly run into issues with resources.
FacebookActivity class uses R.layout.com_facebook_activity_layout and R.id.com_facebook_fragment_container.
If I use the R.* mechanism then the application crashes with 'resource not found' exception,
if I use aneContext.getResourceId then it does not crash but outputs warnings
W/ResourceType﹕ getEntry failing because entryIndex 10 is beyond type entryCount 3
W/ResourceType﹕ Failure getting entry for 0x7f04000a (t=3 e=10) in package 0 (error -2147483647)
I use platform.xml to specify packaged resources. I have to say, I use the same ANE setup (ie. resources packaging) with Facebook SDK 3.23 and it works fine.
The new Facebook SDK works fine in native Android app but in ANE it seems to be failing in class FragmentManager so it basically cannot find the container view.
...
case Fragment.CREATED:
if (newState > Fragment.CREATED) {
if (DEBUG) Log.v(TAG, "moveto ACTIVITY_CREATED: " + f);
if (!f.mFromLayout) {
ViewGroup container = null;
if (f.mContainerId != 0) {
container = (ViewGroup)mContainer.findViewById(f.mContainerId);
if (container == null && !f.mRestored) {
throwException(new IllegalArgumentException(
"No view found for id 0x"
+ Integer.toHexString(f.mContainerId) + " ("
+ f.getResources().getResourceName(f.mContainerId)
+ ") for fragment " + f));
}
}
...
Any ideas that I could try to fix this?
