Hybrid app crashing in Android studio with error:

2019-01-29 04:01发布

问题:

I am a little new to Android Studio and hybrid application building suing cordova.

I am trying to build a Salesforce hybrid app in Android Studio.

The project gets cleaned and builds successfully without any errors.

But, while installing the APK to emulator it gives an error that

Session 'android': Error Launching activity

In the Emulator it says:

Unfortunately, app has stopped

My stack trace is as below:

09-20 01:44:34.430 7462-9492/? W/AudioFlinger: RecordThread: buffer overflow
09-20 01:44:43.439 8337-9329/com.google.android.googlequicksearchbox:search W/TRThreadPoolExecutor: Queue length for executor GrecoExecutor with 1 threads is now 8. Perhaps some tasks are too long, or the pool is too small.
09-20 01:45:17.627 7462-9492/? W/AudioFlinger: RecordThread: buffer overflow
09-20 01:46:01.058 7462-9492/? W/AudioFlinger: RecordThread: buffer overflow
09-20 01:46:29.330 7462-9492/? W/AudioFlinger: RecordThread: buffer overflow
09-20 01:46:47.516 7462-9492/? W/AudioFlinger: RecordThread: buffer overflow
09-20 01:46:47.846 8337-9329/com.google.android.googlequicksearchbox:search W/TRThreadPoolExecutor: Queue length for executor GrecoExecutor with 1 threads is now 8. Perhaps some tasks are too long, or the pool is too small.
09-20 01:46:48.319 8337-9489/com.google.android.googlequicksearchbox:search I/MicrophoneInputStream: mic_close com.google.android.apps.gsa.speech.audio.u@336e7b1
09-20 01:46:48.323 8337-8500/com.google.android.googlequicksearchbox:search W/ErrorReporter: reportError [type: 211, code: 786434]: Error reading from input stream.
09-20 01:46:48.324 8337-8500/com.google.android.googlequicksearchbox:search W/ErrorProcessor: onFatalError, ignoring error from engine(3): com.google.android.apps.gsa.shared.speech.a.h: Error reading from input stream.
09-20 01:46:48.325 8337-9329/com.google.android.googlequicksearchbox:search W/TRThreadPoolExecutor: Task c[startRecognition] took 318737ms, which is over the 300000ms threshold
09-20 01:46:48.406 8337-9490/com.google.android.googlequicksearchbox:search I/HotwordRecognitionRnr: Hotword detection finished
09-20 01:46:48.408 8337-8500/com.google.android.googlequicksearchbox:search W/ErrorReporter: reportError [type: 211, code: 524300]: Error at processing input stream
09-20 01:46:48.422 8337-8504/com.google.android.googlequicksearchbox:search I/HotwordRecognitionRnr: Stopping hotword detection.
09-20 01:46:48.422 8337-8500/com.google.android.googlequicksearchbox:search W/ErrorProcessor: onFatalError, processing error from engine(4)
                                                                                              com.google.android.apps.gsa.shared.speech.a.g: Error at processing input stream
                                                                                                  at com.google.android.search.core.hotword.l.bsw(HotwordRecognitionRunner.java:166)
                                                                                                  at com.google.android.search.core.hotword.l$1.run(HotwordRecognitionRunner.java:138)
                                                                                                  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
                                                                                                  at java.util.concurrent.FutureTask.run(FutureTask.java:237)
                                                                                                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
                                                                                                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
                                                                                                  at java.lang.Thread.run(Thread.java:818)
                                                                                                  at com.google.android.apps.gsa.shared.util.c.a.l$1.run(GsaThreadFactory.java:99)
                                                                                               Caused by: com.google.android.apps.gsa.shared.api.io.GsaIOException: Error code: 393238 | Buffer overflow, no available space.
                                                                                                  at com.google.android.apps.gsa.speech.audio.Tee.aHz(Tee.java:474)
                                                                                                  at com.google.android.apps.gsa.speech.audio.Tee.k(Tee.java:301)
                                                                                                  at com.google.android.apps.gsa.speech.audio.ad.read(Tee.java:503)
                                                                                                  at java.io.InputStream.read(InputStream.java:162)
                                                                                                  at com.google.android.apps.gsa.speech.audio.z.run(MultipleReaderAudioSource.java:206)
