airsdk / Adobe-Runtime-Support

Report, track and discuss issues in Adobe AIR. Monitored by Adobe - and HARMAN - and maintained by the AIR community.
204 stars 11 forks source link

Old MyFlashLabs barcode ANE error with AIR 51.1 #3410

Open rdefalco opened 2 months ago

rdefalco commented 2 months ago

Hello, switching from AIR 50.2 to 51.1.1.3 caused us some issues with Android ANEs.

One issue (ALREADY SOLVED) was Distriqt Scanner that when compiled for targetsdk=34 launched the non-blocking error "One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts" but this has been SOLVED following the advice on their specific Github project (https://github.com/distriqt/ANE-Scanner/issues/76).

A different error arises with the old MyFlashLabs Barcode ANE that we also use to provide our customers with different ways to read barcodes. Even with targetsdk=33, if I switch from AIR 50.2 to 51.1.1.3 the camera does not open and I find the attached logcat. Switching back to AIR 50.2 works.

Of course we are aware this is an obsolete ANE and it's the last non-Distriqt ANE we are keeping for legacy reasons (occasional customers with some devices that report better/faster scanning), so we are ready to drop it if there is no solution.

--------- beginning of crash 08-14 18:04:52.710 21956 21956 E AndroidRuntime: FATAL EXCEPTION: main 08-14 18:04:52.710 21956 21956 E AndroidRuntime: Process: air.it.falcosoft.catalogo2, PID: 21956 08-14 18:04:52.710 21956 21956 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-14 18:04:52.710 21956 21956 E AndroidRuntime: at com.google.zxing.client.android.CaptureActivity.onCreate(CaptureActivity.java:139) 08-14 18:04:52.710 21956 21956 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:8975) 08-14 18:04:52.710 21956 21956 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:8944) 08-14 18:04:52.710 21956 21956 E AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1456) 08-14 18:04:52.710 21956 21956 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4146) 08-14 18:04:52.710 21956 21956 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4322) 08-14 18:04:52.710 21956 21956 E AndroidRuntime: at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103) 08-14 18:04:52.710 21956 21956 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:139) 08-14 18:04:52.710 21956 21956 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96) 08-14 18:04:52.710 21956 21956 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2685) 08-14 18:04:52.710 21956 21956 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106) 08-14 18:04:52.710 21956 21956 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:230) 08-14 18:04:52.710 21956 21956 E AndroidRuntime: at android.os.Looper.loop(Looper.java:319) 08-14 18:04:52.710 21956 21956 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:8919) 08-14 18:04:52.710 21956 21956 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 08-14 18:04:52.710 21956 21956 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578) 08-14 18:04:52.710 21956 21956 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103) 08-14 18:04:52.710 21956 21956 E AndroidRuntime: Caused by: android.content.res.Resources$NotFoundException: layout.com_doitflash_barcode_app_picker_list_item 08-14 18:04:52.710 21956 21956 E AndroidRuntime: at com.adobe.air.ResourceIdMap.getId(ResourceIdMap.java:95) 08-14 18:04:52.710 21956 21956 E AndroidRuntime: at com.adobe.fre.FREContext.getResourceId(Native Method) 08-14 18:04:52.710 21956 21956 E AndroidRuntime: at com.doitflash.barcode.resources.RRR$layout.(RRR.java:204) 08-14 18:04:52.710 21956 21956 E AndroidRuntime: ... 17 more 08-14 18:04:52.715 2456 22374 W ActivityManager: crash : air.it.falcosoft.catalogo2,10360 08-14 18:04:52.715 2456 5047 W ActivityTaskManager: Force finishing activity air.it.falcosoft.catalogo2/com.google.zxing.client.android.CaptureActivity 08-14 18:04:52.715 2456 5047 V Transition: allReady query: used=true, override=false, defer=0, states=Display{#0 state=ON size=904x2316 ROTATION_0}:false,Display{#1 state=OFF size=1812x2176 ROTATION_0}:true 08-14 18:04:52.716 2456 5047 V WindowManager: Collecting in transition 2549: ActivityRecord{dd5d2d2 u0 air.it.falcosoft.catalogo2/com.google.zxing.client.android.CaptureActivity t3675 f}}, caller=com.android.server.wm.Transition.collect:759 com.android.server.wm.Transition.collectExistenceChange:942 com.android.server.wm.TransitionController.collectExistenceChange:985 com.android.server.wm.TransitionController.requestCloseTransitionIfNeeded:923 com.android.server.wm.ActivityRecord.finishIfPossible:4311 08-14 18:04:52.716 2456 5047 V WindowManager: Collecting in transition 2549: ActivityRecord{dd5d2d2 u0 air.it.falcosoft.catalogo2/com.google.zxing.client.android.CaptureActivity t3675 f}}, caller=com.android.server.wm.Transition.collect:759 com.android.server.wm.TransitionController.collect:935 com.android.server.wm.ActivityRecord.setVisibility:6348 com.android.server.wm.ActivityRecord.setVisibility:6300 com.android.server.wm.ActivityRecord.finishIfPossible:4390

ajwfrost commented 2 months ago

I suspect this might be due to the packaging and compiling of resources within the ANE:

AndroidRuntime: Caused by: android.content.res.Resources$NotFoundException: layout.com_doitflash_barcode_app_picker_list_item
AndroidRuntime: at com.adobe.air.ResourceIdMap.getId(ResourceIdMap.java:95)
AndroidRuntime: at com.adobe.fre.FREContext.getResourceId(Native Method)

Not sure if you can find the resource mentioned there within the ANE? It might be possible to pull out the resources and add them in separately .. best bet might be if you can generate an "android-studio-debug" package, open that up in Android Studio and then you can hit 'debug' to get to the same state (i.e. exception in this method), and then hopefully you could find the relevant resources in the Android Studio project structure and move them so that they have the correct package name/location?

Bit tricky to know exactly what to suggest though without reproducing it here, hope that helps! please let us know :-)

