Activity Not Found Exception for Camera App

// Expert user has replied. //Solved
C Christoforos Vlachos 1 year 5 months ago
171 5 1

Hi everyone,

I have developed an industrial android app using kotlin. The app needs to launch the camera multiple times, it does so using this code :

 

val cameraIntent = Intent(MediaStore.ACTION_IMAGE_CAPTURE).apply {
    addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
    addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION)
    putExtra(MediaStore.EXTRA_OUTPUT, photoUri)
}
startActivityForResult(
    cameraIntent,
    this@ExtraDieukrinhseisDeltiou.REQUEST_CODE_CAMERA
)

I have also installed the "Enterprise Home Screen" (version 4.2.40) on the devices. The devices are MC2700 & TC26 and the OS is Android 11.  Everything works as expected in the beginning but, after 2-3weeks of the application running in the field I found out (using the RxLogger) that I get an "ActivityNotFound" exception when I try to launch the camera using the above code

I also noticed from the devices in the field that they were unlocked and the  "Enterprise Home Screen" app was misbehaving

If I uninstall and re-install the "Enterprise Home Screen" then the camera app is launched successfully again. But after 2-3 weeks the same thing happens again. 

I know this is a very weird behavior and I cannot understand why this happens. Is this some known issue by now ? What do you think I should check to identify and solve this problem. Any help or idea is greatly appreciated since I am stuck.

Thank you in advance,

Chris

 

Please Register or Login to post a reply

Accepted Solution

C Christoforos Vlachos

Hello Daniel,

Your initial assumption was indeed accurate. I'm unsure of the exact cause of the issue, but I managed to resolve it by modifying my configuration in the EHS. The problem seemed to stem from the fact that I had disabled certain Google applications within my configuration, as listed below:

<apps_disabled>
<application package="com.android.contacts"/>
<application package="com.android.mms"/>
<application package="com.android.soundrecorder"/>
<application package="org.codeaurora.dialer"/>
<application package="com.google.android.apps.photos"/>
<application package="com.google.android.apps.maps"/>
<application package="com.android.chrome"/>
<application package="com.google.android.gm"/>
<application package="com.google.android.apps.docs"/>
<application package="com.android.vending"/>
<application package="com.google.android.videos"/>
<application package="com.google.android.apps.tachyon"/>
<application package="com.google.android.apps.messaging"/>
<application package="com.google.android.youtube"/>
<application package="com.google.android.apps.youtube.music"/>
<application package="com.google.android.calendar"/>
</apps_disabled>

Upon re-enabling all of these applications, the issue was successfully resolved.

Best regards,

Chris

5 Replies

D Daniel Neamtu

Hi Chris,

Are the devices under an EMM?

You should check whether someone plays with the EHS and if the camera app has been mistakenly disabled.

This is not something coming from us, it's purely a misconfiguration here.

Daniel

C Christoforos Vlachos

Hello Daniel, 

Thank you very much for your response. The devices are not under an EMM and also they do not have wifi or mobile data enabled (this is a request from our client).  The only way for someone to play with the EHS is if they have the administrator code which I am pretty sure they do not. 

Below I provide link which demostrates this behavior. 

https://drive.google.com/file/d/1Y2gvtBnX8nonp_Wo8J6wpnqe-xyugnjj/view?usp=sharing