09-20 01:46:48.545 8337-8337/com.google.android.googlequicksearchbox:search I/HotwordWorker: #onError(false)
09-20 01:46:53.715 8337-9505/com.google.android.googlequicksearchbox:search I/MicrophoneInputStream: mic_starting com.google.android.apps.gsa.speech.audio.u@eae2893
09-20 01:46:53.718 7462-7783/? E/audio_hw_generic: Error opening input stream format 1, channel_mask 0010, sample_rate 16000
09-20 01:46:53.726 7462-9507/? I/AudioFlinger: AudioFlinger's thread 0xf39c0000 ready to run
09-20 01:46:53.783 8337-9505/com.google.android.googlequicksearchbox:search I/MicrophoneInputStream: mic_started com.google.android.apps.gsa.speech.audio.u@eae2893
09-20 01:46:53.788 8337-9508/com.google.android.googlequicksearchbox:search I/HotwordRecognitionRnr: Starting hotword detection.
09-20 01:46:53.791 8337-8337/com.google.android.googlequicksearchbox:search I/HotwordWorker: onReady
09-20 01:47:11.373 7724-7740/system_process E/BluetoothAdapter: Bluetooth binder is null

                                                                --------- beginning of system
09-20 01:47:11.377 7724-7740/system_process E/KernelCpuSpeedReader: Failed to read cpu-freq
                                                                    java.io.FileNotFoundException: /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state: open failed: ENOENT (No such file or directory)
                                                                        at libcore.io.IoBridge.open(IoBridge.java:452)
                                                                        at java.io.FileInputStream.<init>(FileInputStream.java:76)
                                                                        at java.io.FileInputStream.<init>(FileInputStream.java:103)
                                                                        at java.io.FileReader.<init>(FileReader.java:66)
                                                                        at com.android.internal.os.KernelCpuSpeedReader.readDelta(KernelCpuSpeedReader.java:49)
                                                                        at com.android.internal.os.BatteryStatsImpl.updateCpuTimeLocked(BatteryStatsImpl.java:8002)
                                                                        at com.android.server.am.BatteryStatsService.updateExternalStats(BatteryStatsService.java:1366)
                                                                        at com.android.server.am.BatteryStatsService$BatteryStatsHandler.handleMessage(BatteryStatsService.java:125)
                                                                        at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                        at android.os.Looper.loop(Looper.java:148)
                                                                        at android.os.HandlerThread.run(HandlerThread.java:61)
                                                                        at com.android.server.ServiceThread.run(ServiceThread.java:46)
                                                                     Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
                                                                        at libcore.io.Posix.open(Native Method)
                                                                        at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
                                                                        at libcore.io.IoBridge.open(IoBridge.java:438)
                                                                        at java.io.FileInputStream.<init>(FileInputStream.java:76) 
                                                                        at java.io.FileInputStream.<init>(FileInputStream.java:103) 
                                                                        at java.io.FileReader.<init>(FileReader.java:66) 
                                                                        at com.android.internal.os.KernelCpuSpeedReader.readDelta(KernelCpuSpeedReader.java:49) 
                                                                        at com.android.internal.os.BatteryStatsImpl.updateCpuTimeLocked(BatteryStatsImpl.java:8002) 
                                                                        at com.android.server.am.BatteryStatsService.updateExternalStats(BatteryStatsService.java:1366) 
                                                                        at com.android.server.am.BatteryStatsService$BatteryStatsHandler.handleMessage(BatteryStatsService.java:125) 
                                                                        at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                        at android.os.Looper.loop(Looper.java:148) 
                                                                        at android.os.HandlerThread.run(HandlerThread.java:61) 
                                                                        at com.android.server.ServiceThread.run(ServiceThread.java:46) 