thanks

rdefalco commented 2 months ago

I managed to create both the AndroidStudioProject folders built with AIR 51.1.1.3 and 50.2.4.5 with no changes except for the namespace 51.1 or 50.2 in the XML descriptor.

I don't have enough knowledge in Android Studio but checking the difference I notice that the file "com_doitflash_barcode_app_picker_list_item.xml" reaches the "packaged_res" folder

image

Also, the culprit layout seem to be present in the src directory both for version 50 and 51

image

The exception is thrown in the method ResourceIdMap.getId(String), inside this method the map "m_resourceIds" contains only 102 items, none of which seem related to the ANE. In comparison, halting the execution with the project built on AIR 50 the "m_resourceIds" map contains about 3700 key/item pairs.

This is m_resourceIds content when built with AIR51 "string.file_upload" -> {Integer@30611} 2131755129 "layout.expandable_multiple_chooser_row" -> {Integer@30613} 2131492918 "string.google_api_key" -> {Integer@30615} 2131755133 "id.NegativeButton" -> {Integer@30617} 2131296267 "string.file_save_as" -> {Integer@30619} 2131755128 "id.WarningImage" -> {Integer@30621} 2131296279 "drawable.mp_warning_32x32_n" -> {Integer@30623} 2131230870 "string.IDA_CURL_INTERFACE_OK" -> {Integer@30625} 2131755013 "id.CertDetailsScrollView" -> {Integer@30627} 2131296258 "id.filepath" -> {Integer@30629} 2131296477 "string.IDA_CURL_INTERFACE_CERTIFICATE_DETAILS_TITLE" -> {Integer@30631} 2131755010 "raw.debuginfo" -> {Integer@30633} 2131689495 "string.text_install_runtime" -> {Integer@30635} 2131755250 "id.empty" -> {Integer@30637} 2131296466 "string.button_cancel" -> {Integer@30639} 2131755060 "drawable.ic_adobe_logo" -> {Integer@30641} 2131230856 "string.text_runtime_on_external_storage" -> {Integer@30643} 2131755251 "raw.rgba8888" -> {Integer@30645} 2131689499 "id.file_save_button" -> {Integer@30647} 2131296471 "id.button_ok" -> {Integer@30649} 2131296389 "layout.main" -> {Integer@30651} 2131492924 "id.filename" -> {Integer@30653} 2131296476 "raw.adobelogo" -> {Integer@30655} 2131689472 "style.Theme_NoShadow" -> {Integer@30657} 2131820837 "string.IDA_CURL_INTERFACE_CNAME_MSG" -> {Integer@30659} 2131755011 "layout.ssl_certificate_warning" -> {Integer@30661} 2131492951 "string.IDA_CURL_INTERFACE_ALLSESS" -> {Integer@30663} 2131755009 "layout.splash_screen_layout" -> {Integer@30665} 2131492950 "id.Header" -> {Integer@30667} 2131296262 "string.firebase_database_url" -> {Integer@30669} 2131755130 "string.title_adobe_air" -> {Integer@30671} 2131755255 "string.text_gamepreview_loading_error" -> {Integer@30673} 2131755248 "id.file_save_name" -> {Integer@30675} 2131296473 "string.IDA_CURL_INTERFACE_VIEW_CERT" -> {Integer@30677} 2131755018 "string.app_name" -> {Integer@30679} 2131755048 "drawable.splash_landscape" -> {Integer@30681} 2131230886 "raw.debugger" -> {Integer@30682} 2131689494 "string.IDA_CURL_INTERFACE_UNVERSER_2" -> {Integer@30684} 2131755017 "string.audio_files" -> {Integer@30686} 2131755051 "string.empty_file_list" -> {Integer@30688} 2131755122 "drawable.ic_adobe_tm_logo" -> {Integer@30690} 2131230857 "string.text_install_gamepreview_app" -> {Integer@30692} 2131755249 "string.text_air_missing_text" -> {Integer@30694} 2131755245 "string.text_gamepreview_loading" -> {Integer@30696} 2131755247 "id.list" -> {Integer@30698} 2131296533 "string.google_storage_bucket" -> {Integer@30700} 2131755136 "id.ROW2" -> {Integer@30702} 2131296271 "id.ROW1" -> {Integer@30704} 2131296270 "id.filecheck" -> {Integer@30706} 2131296475 "drawable.ic_harman_logo" -> {Integer@30708} 2131230864 "mipmap.icon" -> {Integer@30710} 2131623936 "string.text_dont_show_again" -> {Integer@30712} 2131755246 "string.IDA_CURL_INTERFACE_NOSESS" -> {Integer@30714} 2131755012 "id.CertificateDetails" -> {Integer@30716} 2131296259 "string.video_files" -> {Integer@30718} 2131755257 "id.button_cancel" -> {Integer@30720} 2131296388 "raw.ss_cfg" -> {Integer@30722} 2131689500 "xml.provider_paths" -> {Integer@30724} 2131951624 "drawable.banner" -> {Integer@30726} 2131230808 "layout.expandable_chooser_row" -> {Integer@30728} 2131492917 "color.opaque_blue" -> {Integer@30730} 2131099747 "layout.activity_static_page" -> {Integer@30732} 2131492893 "id.Line2" -> {Integer@30734} 2131296264 "id.Line1" -> {Integer@30736} 2131296263 "drawable.splash_portrait" -> {Integer@30738} 2131230887 "string.gcm_defaultSenderId" -> {Integer@30740} 2131755132 "string.IDA_CURL_INTERFACE_TRUSTSER" -> {Integer@30742} 2131755016 "string.text_runtime_required" -> {Integer@30744} 2131755252 "string.IDA_CURL_INTERFACE_THISSESS" -> {Integer@30746} 2131755015 "id.adview" -> {Integer@30748} 2131296340 "raw.mms_cfg" -> {Integer@30750} 2131689498 "string.button_install" -> {Integer@30752} 2131755066 "string.google_app_id" -> {Integer@30754} 2131755134 "string.default_web_client_id" -> {Integer@30756} 2131755120 "string.button_install_air_from_playstore" -> {Integer@30758} 2131755067 "string.file_download" -> {Integer@30760} 2131755127 "string.google_crash_reporting_api_key" -> {Integer@30762} 2131755135 "id.PositiveButton" -> {Integer@30764} 2131296269 "mipmap.ouya_icon" -> {Integer@30766} 2131623937 "string.image_files" -> {Integer@30768} 2131755144 "raw.icon" -> {Integer@30770} 2131689497 "drawable.ouya_icon" -> {Integer@30772} 2131230883 "id.file_save_panel" -> {Integer@30774} 2131296474 "drawable.air_72px_mobile_eula" -> {Integer@30776} 2131230803 "drawable.home" -> {Integer@30778} 2131230855 "string.project_id" -> {Integer@30780} 2131755226 "drawable.icon" -> {Integer@30782} 2131230867 "string.IDA_CURL_SSL_SECURITY_WARNING" -> {Integer@30784} 2131755019 "raw.ss_sgn" -> {Integer@30786} 2131689501 "raw.startga" -> {Integer@30788} 2131689502 "string.text_air_missing_header" -> {Integer@30790} 2131755244 "id.ServerName" -> {Integer@30792} 2131296277 "string.IDA_CURL_INTERFACE_SERVER" -> {Integer@30794} 2131755014 "id.NeutralButton" -> {Integer@30796} 2131296268 "id.file_save_label" -> {Integer@30798} 2131296472 "string.button_ok" -> {Integer@30800} 2131755069 "layout.multiple_file_selection_panel" -> {Integer@30802} 2131492927 "string.app_version" -> {Integer@30804} 2131755050 "string.button_exit" -> {Integer@30806} 2131755064 "id.TrustQuestion" -> {Integer@30808} 2131296278 "string.IDA_CERTIFICATE_DETAILS" -> {Integer@30813} 2131755008 "id.Footer" -> {Integer@30815} 2131296261