Skip to main content
Oldes
Inspiring
January 29, 2018
Answered

Missing ANE resources when using AIR28

  • January 29, 2018
  • 1 reply
  • 624 views

Hello,

I was using own native extension to handle Android permissions made with AIR23 which is freely available on GitHub - Oldes/ANEAndroidPermissions: Adobe Native Extension (ANE) for Android to deal with new permissions system for A…

It was working quite well. But we noticed, that when used in app packed with AIR 28, there seems to be occasionally crashes related to missing resources (Caused by: android.content.res.Resources$NotFoundException) so I tried to update the ANE with the latest AIR and set the target SDK to version 25. This change is available there: GitHub - Oldes/ANEAndroidPermissions at AIR28

The problem is, that this new version crashes on my testing device with error:

01-29 23:13:10.091 7989-7989/com.amanitadesign.TestAndroidPermissions W/ResourceType: Bad XML block: header size 18254 or total size 169478669 is larger than data size 10687

01-29 23:13:10.092 7989-7989/com.amanitadesign.TestAndroidPermissions D/AndroidRuntime: Shutting down VM

01-29 23:13:10.094 7989-7989/com.amanitadesign.TestAndroidPermissions E/AndroidRuntime: FATAL EXCEPTION: main

    Process: com.amanitadesign.TestAndroidPermissions, PID: 7989

    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.amanitadesign.TestAndroidPermissions/com.amanitadesign.ane.PermissionsRequestActivity}: android.content.res.Resources$NotFoundException: File res/mipmap-xxhdpi-v4/icon.png from xml type layout resource ID #0x7f030000

        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2924)

        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2985)

        at android.app.ActivityThread.-wrap14(ActivityThread.java)

        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1635)

        at android.os.Handler.dispatchMessage(Handler.java:102)

        at android.os.Looper.loop(Looper.java:154)

        at android.app.ActivityThread.main(ActivityThread.java:6692)

        at java.lang.reflect.Method.invoke(Native Method)

        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)

        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)

     Caused by: android.content.res.Resources$NotFoundException: File res/mipmap-xxhdpi-v4/icon.png from xml type layout resource ID #0x7f030000

        at android.content.res.ResourcesImpl.loadXmlResourceParser(ResourcesImpl.java:1048)

        at android.content.res.Resources.loadXmlResourceParser(Resources.java:2970)

        at android.content.res.Resources.getLayout(Resources.java:1984)

        at android.view.LayoutInflater.inflate(LayoutInflater.java:425)

        at android.view.LayoutInflater.inflate(LayoutInflater.java:378)

        at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:439)

        at android.app.Activity.setContentView(Activity.java:2543)

        at com.amanitadesign.ane.PermissionsRequestActivity.onCreate(PermissionsRequestActivity.java:26)

        at android.app.Activity.performCreate(Activity.java:6912)

        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126)

        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2877)

        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2985)

        at android.app.ActivityThread.-wrap14(ActivityThread.java)

        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1635)

        at android.os.Handler.dispatchMessage(Handler.java:102)

        at android.os.Looper.loop(Looper.java:154)

        at android.app.ActivityThread.main(ActivityThread.java:6692)

        at java.lang.reflect.Method.invoke(Native Method)

        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)

        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)

     Caused by: java.io.FileNotFoundException: Corrupt XML binary file

        at android.content.res.AssetManager.openXmlAssetNative(Native Method)

        at android.content.res.AssetManager.openXmlBlockAsset(AssetManager.java:593)

        at android.content.res.ResourcesImpl.loadXmlResourceParser(ResourcesImpl.java:1029)

As in release notes for AIR28 is mentioned, that the tooling was upgraded and we should let you know about problems, I think this is just the right case.

The problem is on this line. When I don't try to use the custom layout to have the permission request "over" the application's content, it would work as expected, but I would like to have the content of the game visible under it as it was before.

Anything I can do to fix it myself?

Thanks,

David

PS:

this is how looks diff of unpacked app using AIR23 versus AIR28.0.0.125:

PPS:

adding the icon.png versions directly into ANE's resources does not help.. the crash and error message are still same.

This topic has been closed for replies.
Correct answer Oldes

Ok... so it looks the problem is more on the Android side and my poor knowledge of it. I was hacking hard and trying many ways.. and finally solved my issue not using the custom layout and setting the theme just in manifest using:

<activity android:name="com.amanitadesign.ane.PermissionsRequestActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />

Anyway... interesting how the original ANE version was working up to AIR25 (not tested with AIR26) and crashing with newer.

PS: the links to Github will not be linked to the versions I was using before as I modified both of them to current version which was tested successfully with AIR28.

1 reply

Oldes
OldesAuthorCorrect answer
Inspiring
January 30, 2018

Ok... so it looks the problem is more on the Android side and my poor knowledge of it. I was hacking hard and trying many ways.. and finally solved my issue not using the custom layout and setting the theme just in manifest using:

<activity android:name="com.amanitadesign.ane.PermissionsRequestActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />

Anyway... interesting how the original ANE version was working up to AIR25 (not tested with AIR26) and crashing with newer.

PS: the links to Github will not be linked to the versions I was using before as I modified both of them to current version which was tested successfully with AIR28.