09-20 01:47:11.378 7724-7740/system_process E/KernelUidCpuTimeReader: Failed to read uid_cputime
                                                                      java.io.FileNotFoundException: /proc/uid_cputime/show_uid_stat: open failed: ENOENT (No such file or directory)
                                                                          at libcore.io.IoBridge.open(IoBridge.java:452)
                                                                          at java.io.FileInputStream.<init>(FileInputStream.java:76)
                                                                          at java.io.FileInputStream.<init>(FileInputStream.java:103)
                                                                          at java.io.FileReader.<init>(FileReader.java:66)
                                                                          at com.android.internal.os.KernelUidCpuTimeReader.readDelta(KernelUidCpuTimeReader.java:71)
                                                                          at com.android.internal.os.BatteryStatsImpl.updateCpuTimeLocked(BatteryStatsImpl.java:8031)
                                                                          at com.android.server.am.BatteryStatsService.updateExternalStats(BatteryStatsService.java:1366)
                                                                          at com.android.server.am.BatteryStatsService$BatteryStatsHandler.handleMessage(BatteryStatsService.java:125)
                                                                          at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                          at android.os.Looper.loop(Looper.java:148)
                                                                          at android.os.HandlerThread.run(HandlerThread.java:61)
                                                                          at com.android.server.ServiceThread.run(ServiceThread.java:46)
                                                                       Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
                                                                          at libcore.io.Posix.open(Native Method)
                                                                          at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
                                                                          at libcore.io.IoBridge.open(IoBridge.java:438)
                                                                          at java.io.FileInputStream.<init>(FileInputStream.java:76) 
                                                                          at java.io.FileInputStream.<init>(FileInputStream.java:103) 
                                                                          at java.io.FileReader.<init>(FileReader.java:66) 
                                                                          at com.android.internal.os.KernelUidCpuTimeReader.readDelta(KernelUidCpuTimeReader.java:71) 
                                                                          at com.android.internal.os.BatteryStatsImpl.updateCpuTimeLocked(BatteryStatsImpl.java:8031) 
                                                                          at com.android.server.am.BatteryStatsService.updateExternalStats(BatteryStatsService.java:1366) 
                                                                          at com.android.server.am.BatteryStatsService$BatteryStatsHandler.handleMessage(BatteryStatsService.java:125) 
                                                                          at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                          at android.os.Looper.loop(Looper.java:148) 
                                                                          at android.os.HandlerThread.run(HandlerThread.java:61) 
                                                                          at com.android.server.ServiceThread.run(ServiceThread.java:46) 
09-20 01:47:11.378 7724-7740/system_process E/KernelWakelockReader: neither /proc/wakelocks nor /d/wakeup_sources exists
09-20 01:47:11.380 7724-7740/system_process W/BatteryStatsImpl: Couldn't get kernel wake lock stats
09-20 01:47:11.786 8511-9509/com.google.android.gms D/DropBoxEntryAddedChimeraService: User is not opted-in to Usage & Diagnostics or Lockbox.
09-20 01:47:16.711 8138-8148/com.google.process.gapps W/art: Suspending all threads took: 63.308ms
09-20 01:47:25.361 7462-9507/? W/AudioFlinger: RecordThread: buffer overflow
09-20 01:47:43.857 7462-9507/? W/AudioFlinger: RecordThread: buffer overflow
09-20 01:47:57.846 7462-9507/? W/AudioFlinger: RecordThread: buffer overflow
09-20 01:47:58.515 7724-7738/system_process I/ProcessStatsService: Prepared write state in 1ms
09-20 01:47:58.516 7724-7738/system_process I/ProcessStatsService: Prepared write state in 1ms
09-20 01:49:22.116 7462-9507/? W/AudioFlinger: RecordThread: buffer overflow
09-20 01:49:22.434 8337-9329/com.google.android.googlequicksearchbox:search W/TRThreadPoolExecutor: Queue length for executor GrecoExecutor with 1 threads is now 8. Perhaps some tasks are too long, or the pool is too small.
09-20 01:49:40.171 8337-9329/com.google.android.googlequicksearchbox:search W/TRThreadPoolExecutor: Queue length for executor GrecoExecutor with 1 threads is now 8. Perhaps some tasks are too long, or the pool is too small.
09-20 01:49:41.652 7462-9507/? W/AudioFlinger: RecordThread: buffer overflow
09-20 01:50:32.159 7462-9507/? W/AudioFlinger: RecordThread: buffer overflow
09-20 01:50:39.881 8337-9508/com.google.android.googlequicksearchbox:search W/art: Long monitor contention event with owner method=int com.google.android.apps.gsa.speech.audio.Tee.k(byte[], int, int) from Tee.java:240 waiters=3 for 153ms
09-20 01:50:41.561 7462-9507/? W/AudioFlinger: RecordThread: buffer overflow
09-20 01:51:02.907 7724-7737/system_process I/UsageStatsService: User[0] Flushing usage stats to disk
09-20 01:51:07.672 7462-9507/? W/AudioFlinger: RecordThread: buffer overflow
09-20 01:51:07.775 8337-9329/com.google.android.googlequicksearchbox:search W/TRThreadPoolExecutor: Queue length for executor GrecoExecutor with 1 threads is now 8. Perhaps some tasks are too long, or the pool is too small.
09-20 01:52:19.800 7462-9507/? W/AudioFlinger: RecordThread: buffer overflow
09-20 01:52:59.098 8511-9511/com.google.android.gms I/EventLogChimeraService: Aggregate from 1474314776671 (log), 1474314776671 (data)
09-20 01:52:59.662 7724-7760/system_process I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10200000 cmp=com.google.android.googlequicksearchbox/com.google.android.launcher.GEL (has extras)} from uid 1000 on display 0

                                                               [ 09-20 01:52:59.723  7724: 7760 D/         ]
                                                               HostConnection::get() New Host Connection established 0x7fe99733e500, tid 7760