The device that you see in the video is one of our test devices (not a client's device). This specific device was stored and was inactivefor about one month. Today I re-opened the device to perform some tests and, as you can see in the video, the EHS was not automatically launched and also the camera app was disabled (observe that there is no icon of the camera app at 0:15 of the video). 

Afterwards, in the video, I open our application and when I try to launch the camera the app crashes (0:36 in video - this is the ActivityNotFound exception that I saw using the RxLogger).

At 0:42 I relaunch the EHS and after that everything works fine - the camera was re-enabled and our application was working as expected. 

For your reference, I am also sharing the contents of the EHS configuration file. Please review it and let me know if you notice anything unusual.

<?xml version="1.0" encoding="UTF-8"?><config>
  <kiosk>
    <application label="Καταμέτρηση" package="com.chris.mciydro" activity="com.chris.mciydro.MainActivity"/>
  </kiosk>
  <applications>
    <application label="Καταμέτρηση" package="com.chris.mciydro" activity="com.chris.mciydro.MainActivity"/>
  </applications>
  <tools>
    <application label="Καταμέτρηση" package="com.chris.mciydro" activity="com.chris.mciydro.MainActivity"/>
  </tools>
  <passwords>
    <admin attempts="1">jDt1n+SY4UQozA9FygYPKcthE5/KOnTivNFi8GY/mls=aQhEJJCJuYrijkdAvLoPhFeP2KbHa1qcGPKzycozE/M=</admin>
  </passwords>
  <user_options>
    <icon_settings>
      <app_icon_size>M</app_icon_size>
    </icon_settings>
  </user_options>
  <preferences>
    <admin_inactivity_timeout>120</admin_inactivity_timeout>
    <orientation>portrait</orientation>
    <wallpaper/>
    <usb_debugging_disabled>0</usb_debugging_disabled>
    <icon_label_text_color>#FFFFFFFF</icon_label_text_color>
    <auto_launch_enable>0</auto_launch_enable>
    <service_auto_launch_enable>0</service_auto_launch_enable>
    <keyguard_search_disabled>1</keyguard_search_disabled>
    <admin_max_attempts>20</admin_max_attempts>
    <system_settings_restricted>1</system_settings_restricted>
    <icon_label_background_color>#00FFFFFF</icon_label_background_color>
    <fullscreen>0</fullscreen>
    <keyguard_camera_disabled>1</keyguard_camera_disabled>
    <kiosk_mode_enabled>0</kiosk_mode_enabled>
    <title>
      <value>[serial_number]</value>
    </title>
    <title_bar_icon>
      <title_bar_icon_disabled>0</title_bar_icon_disabled>
    </title_bar_icon>
    <configurable_user_options>
      <app_icon_settings_disabled>1</app_icon_settings_disabled>
    </configurable_user_options>
    <admin_lock_out>
      <recovery_enabled>0</recovery_enabled>
    </admin_lock_out>
    <screen_blanking>
      <blanking_enabled>0</blanking_enabled>
      <speed_threshold>10</speed_threshold>
      <blanking_mode>1</blanking_mode>
    </screen_blanking>
    <apps_disabled>
      <application package="com.android.contacts"/>
      <application package="com.android.mms"/>
      <application package="com.android.soundrecorder"/>
      <application package="org.codeaurora.dialer"/>
      <application package="com.google.android.apps.photos"/>
      <application package="com.google.android.apps.maps"/>
      <application package="com.android.chrome"/>
      <application package="com.google.android.gm"/>
      <application package="com.google.android.apps.docs"/>
      <application package="com.android.vending"/>
      <application package="com.google.android.videos"/>
      <application package="com.google.android.apps.tachyon"/>
      <application package="com.google.android.apps.messaging"/>
      <application package="com.google.android.youtube"/>
      <application package="com.google.android.apps.youtube.music"/>
      <application package="com.google.android.calendar"/>
    </apps_disabled>
    <apps_enabled>
      <application package="com.android.documentsui"/>
      <application package="com.mci.ergolavia"/>
      <application package="com.android.deskclock"/>
      <application package="com.android.settings"/>
      <application package="com.zebra.bluetooth.settings"/>
      <application package="com.symbol.dataanalytics"/>
      <application package="com.symbol.zebravolumecontrol"/>
      <application package="com.zebra.smartmu.app"/>
      <application package="com.symbol.vod"/>
      <application package="com.symbol.tool.stagenow"/>
      <application package="com.symbol.rxlogger"/>
      <application package="com.symbol.pttexpress"/>
      <application package="com.zebra.ppcclient"/>
      <application package="com.google.android.googlequicksearchbox"/>
      <application package="com.zebra.devicetracker"/>
      <application package="com.symbol.datawedge"/>
      <application package="com.symbol.fusionlogger"/>
      <application package="org.codeaurora.snapcam"/>
      <application package="com.symbol.batterymanager"/>
      <application package="com.symbol.fusionsettings"/>
      <application package="com.google.android.keep"/>
      <application package="com.android.inputmethod.latin"/>
      <application package="com.android.traceur"/>
      <application package="com.google.android.calculator"/>
      <application package="com.symbol.btapp"/>
      <application package="com.displaylink.presenter"/>
      <application package="com.symbol.mxmf.csp.enterprisekeyboard"/>
      <application package="com.zebra.licenseuiapp"/>
      <application package="com.qualcomm.qti.qms.service.telemetry"/>
    </apps_enabled>
  </preferences>
</config>

Any suggestion is greatly appreciated. Thank you in advance.

Chris

D Daniel Neamtu

Hi Chris,

I see you've registered for our DevKitchen event which will be next week in Athene.

I'll be there because I'm among the presenters and I think it would be great if you could bring the device with you so we can better check the issue!

I've also tested your configuration on my device but as much as I tried with different configurations I couldn't reproduce the issue where the camera app was disappearing from the list of apps.

Maybe on-site we can figure it out something :)

Regards,

Daniel 

C Christoforos Vlachos

Hello Daniel,

I hope you're having a good morning. I wanted to let you know that I think your idea is fantastic, and I appreciate it very much. I'll make an effort to replicate the issue myself, or I'll try to obtain a device from our client that exhibits this problem (unfortunately, the device shown in the video is now functioning properly). I look forward to meeting you at the DevKitchen event.

Bestregards,

Chris

C Christoforos Vlachos

Hello Daniel,

Your initial assumption was indeed accurate. I'm unsure of the exact cause of the issue, but I managed to resolve it by modifying my configuration in the EHS. The problem seemed to stem from the fact that I had disabled certain Google applications within my configuration, as listed below:

<apps_disabled>
<application package="com.android.contacts"/>
<application package="com.android.mms"/>
<application package="com.android.soundrecorder"/>
<application package="org.codeaurora.dialer"/>
<application package="com.google.android.apps.photos"/>
<application package="com.google.android.apps.maps"/>
<application package="com.android.chrome"/>
<application package="com.google.android.gm"/>
<application package="com.google.android.apps.docs"/>
<application package="com.android.vending"/>
<application package="com.google.android.videos"/>
<application package="com.google.android.apps.tachyon"/>
<application package="com.google.android.apps.messaging"/>
<application package="com.google.android.youtube"/>
<application package="com.google.android.apps.youtube.music"/>
<application package="com.google.android.calendar"/>
</apps_disabled>

Upon re-enabling all of these applications, the issue was successfully resolved.

Best regards,

Chris

CONTACT
Can’t find what you’re looking for?