Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
706 views
in Technique[技术] by (71.8m points)

cordova - Hybrid app crashing in Android studio with error: Session 'android': Error Launching activity

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(BatteryStatsSer

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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()


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...