09-20 01:52:59.802 1187-1187/? E/EGL_emulation: tid 1187: eglCreateSyncKHR(1370): error 0x3004 (EGL_BAD_ATTRIBUTE)
09-20 01:52:59.880 7462-7780/? D/AudioFlinger: mixer(0xf44c0000) throttle end: throttle time(11)
09-20 01:53:00.121 7724-7743/system_process W/art: Long monitor contention event with owner method=android.graphics.Bitmap com.android.server.wm.WindowManagerService.screenshotApplicationsInner(android.os.IBinder, int, int, int, boolean) from WindowManagerService.java:6223 waiters=0 for 440ms
09-20 01:53:00.181 7724-7760/system_process D/gralloc_ranchu: gralloc_unregister_buffer: exiting HostConnection (is buffer-handling thread)
09-20 01:53:00.197 8337-8500/com.google.android.googlequicksearchbox:search I/MicrophoneInputStream: mic_close com.google.android.apps.gsa.speech.audio.u@eae2893
09-20 01:53:00.218 7724-7991/system_process W/art: Long monitor contention event with owner method=int com.android.server.am.ActivityStackSupervisor.startActivityMayWait(android.app.IApplicationThread, int, java.lang.String, android.content.Intent, java.lang.String, android.service.voice.IVoiceInteractionSession, com.android.internal.app.IVoiceInteractor, android.os.IBinder, java.lang.String, int, int, android.app.ProfilerInfo, android.app.IActivityManager$WaitResult, android.content.res.Configuration, android.os.Bundle, boolean, int, android.app.IActivityContainer, com.android.server.am.TaskRecord) from ActivityStackSupervisor.java:946 waiters=0 for 537ms
09-20 01:53:00.218 7724-7851/system_process W/art: Long monitor contention event with owner method=int com.android.server.am.ActivityStackSupervisor.startActivityMayWait(android.app.IApplicationThread, int, java.lang.String, android.content.Intent, java.lang.String, android.service.voice.IVoiceInteractionSession, com.android.internal.app.IVoiceInteractor, android.os.IBinder, java.lang.String, int, int, android.app.ProfilerInfo, android.app.IActivityManager$WaitResult, android.content.res.Configuration, android.os.Bundle, boolean, int, android.app.IActivityContainer, com.android.server.am.TaskRecord) from ActivityStackSupervisor.java:946 waiters=1 for 446ms
09-20 01:53:00.252 8337-8337/com.google.android.googlequicksearchbox:search W/VelvetPresenter: Still observing while not the active client
09-20 01:53:00.265 8337-8337/com.google.android.googlequicksearchbox:search W/VelvetPresenter: Still observing while not the active client
09-20 01:53:00.274 8337-9508/com.google.android.googlequicksearchbox:search I/HotwordRecognitionRnr: Hotword detection finished
09-20 01:53:00.276 8337-8504/com.google.android.googlequicksearchbox:search I/HotwordRecognitionRnr: Stopping hotword detection.
09-20 01:53:00.306 8337-9329/com.google.android.googlequicksearchbox:search W/TRThreadPoolExecutor: Task c[startRecognition] took 366597ms, which is over the 300000ms threshold
09-20 01:53:00.494 7724-7734/system_process I/art: Background partial concurrent mark sweep GC freed 20628(1791KB) AllocSpace objects, 13(320KB) LOS objects, 31% free, 8MB/12MB, paused 915us total 350.246ms
09-20 01:53:00.542 8337-8347/com.google.android.googlequicksearchbox:search I/art: Background sticky concurrent mark sweep GC freed 27734(1016KB) AllocSpace objects, 1(16KB) LOS objects, 9% free, 10MB/11MB, paused 1.383ms total 225.598ms
09-20 01:53:00.577 8094-8094/com.google.android.googlequicksearchbox I/GEL: handleIntent(Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10600000 cmp=com.google.android.googlequicksearchbox/com.google.android.launcher.GEL (has extras) })
09-20 01:53:00.701 8337-9517/com.google.android.googlequicksearchbox:search W/art: Verification of void com.google.android.apps.gsa.extradex.bloblobber.k.save() took 107.172ms
09-20 01:53:00.899 8511-9514/com.google.android.gms D/DropBoxEntryAddedChimeraService: User is not opted-in to Usage & Diagnostics or Lockbox.
09-20 01:53:01.047 8337-9517/com.google.android.googlequicksearchbox:search W/art: Verification of boolean com.google.android.apps.gsa.extradex.bloblobber.m.a(java.io.File, android.content.Context) took 136.969ms
09-20 01:53:01.327 8337-9517/com.google.android.googlequicksearchbox:search W/System: ClassLoader referenced unknown path: /system/priv-app/PrebuiltGmsCore/lib/x86
09-20 01:53:01.701 8337-8347/com.google.android.googlequicksearchbox:search I/art: Background sticky concurrent mark sweep GC freed 4689(892KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 11MB/11MB, paused 3.743ms total 355.853ms
09-20 01:53:01.939 8337-9388/com.google.android.googlequicksearchbox:search E/Surface: getSlotFromBufferLocked: unknown buffer: 0xe06f61a0
09-20 01:53:01.991 8094-8094/com.google.android.googlequicksearchbox I/Choreographer: Skipped 63 frames!  The application may be doing too much work on its main thread.
09-20 01:53:02.122 7820-7833/com.android.systemui I/art: Background partial concurrent mark sweep GC freed 50589(1951KB) AllocSpace objects, 0(0B) LOS objects, 39% free, 5MB/9MB, paused 821us total 322.859ms
09-20 01:53:02.158 8337-8347/com.google.android.googlequicksearchbox:search I/art: Background partial concurrent mark sweep GC freed 4540(265KB) AllocSpace objects, 6(2MB) LOS objects, 30% free, 9MB/13MB, paused 5.075ms total 287.771ms
09-20 01:53:02.186 8337-9521/com.google.android.googlequicksearchbox:search I/HotwordRecognitionRnr: Starting hotword detection.
09-20 01:53:02.190 8337-9522/com.google.android.googlequicksearchbox:search I/MicrophoneInputStream: mic_starting com.google.android.apps.gsa.speech.audio.u@5e96f99
09-20 01:53:02.296 8094-8353/com.google.android.googlequicksearchbox W/OpenGLRenderer: Incorrectly called buildLayer on View: em, destroying layer...
09-20 01:53:02.309 7462-7976/? E/audio_hw_generic: Error opening input stream format 1, channel_mask 0010, sample_rate 16000
09-20 01:53:02.402 7462-9524/? I/AudioFlinger: AudioFlinger's thread 0xf39c0000 ready to run
09-20 01:53:02.442 8337-9522/com.google.android.googlequicksearchbox:search I/MicrophoneInputStream: mic_started com.google.android.apps.gsa.speech.audio.u@5e96f99
09-20 01:53:02.536 1187-1187/? W/SurfaceFlinger: couldn't log to binary event log: overflow.
09-20 01:53:02.563 8337-8337/com.google.android.googlequicksearchbox:search I/HotwordWorker: onReady
09-20 01:53:02.699 8337-9517/com.google.android.googlequicksearchbox:search W/System: ClassLoader referenced unknown path: /system/priv-app/PrebuiltGmsCore/lib/x86
09-20 01:53:02.700 8337-9517/com.google.android.googlequicksearchbox:search W/System: ClassLoader referenced unknown path: /system/priv-app/PrebuiltGmsCore/lib/x86
09-20 01:53:03.297 8337-8347/com.google.android.googlequicksearchbox:search I/art: Background sticky concurrent mark sweep GC freed 20524(1572KB) AllocSpace objects, 0(0B) LOS objects, 8% free, 11MB/13MB, paused 5.204ms total 170.783ms
09-20 01:53:03.326 8337-9517/com.google.android.googlequicksearchbox:search W/linker: /system/priv-app/PrebuiltGmsCore/PrebuiltGmsCore.apk: unused DT entry: type 0x7ffffffd arg 0xa0a
09-20 01:53:03.811 8337-9517/com.google.android.googlequicksearchbox:search W/System: ClassLoader referenced unknown path: /system/priv-app/PrebuiltGmsCore/lib/x86
09-20 01:53:03.813 8337-9517/com.google.android.googlequicksearchbox:search W/System: ClassLoader referenced unknown path: /system/priv-app/PrebuiltGmsCore/lib/x86
09-20 01:53:04.023 8337-8347/com.google.android.googlequicksearchbox:search I/art: Background sticky concurrent mark sweep GC freed 2343(173KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 13MB/13MB, paused 14.298ms total 92.333ms
09-20 01:53:04.154 8337-8347/com.google.android.googlequicksearchbox:search I/art: Background partial concurrent mark sweep GC freed 9385(661KB) AllocSpace objects, 1(68KB) LOS objects, 22% free, 13MB/17MB, paused 2.174ms total 103.590ms
09-20 01:53:04.283 8337-9517/com.google.android.googlequicksearchbox:search W/linker: /system/priv-app/PrebuiltGmsCore/PrebuiltGmsCore.apk: unused DT entry: type 0x1d arg 0x91
09-20 01:53:04.283 8337-9517/com.google.android.googlequicksearchbox:search W/linker: /system/priv-app/PrebuiltGmsCore/PrebuiltGmsCore.apk: unused DT entry: type 0x7ffffffd arg 0x174
09-20 01:53:04.292 8337-9517/com.google.android.googlequicksearchbox:search V/JNIHelp: Registering com/google/android/gms/org/conscrypt/NativeCrypto's 255 native methods...
09-20 01:53:05.042 8337-9517/com.google.android.googlequicksearchbox:search I/ProviderInstaller: Installed default security provider GmsCore_OpenSSL
09-20 01:53:06.078 8511-9539/com.google.android.gms D/DropBoxEntryAddedChimeraService: User is not opted-in to Usage & Diagnostics or Lockbox.
09-20 01:53:06.442 7724-7739/system_process W/art: Long monitor contention event with owner method=android.content.ComponentName com.android.server.am.ActivityManagerService.startService(android.app.IApplicationThread, android.content.Intent, java.lang.String, java.lang.String, int) from ActivityManagerService.java:15676 waiters=0 for 120ms

How can I solve this?

回答1:

I also encountered the error message

Error code: 393238 | Buffer overflow, no available space.

For me, the reason was that I was targeting Android 24. Android 24 has a change that results in a FileUreExposedException being thrown when using a file:// URI instead of a content:// URI. For more details, see:

https://developer.android.com/reference/android/os/FileUriExposedException.html

Unfortunately, the emulator swallowed this exception so it was a bit difficult to detect; it showed only the "Buffer overflow, no available space." message.

A simple workaround is to target Android 23.

Better solutions are described here:

android.os.FileUriExposedException: file:///storage/emulated/0/test.txt exposed beyond app through Intent.getData()