问:
Firebase Crashlytics shows crashes only from debug build
I am trying Firebase Crashlytics. I set up it using this guide: https://firebase.google.com/docs/crashlytics/get-started

Then I tested implementation on simulator using Test Crashes in debug and release buildTypes: https://firebase.google.com/docs/crashlytics/force-a-crash

But in console I see only crashes from debug build. When I choose release build in drop down, I see 0 crashes.

In logcat I see the next message after crashing (in all build types):

I/CrashlyticsCore: Crashlytics report upload complete: 5A265C440009-0001-0E3A-7685F7DB472C.

What went wrong?

[UPDATE] after debug mode enabling:

```12-05 14:51:49.906 13234-13234/com.cantalk.ruen.dialogs D/gralloc_ranchu: Emulator without host-side GPU emulation detected.
12-05 14:51:50.146 13234-13236/com.cantalk.ruen.dialogs D/dalvikvm: GC_CONCURRENT freed 261K, 4% free 9691K/10055K, paused 0ms+1ms
12-05 14:51:50.146 13234-13254/com.cantalk.ruen.dialogs D/Fabric: Settings result was: 200
12-05 14:51:50.146 13234-13254/com.cantalk.ruen.dialogs D/Fabric: Settings request ID: e8411059b9619f4aab9d1da802350f42
12-05 14:51:50.146 13234-13254/com.cantalk.ruen.dialogs D/Fabric: Writing settings to cache file...
12-05 14:51:50.146 13234-13254/com.cantalk.ruen.dialogs D/Fabric: Loaded settings: {"cache_duration":7200,"settings_version":2,"app":{"update_required":true,"ndk_reports_url":"https:\/\/reports.crashlytics.com\/sdk-api\/v1\/platforms\/android\/apps\/com.cantalk.ruen.dialogs\/minidumps","reports_url":"https:\/\/reports.crashlytics.com\/spi\/v1\/platforms\/android\/apps\/com.cantalk.ruen.dialogs\/reports","status":"activated","identifier":"com.cantalk.ruen.dialogs","url":"https:\/\/api.crashlytics.com\/spi\/v1\/platforms\/android\/apps\/com.cantalk.ruen.dialogs"},"expires_at":1512492710153,"session":{"max_custom_key_value_pairs":64,"identifier_mask":255,"max_chained_exception_depth":16,"max_custom_exception_events":8,"max_complete_sessions_count":4,"log_buffer_size":64000},"features":{"push_enabled":true,"prompt_enabled":false,"collect_analytics":true,"collect_reports":true,"collect_logged_exceptions":true},"prompt":{"message":"Looks like we crashed! Please help us fix the problem by sending a crash report.","always_send_button_title":"Always Send","cancel_button_title":"Don't Send","show_cancel_button":true,"title":"Send Crash Report?","send_button_title":"Send","show_always_send_button":true},"beta":{"update_endpoint":"https:\/\/api.crashlytics.com\/spi\/v2\/platforms\/android\/apps\/com.cantalk.ruen.dialogs\/beta_update_check","update_suspend_duration":1800},"analytics":{"track_view_controllers":false,"include_purchase_events_in_forwarded_events":false,"track_predefined_events":true,"flush_interval_secs":120,"forward_to_google_analytics":false,"max_file_count_per_send":1,"flush_on_background":true,"track_custom_events":true,"max_pending_send_file_count":20,"sampling_rate":1,"max_byte_size_per_file":40000,"url":"https:\/\/e.crashlytics.com\/spi\/v2\/events"}}
12-05 14:51:50.146 13234-13254/com.cantalk.ruen.dialogs D/Fabric: Build ID is: 3ac52db2-2457-4eb6-a146-635aa5dfdd56
12-05 14:51:50.186 13234-13254/com.cantalk.ruen.dialogs D/Fabric: Server says an update is required - forcing a full App update.
12-05 14:51:50.186 13234-13254/com.cantalk.ruen.dialogs D/Fabric: App icon resource ID is 2131296257
12-05 14:51:50.186 13234-13254/com.cantalk.ruen.dialogs D/Fabric: Falling back to Crashlytics key lookup from Manifest
12-05 14:51:50.186 13234-13254/com.cantalk.ruen.dialogs D/Fabric: Falling back to Crashlytics key lookup from Strings
12-05 14:51:50.186 13234-13254/com.cantalk.ruen.dialogs D/Fabric: Generating Crashlytics ApiKey from google_app_id in Strings
12-05 14:51:50.186 13234-13254/com.cantalk.ruen.dialogs D/Fabric: Build ID is: 3ac52db2-2457-4eb6-a146-635aa5dfdd56
12-05 14:51:50.666 13234-13236/com.cantalk.ruen.dialogs D/dalvikvm: GC_CONCURRENT freed 377K, 5% free 9752K/10247K, paused 0ms+0ms
12-05 14:51:50.666 13234-13254/com.cantalk.ruen.dialogs D/Fabric: Sending app info to https://api.crashlytics.com/spi/v1/platforms/android/apps/com.cantalk.ruen.dialogs
12-05 14:51:50.666 13234-13254/com.cantalk.ruen.dialogs D/Fabric: App icon hash is f7a38bdfc0d07bd7e80ff8dcc521a975058a0617
12-05 14:51:50.666 13234-13254/com.cantalk.ruen.dialogs D/Fabric: App icon size is 72x72
12-05 14:51:51.086 13234-13254/com.cantalk.ruen.dialogs D/Fabric: Update app request ID: dbe5793c4fd4c471169f85a73a056b66
12-05 14:51:51.096 13234-13254/com.cantalk.ruen.dialogs D/Fabric: Result was 204
12-05 14:51:51.096 13234-13252/com.cantalk.ruen.dialogs D/Answers: Analytics collection enabled
12-05 14:51:51.096 13234-13258/com.cantalk.ruen.dialogs D/Fabric: Falling back to Crashlytics key lookup from Manifest
12-05 14:51:51.096 13234-13258/com.cantalk.ruen.dialogs D/Fabric: Falling back to Crashlytics key lookup from Strings
12-05 14:51:51.096 13234-13258/com.cantalk.ruen.dialogs D/Fabric: Generating Crashlytics ApiKey from google_app_id in Strings
12-05 14:51:51.096 13234-13258/com.cantalk.ruen.dialogs D/Answers: Firebase analytics forwarding disabled
12-05 14:51:51.096 13234-13258/com.cantalk.ruen.dialogs D/Answers: Firebase analytics including purchase events disabled
12-05 14:51:51.096 13234-13258/com.cantalk.ruen.dialogs D/Answers: Custom event tracking enabled
12-05 14:51:51.096 13234-13258/com.cantalk.ruen.dialogs D/Answers: Predefined event tracking enabled
12-05 14:51:51.096 13234-13255/com.cantalk.ruen.dialogs D/Beta: Beta kit initializing...
12-05 14:51:51.096 13234-13255/com.cantalk.ruen.dialogs D/Beta: Beta device token present: false
12-05 14:51:51.096 13234-13255/com.cantalk.ruen.dialogs D/Beta: A Beta device token was not found for this app
12-05 14:51:51.096 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Initialization marker file created.
12-05 14:51:51.096 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Finalizing previously open sessions.
12-05 14:51:51.106 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Closing open sessions.
12-05 14:51:51.106 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Closing session: 5A265C59021C-0002-0E3A-7685F7DB472C
12-05 14:51:51.106 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Collecting session parts for ID 5A265C59021C-0002-0E3A-7685F7DB472C
12-05 14:51:51.106 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Session 5A265C59021C-0002-0E3A-7685F7DB472C has fatal exception: false
12-05 14:51:51.106 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Session 5A265C59021C-0002-0E3A-7685F7DB472C has non-fatal exceptions: false
12-05 14:51:51.106 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: No events present for session ID 5A265C59021C-0002-0E3A-7685F7DB472C
12-05 14:51:51.106 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Removing session part files for ID 5A265C59021C-0002-0E3A-7685F7DB472C
12-05 14:51:51.116 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Closed all previously open sessions
12-05 14:51:51.116 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Initialization marker file removed: true
12-05 14:51:51.116 13234-13271/com.cantalk.ruen.dialogs D/CrashlyticsCore: Starting report processing in 1.0 second(s)...
12-05 14:51:51.556 13234-13258/com.cantalk.ruen.dialogs D/Answers: Sending 1 analytics files to https://e.crashlytics.com/spi/v2/events
12-05 14:51:51.556 13234-13236/com.cantalk.ruen.dialogs D/dalvikvm: GC_CONCURRENT freed 395K, 5% free 9846K/10311K, paused 0ms+0ms
12-05 14:51:51.696 13234-13258/com.cantalk.ruen.dialogs D/Answers: Response code for analytics file send is 200
12-05 14:51:52.116 13234-13271/com.cantalk.ruen.dialogs D/CrashlyticsCore: Checking for crash reports...
12-05 14:51:52.116 13234-13271/com.cantalk.ruen.dialogs D/CrashlyticsCore: No reports found.
12-05 14:51:59.546 13234-13273/com.cantalk.ruen.dialogs V/FA: Session started, time: 23739484
12-05 14:51:59.556 13234-13273/com.cantalk.ruen.dialogs D/FA: Logging event (FE): session_start(_s), Bundle[{firebase_event_origin(_o)=auto, firebase_screen_id(_si)=184663540899271272, firebase_screen_class(_sc)=MainActivity}]
12-05 14:51:59.586 13234-13273/com.cantalk.ruen.dialogs V/FA: Connecting to remote service
12-05 14:51:59.586 13234-13273/com.cantalk.ruen.dialogs W/GooglePlayServicesUtil: Google Play services out of date.  Requires 11720000 but found 9256030
12-05 14:51:59.586 13234-13234/com.cantalk.ruen.dialogs W/FA: Service connection failed: nk{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
12-05 14:51:59.596 13234-13274/com.cantalk.ruen.dialogs V/FA: Processing queued up service tasks: 1
12-05 14:51:59.596 13234-13274/com.cantalk.ruen.dialogs E/FA: Discarding data. Failed to send event to service
12-05 14:52:12.736 13234-13234/com.cantalk.ruen.dialogs D/Answers: Logged lifecycle event: PAUSE
12-05 14:52:12.746 13234-13275/com.cantalk.ruen.dialogs V/FA: Recording user engagement, ms: 23227
12-05 14:52:12.746 13234-13275/com.cantalk.ruen.dialogs V/FA: Connecting to remote service
12-05 14:52:12.756 13234-13234/com.cantalk.ruen.dialogs V/FA: onActivityCreated
12-05 14:52:12.756 13234-13275/com.cantalk.ruen.dialogs W/GooglePlayServicesUtil: Google Play services out of date.  Requires 11720000 but found 9256030
12-05 14:52:12.756 13234-13275/com.cantalk.ruen.dialogs V/FA: Activity paused, time: 23752679
12-05 14:52:12.756 13234-13275/com.cantalk.ruen.dialogs D/FA: Logging event (FE): user_engagement(_e), Bundle[{firebase_event_origin(_o)=auto, firebase_screen_id(_si)=184663540899271272, engagement_time_msec(_et)=23227, firebase_screen_class(_sc)=MainActivity}]
12-05 14:52:12.796 13234-13236/com.cantalk.ruen.dialogs D/dalvikvm: GC_CONCURRENT freed 352K, 5% free 9927K/10375K, paused 0ms+0ms
12-05 14:52:12.806 13234-13234/com.cantalk.ruen.dialogs D/dalvikvm: GC_FOR_ALLOC freed 22K, 5% free 9914K/10375K, paused 2ms
12-05 14:52:12.806 13234-13234/com.cantalk.ruen.dialogs I/dalvikvm-heap: Grow heap (frag case) to 9.875MB for 147468-byte allocation
12-05 14:52:12.826 13234-13234/com.cantalk.ruen.dialogs D/dalvikvm: GC_FOR_ALLOC freed 14K, 5% free 10044K/10567K, paused 2ms
12-05 14:52:12.826 13234-13275/com.cantalk.ruen.dialogs V/FA: Connection attempt already in progress
12-05 14:52:12.826 13234-13234/com.cantalk.ruen.dialogs D/Answers: Logged lifecycle event: START
12-05 14:52:12.836 13234-13234/com.cantalk.ruen.dialogs D/Answers: Logged lifecycle event: RESUME
12-05 14:52:12.836 13234-13276/com.cantalk.ruen.dialogs V/FA: Connection attempt already in progress
12-05 14:52:12.836 13234-13276/com.cantalk.ruen.dialogs V/FA: Activity resumed, time: 23752771
12-05 14:52:12.836 13234-13234/com.cantalk.ruen.dialogs W/FA: Service connection failed: nk{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
12-05 14:52:12.836 13234-13276/com.cantalk.ruen.dialogs D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_previous_class(_pc)=MainActivity, firebase_event_origin(_o)=auto, firebase_screen_id(_si)=184663540899271273, firebase_screen_class(_sc)=DonationActivity, firebase_previous_id(_pi)=184663540899271272}]
12-05 14:52:12.866 13234-13276/com.cantalk.ruen.dialogs V/FA: Connecting to remote service
12-05 14:52:12.866 13234-13276/com.cantalk.ruen.dialogs W/GooglePlayServicesUtil: Google Play services out of date.  Requires 11720000 but found 9256030
12-05 14:52:12.866 13234-13234/com.cantalk.ruen.dialogs W/FA: Service connection failed: nk{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
12-05 14:52:12.866 13234-13276/com.cantalk.ruen.dialogs V/FA: Processing queued up service tasks: 4
12-05 14:52:12.866 13234-13276/com.cantalk.ruen.dialogs E/FA: Failed to send current screen to service
12-05 14:52:12.866 13234-13276/com.cantalk.ruen.dialogs E/FA: Discarding data. Failed to send event to service
12-05 14:52:12.866 13234-13276/com.cantalk.ruen.dialogs E/FA: Failed to send current screen to service
12-05 14:52:12.866 13234-13276/com.cantalk.ruen.dialogs E/FA: Discarding data. Failed to send event to service
12-05 14:52:12.866 13234-13276/com.cantalk.ruen.dialogs V/FA: Processing queued up service tasks: 0
12-05 14:52:13.066 13234-13234/com.cantalk.ruen.dialogs D/Answers: Logged lifecycle event: STOP
12-05 14:52:16.326 13234-13234/com.cantalk.ruen.dialogs D/AndroidRuntime: Shutting down VM
12-05 14:52:16.326 13234-13234/com.cantalk.ruen.dialogs W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0xb1312180)
12-05 14:52:16.326 13234-13234/com.cantalk.ruen.dialogs D/CrashlyticsCore: Crashlytics is handling uncaught exception "java.lang.ArrayIndexOutOfBoundsException: length=2; index=10" from thread main
12-05 14:52:16.326 13234-13262/com.cantalk.ruen.dialogs D/Answers: Logged crash
12-05 14:52:16.336 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Logging Crashlytics event to Firebase
12-05 14:52:16.336 13234-13277/com.cantalk.ruen.dialogs D/FA: Logging event (FE): app_exception(_ae), Bundle[{timestamp=1512485536337, firebase_event_origin(_o)=clx, firebase_screen_id(_si)=184663540899271273, firebase_screen_class(_sc)=DonationActivity, _r=1, fatal=1}]
12-05 14:52:16.346 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: No log data to include with this event.
12-05 14:52:16.376 13234-13236/com.cantalk.ruen.dialogs D/dalvikvm: GC_CONCURRENT freed 384K, 5% free 10139K/10631K, paused 1ms+1ms
12-05 14:52:16.376 13234-13277/com.cantalk.ruen.dialogs V/FA: Connecting to remote service
12-05 14:52:16.376 13234-13277/com.cantalk.ruen.dialogs W/GooglePlayServicesUtil: Google Play services out of date.  Requires 11720000 but found 9256030
12-05 14:52:16.376 13234-13277/com.cantalk.ruen.dialogs V/FA: Recording user engagement, ms: 3543
12-05 14:52:16.376 13234-13277/com.cantalk.ruen.dialogs D/FA: Logging event (FE): user_engagement(_e), Bundle[{firebase_event_origin(_o)=auto, firebase_screen_id(_si)=184663540899271273, engagement_time_msec(_et)=3543, firebase_screen_class(_sc)=DonationActivity}]
12-05 14:52:16.386 13234-13277/com.cantalk.ruen.dialogs V/FA: Connection attempt already in progress
12-05 14:52:16.406 13234-13236/com.cantalk.ruen.dialogs D/dalvikvm: GC_CONCURRENT freed 453K, 6% free 10123K/10695K, paused 0ms+0ms
12-05 14:52:16.406 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Closing open sessions.
12-05 14:52:16.406 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Closing session: 5A26B2850090-0001-33B2-7685F7DB472C
12-05 14:52:16.406 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Collecting session parts for ID 5A26B2850090-0001-33B2-7685F7DB472C
12-05 14:52:16.406 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Session 5A26B2850090-0001-33B2-7685F7DB472C has fatal exception: true
12-05 14:52:16.406 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Session 5A26B2850090-0001-33B2-7685F7DB472C has non-fatal exceptions: false
12-05 14:52:16.406 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Collecting SessionStart data for session ID 5A26B2850090-0001-33B2-7685F7DB472C
12-05 14:52:16.406 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Collecting SessionUser data for session ID 5A26B2850090-0001-33B2-7685F7DB472C
12-05 14:52:16.406 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Collecting SessionApp data for session ID 5A26B2850090-0001-33B2-7685F7DB472C
12-05 14:52:16.406 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Collecting SessionOS data for session ID 5A26B2850090-0001-33B2-7685F7DB472C
12-05 14:52:16.406 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Collecting SessionDevice data for session ID 5A26B2850090-0001-33B2-7685F7DB472C
12-05 14:52:16.406 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Removing session part files for ID 5A26B2850090-0001-33B2-7685F7DB472C
12-05 14:52:16.406 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Opening a new session with ID 5A26B2A0019E-0002-33B2-7685F7DB472C
12-05 14:52:16.406 13234-13262/com.cantalk.ruen.dialogs D/Beta: Beta device token present: false
12-05 14:52:16.406 13234-13262/com.cantalk.ruen.dialogs D/Fabric: Falling back to Crashlytics key lookup from Manifest
12-05 14:52:16.406 13234-13262/com.cantalk.ruen.dialogs D/Fabric: Falling back to Crashlytics key lookup from Strings
12-05 14:52:16.406 13234-13262/com.cantalk.ruen.dialogs D/Fabric: Falling back to Crashlytics key lookup from Manifest
12-05 14:52:16.406 13234-13262/com.cantalk.ruen.dialogs D/Fabric: Falling back to Crashlytics key lookup from Strings
12-05 14:52:16.416 13234-13234/com.cantalk.ruen.dialogs D/CrashlyticsCore: Crashlytics completed exception processing. Invoking default exception handler.
12-05 14:52:16.416 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Attempting to send crash report at time of crash...
12-05 14:52:16.416 13234-13234/com.cantalk.ruen.dialogs E/AndroidRuntime: FATAL EXCEPTION: main
                                                                        java.lang.ArrayIndexOutOfBoundsException: length=2; index=10
                                                                            at lr.f(Unknown Source)
                                                                            at dm.c(Unknown Source)
                                                                            at com.cantalk.application.DonationActivity$1.onProgressChanged(Unknown Source)
                                                                            at android.widget.SeekBar.onProgressRefresh(SeekBar.java:89)
                                                                            at android.widget.ProgressBar.doRefreshProgress(ProgressBar.java:609)
                                                                            at android.widget.ProgressBar.refreshProgress(ProgressBar.java:621)
                                                                            at android.widget.ProgressBar.setProgress(ProgressBar.java:670)
                                                                            at android.widget.AbsSeekBar.trackTouchEvent(AbsSeekBar.java:411)
                                                                            at android.widget.AbsSeekBar.onTouchEvent(AbsSeekBar.java:349)
                                                                            at android.view.View.dispatchTouchEvent(View.java:5541)
                                                                            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
                                                                            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
                                                                            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
                                                                            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
                                                                            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
                                                                            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
                                                                            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
                                                                            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
                                                                            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
                                                                            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
                                                                            at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1912)
                                                                            at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1371)
                                                                            at android.app.Activity.dispatchTouchEvent(Activity.java:2364)
                                                                            at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1860)
                                                                            at android.view.View.dispatchPointerEvent(View.java:5721)
                                                                            at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:2890)
                                                                            at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2466)
                                                                            at android.view.ViewRootImpl.processInputEvents(ViewRootImpl.java:845)
                                                                            at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2475)
                                                                            at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                            at android.os.Looper.loop(Looper.java:137)
                                                                            at android.app.ActivityThread.main(ActivityThread.java:4424)
                                                                            at java.lang.reflect.Method.invokeNative(Native Method)
                                                                            at java.lang.reflect.Method.invoke(Method.java:511)
                                                                            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
                                                                            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
                                                                            at dalvik.system.NativeStart.main(Native Method)
12-05 14:52:16.736 13234-13236/com.cantalk.ruen.dialogs D/dalvikvm: GC_CONCURRENT freed 394K, 6% free 10113K/10695K, paused 1ms+1ms
12-05 14:52:16.896 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Adding single file 5A26B2850090-0001-33B2-7685F7DB472C.cls to report 5A26B2850090-0001-33B2-7685F7DB472C
12-05 14:52:16.896 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Sending report to: https://reports.crashlytics.com/spi/v1/platforms/android/apps/com.cantalk.ruen.dialogs/reports
12-05 14:52:16.916 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: threadid=3: reacting to signal 3
12-05 14:52:16.916 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
12-05 14:52:17.176 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Create report request ID: null
12-05 14:52:17.176 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Result was: 202
12-05 14:52:17.176 13234-13262/com.cantalk.ruen.dialogs I/CrashlyticsCore: Crashlytics report upload complete: 5A26B2850090-0001-33B2-7685F7DB472C
12-05 14:52:17.176 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Removing report at /data/data/com.cantalk.ruen.dialogs/files/.Fabric/com.crashlytics.sdk.android.crashlytics-core/fatal-sessions/5A26B2850090-0001-33B2-7685F7DB472C.cls
12-05 14:52:17.416 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: threadid=3: reacting to signal 3
12-05 14:52:17.426 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
12-05 14:52:17.926 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: threadid=3: reacting to signal 3
12-05 14:52:17.926 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
12-05 14:52:18.426 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: threadid=3: reacting to signal 3
12-05 14:52:18.426 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
12-05 14:52:18.926 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: threadid=3: reacting to signal 3
12-05 14:52:18.926 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
12-05 14:52:19.426 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: threadid=3: reacting to signal 3
12-05 14:52:19.426 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
12-05 14:52:19.926 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: threadid=3: reacting to signal 3
12-05 14:52:19.926 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
12-05 14:52:20.426 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: threadid=3: reacting to signal 3
12-05 14:52:20.426 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
12-05 14:52:20.936 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: threadid=3: reacting to signal 3
12-05 14:52:20.936 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
12-05 14:52:21.436 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: threadid=3: reacting to signal 3
12-05 14:52:21.436 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
12-05 14:52:21.936 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: threadid=3: reacting to signal 3
12-05 14:52:21.936 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
12-05 14:52:22.246 13234-13234/? I/Process: Sending signal. PID: 13234 SIG: 9
```

答:
Try this - </p>

```<code>if (!BuildConfig.DEBUG) {
                FirebaseCrash.log("this is a crash"));
                FirebaseCrash.report("any error logs or object");
            }
</code>```

Body:
I am trying Firebase Crashlytics. I set up it using this guide: https://firebase.google.com/docs/crashlytics/get-started

Then I tested implementation on simulator using Test Crashes in debug and release buildTypes: https://firebase.google.com/docs/crashlytics/force-a-crash

But in console I see only crashes from debug build. When I choose release build in drop down, I see 0 crashes.

In logcat I see the next message after crashing (in all build types):

I/CrashlyticsCore: Crashlytics report upload complete: 5A265C440009-0001-0E3A-7685F7DB472C.

What went wrong?

[UPDATE] after debug mode enabling:

12-05 14:51:49.906 13234-13234/com.cantalk.ruen.dialogs D/gralloc_ranchu: Emulator without host-side GPU emulation detected.
12-05 14:51:50.146 13234-13236/com.cantalk.ruen.dialogs D/dalvikvm: GC_CONCURRENT freed 261K, 4% free 9691K/10055K, paused 0ms+1ms
12-05 14:51:50.146 13234-13254/com.cantalk.ruen.dialogs D/Fabric: Settings result was: 200
12-05 14:51:50.146 13234-13254/com.cantalk.ruen.dialogs D/Fabric: Settings request ID: e8411059b9619f4aab9d1da802350f42
12-05 14:51:50.146 13234-13254/com.cantalk.ruen.dialogs D/Fabric: Writing settings to cache file...
12-05 14:51:50.146 13234-13254/com.cantalk.ruen.dialogs D/Fabric: Loaded settings: {"cache_duration":7200,"settings_version":2,"app":{"update_required":true,"ndk_reports_url":"https:\/\/reports.crashlytics.com\/sdk-api\/v1\/platforms\/android\/apps\/com.cantalk.ruen.dialogs\/minidumps","reports_url":"https:\/\/reports.crashlytics.com\/spi\/v1\/platforms\/android\/apps\/com.cantalk.ruen.dialogs\/reports","status":"activated","identifier":"com.cantalk.ruen.dialogs","url":"https:\/\/api.crashlytics.com\/spi\/v1\/platforms\/android\/apps\/com.cantalk.ruen.dialogs"},"expires_at":1512492710153,"session":{"max_custom_key_value_pairs":64,"identifier_mask":255,"max_chained_exception_depth":16,"max_custom_exception_events":8,"max_complete_sessions_count":4,"log_buffer_size":64000},"features":{"push_enabled":true,"prompt_enabled":false,"collect_analytics":true,"collect_reports":true,"collect_logged_exceptions":true},"prompt":{"message":"Looks like we crashed! Please help us fix the problem by sending a crash report.","always_send_button_title":"Always Send","cancel_button_title":"Don't Send","show_cancel_button":true,"title":"Send Crash Report?","send_button_title":"Send","show_always_send_button":true},"beta":{"update_endpoint":"https:\/\/api.crashlytics.com\/spi\/v2\/platforms\/android\/apps\/com.cantalk.ruen.dialogs\/beta_update_check","update_suspend_duration":1800},"analytics":{"track_view_controllers":false,"include_purchase_events_in_forwarded_events":false,"track_predefined_events":true,"flush_interval_secs":120,"forward_to_google_analytics":false,"max_file_count_per_send":1,"flush_on_background":true,"track_custom_events":true,"max_pending_send_file_count":20,"sampling_rate":1,"max_byte_size_per_file":40000,"url":"https:\/\/e.crashlytics.com\/spi\/v2\/events"}}
12-05 14:51:50.146 13234-13254/com.cantalk.ruen.dialogs D/Fabric: Build ID is: 3ac52db2-2457-4eb6-a146-635aa5dfdd56
12-05 14:51:50.186 13234-13254/com.cantalk.ruen.dialogs D/Fabric: Server says an update is required - forcing a full App update.
12-05 14:51:50.186 13234-13254/com.cantalk.ruen.dialogs D/Fabric: App icon resource ID is 2131296257
12-05 14:51:50.186 13234-13254/com.cantalk.ruen.dialogs D/Fabric: Falling back to Crashlytics key lookup from Manifest
12-05 14:51:50.186 13234-13254/com.cantalk.ruen.dialogs D/Fabric: Falling back to Crashlytics key lookup from Strings
12-05 14:51:50.186 13234-13254/com.cantalk.ruen.dialogs D/Fabric: Generating Crashlytics ApiKey from google_app_id in Strings
12-05 14:51:50.186 13234-13254/com.cantalk.ruen.dialogs D/Fabric: Build ID is: 3ac52db2-2457-4eb6-a146-635aa5dfdd56
12-05 14:51:50.666 13234-13236/com.cantalk.ruen.dialogs D/dalvikvm: GC_CONCURRENT freed 377K, 5% free 9752K/10247K, paused 0ms+0ms
12-05 14:51:50.666 13234-13254/com.cantalk.ruen.dialogs D/Fabric: Sending app info to https://api.crashlytics.com/spi/v1/platforms/android/apps/com.cantalk.ruen.dialogs
12-05 14:51:50.666 13234-13254/com.cantalk.ruen.dialogs D/Fabric: App icon hash is f7a38bdfc0d07bd7e80ff8dcc521a975058a0617
12-05 14:51:50.666 13234-13254/com.cantalk.ruen.dialogs D/Fabric: App icon size is 72x72
12-05 14:51:51.086 13234-13254/com.cantalk.ruen.dialogs D/Fabric: Update app request ID: dbe5793c4fd4c471169f85a73a056b66
12-05 14:51:51.096 13234-13254/com.cantalk.ruen.dialogs D/Fabric: Result was 204
12-05 14:51:51.096 13234-13252/com.cantalk.ruen.dialogs D/Answers: Analytics collection enabled
12-05 14:51:51.096 13234-13258/com.cantalk.ruen.dialogs D/Fabric: Falling back to Crashlytics key lookup from Manifest
12-05 14:51:51.096 13234-13258/com.cantalk.ruen.dialogs D/Fabric: Falling back to Crashlytics key lookup from Strings
12-05 14:51:51.096 13234-13258/com.cantalk.ruen.dialogs D/Fabric: Generating Crashlytics ApiKey from google_app_id in Strings
12-05 14:51:51.096 13234-13258/com.cantalk.ruen.dialogs D/Answers: Firebase analytics forwarding disabled
12-05 14:51:51.096 13234-13258/com.cantalk.ruen.dialogs D/Answers: Firebase analytics including purchase events disabled
12-05 14:51:51.096 13234-13258/com.cantalk.ruen.dialogs D/Answers: Custom event tracking enabled
12-05 14:51:51.096 13234-13258/com.cantalk.ruen.dialogs D/Answers: Predefined event tracking enabled
12-05 14:51:51.096 13234-13255/com.cantalk.ruen.dialogs D/Beta: Beta kit initializing...
12-05 14:51:51.096 13234-13255/com.cantalk.ruen.dialogs D/Beta: Beta device token present: false
12-05 14:51:51.096 13234-13255/com.cantalk.ruen.dialogs D/Beta: A Beta device token was not found for this app
12-05 14:51:51.096 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Initialization marker file created.
12-05 14:51:51.096 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Finalizing previously open sessions.
12-05 14:51:51.106 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Closing open sessions.
12-05 14:51:51.106 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Closing session: 5A265C59021C-0002-0E3A-7685F7DB472C
12-05 14:51:51.106 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Collecting session parts for ID 5A265C59021C-0002-0E3A-7685F7DB472C
12-05 14:51:51.106 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Session 5A265C59021C-0002-0E3A-7685F7DB472C has fatal exception: false
12-05 14:51:51.106 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Session 5A265C59021C-0002-0E3A-7685F7DB472C has non-fatal exceptions: false
12-05 14:51:51.106 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: No events present for session ID 5A265C59021C-0002-0E3A-7685F7DB472C
12-05 14:51:51.106 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Removing session part files for ID 5A265C59021C-0002-0E3A-7685F7DB472C
12-05 14:51:51.116 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Closed all previously open sessions
12-05 14:51:51.116 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Initialization marker file removed: true
12-05 14:51:51.116 13234-13271/com.cantalk.ruen.dialogs D/CrashlyticsCore: Starting report processing in 1.0 second(s)...
12-05 14:51:51.556 13234-13258/com.cantalk.ruen.dialogs D/Answers: Sending 1 analytics files to https://e.crashlytics.com/spi/v2/events
12-05 14:51:51.556 13234-13236/com.cantalk.ruen.dialogs D/dalvikvm: GC_CONCURRENT freed 395K, 5% free 9846K/10311K, paused 0ms+0ms
12-05 14:51:51.696 13234-13258/com.cantalk.ruen.dialogs D/Answers: Response code for analytics file send is 200
12-05 14:51:52.116 13234-13271/com.cantalk.ruen.dialogs D/CrashlyticsCore: Checking for crash reports...
12-05 14:51:52.116 13234-13271/com.cantalk.ruen.dialogs D/CrashlyticsCore: No reports found.
12-05 14:51:59.546 13234-13273/com.cantalk.ruen.dialogs V/FA: Session started, time: 23739484
12-05 14:51:59.556 13234-13273/com.cantalk.ruen.dialogs D/FA: Logging event (FE): session_start(_s), Bundle[{firebase_event_origin(_o)=auto, firebase_screen_id(_si)=184663540899271272, firebase_screen_class(_sc)=MainActivity}]
12-05 14:51:59.586 13234-13273/com.cantalk.ruen.dialogs V/FA: Connecting to remote service
12-05 14:51:59.586 13234-13273/com.cantalk.ruen.dialogs W/GooglePlayServicesUtil: Google Play services out of date.  Requires 11720000 but found 9256030
12-05 14:51:59.586 13234-13234/com.cantalk.ruen.dialogs W/FA: Service connection failed: nk{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
12-05 14:51:59.596 13234-13274/com.cantalk.ruen.dialogs V/FA: Processing queued up service tasks: 1
12-05 14:51:59.596 13234-13274/com.cantalk.ruen.dialogs E/FA: Discarding data. Failed to send event to service
12-05 14:52:12.736 13234-13234/com.cantalk.ruen.dialogs D/Answers: Logged lifecycle event: PAUSE
12-05 14:52:12.746 13234-13275/com.cantalk.ruen.dialogs V/FA: Recording user engagement, ms: 23227
12-05 14:52:12.746 13234-13275/com.cantalk.ruen.dialogs V/FA: Connecting to remote service
12-05 14:52:12.756 13234-13234/com.cantalk.ruen.dialogs V/FA: onActivityCreated
12-05 14:52:12.756 13234-13275/com.cantalk.ruen.dialogs W/GooglePlayServicesUtil: Google Play services out of date.  Requires 11720000 but found 9256030
12-05 14:52:12.756 13234-13275/com.cantalk.ruen.dialogs V/FA: Activity paused, time: 23752679
12-05 14:52:12.756 13234-13275/com.cantalk.ruen.dialogs D/FA: Logging event (FE): user_engagement(_e), Bundle[{firebase_event_origin(_o)=auto, firebase_screen_id(_si)=184663540899271272, engagement_time_msec(_et)=23227, firebase_screen_class(_sc)=MainActivity}]
12-05 14:52:12.796 13234-13236/com.cantalk.ruen.dialogs D/dalvikvm: GC_CONCURRENT freed 352K, 5% free 9927K/10375K, paused 0ms+0ms
12-05 14:52:12.806 13234-13234/com.cantalk.ruen.dialogs D/dalvikvm: GC_FOR_ALLOC freed 22K, 5% free 9914K/10375K, paused 2ms
12-05 14:52:12.806 13234-13234/com.cantalk.ruen.dialogs I/dalvikvm-heap: Grow heap (frag case) to 9.875MB for 147468-byte allocation
12-05 14:52:12.826 13234-13234/com.cantalk.ruen.dialogs D/dalvikvm: GC_FOR_ALLOC freed 14K, 5% free 10044K/10567K, paused 2ms
12-05 14:52:12.826 13234-13275/com.cantalk.ruen.dialogs V/FA: Connection attempt already in progress
12-05 14:52:12.826 13234-13234/com.cantalk.ruen.dialogs D/Answers: Logged lifecycle event: START
12-05 14:52:12.836 13234-13234/com.cantalk.ruen.dialogs D/Answers: Logged lifecycle event: RESUME
12-05 14:52:12.836 13234-13276/com.cantalk.ruen.dialogs V/FA: Connection attempt already in progress
12-05 14:52:12.836 13234-13276/com.cantalk.ruen.dialogs V/FA: Activity resumed, time: 23752771
12-05 14:52:12.836 13234-13234/com.cantalk.ruen.dialogs W/FA: Service connection failed: nk{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
12-05 14:52:12.836 13234-13276/com.cantalk.ruen.dialogs D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_previous_class(_pc)=MainActivity, firebase_event_origin(_o)=auto, firebase_screen_id(_si)=184663540899271273, firebase_screen_class(_sc)=DonationActivity, firebase_previous_id(_pi)=184663540899271272}]
12-05 14:52:12.866 13234-13276/com.cantalk.ruen.dialogs V/FA: Connecting to remote service
12-05 14:52:12.866 13234-13276/com.cantalk.ruen.dialogs W/GooglePlayServicesUtil: Google Play services out of date.  Requires 11720000 but found 9256030
12-05 14:52:12.866 13234-13234/com.cantalk.ruen.dialogs W/FA: Service connection failed: nk{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
12-05 14:52:12.866 13234-13276/com.cantalk.ruen.dialogs V/FA: Processing queued up service tasks: 4
12-05 14:52:12.866 13234-13276/com.cantalk.ruen.dialogs E/FA: Failed to send current screen to service
12-05 14:52:12.866 13234-13276/com.cantalk.ruen.dialogs E/FA: Discarding data. Failed to send event to service
12-05 14:52:12.866 13234-13276/com.cantalk.ruen.dialogs E/FA: Failed to send current screen to service
12-05 14:52:12.866 13234-13276/com.cantalk.ruen.dialogs E/FA: Discarding data. Failed to send event to service
12-05 14:52:12.866 13234-13276/com.cantalk.ruen.dialogs V/FA: Processing queued up service tasks: 0
12-05 14:52:13.066 13234-13234/com.cantalk.ruen.dialogs D/Answers: Logged lifecycle event: STOP
12-05 14:52:16.326 13234-13234/com.cantalk.ruen.dialogs D/AndroidRuntime: Shutting down VM
12-05 14:52:16.326 13234-13234/com.cantalk.ruen.dialogs W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0xb1312180)
12-05 14:52:16.326 13234-13234/com.cantalk.ruen.dialogs D/CrashlyticsCore: Crashlytics is handling uncaught exception "java.lang.ArrayIndexOutOfBoundsException: length=2; index=10" from thread main
12-05 14:52:16.326 13234-13262/com.cantalk.ruen.dialogs D/Answers: Logged crash
12-05 14:52:16.336 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Logging Crashlytics event to Firebase
12-05 14:52:16.336 13234-13277/com.cantalk.ruen.dialogs D/FA: Logging event (FE): app_exception(_ae), Bundle[{timestamp=1512485536337, firebase_event_origin(_o)=clx, firebase_screen_id(_si)=184663540899271273, firebase_screen_class(_sc)=DonationActivity, _r=1, fatal=1}]
12-05 14:52:16.346 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: No log data to include with this event.
12-05 14:52:16.376 13234-13236/com.cantalk.ruen.dialogs D/dalvikvm: GC_CONCURRENT freed 384K, 5% free 10139K/10631K, paused 1ms+1ms
12-05 14:52:16.376 13234-13277/com.cantalk.ruen.dialogs V/FA: Connecting to remote service
12-05 14:52:16.376 13234-13277/com.cantalk.ruen.dialogs W/GooglePlayServicesUtil: Google Play services out of date.  Requires 11720000 but found 9256030
12-05 14:52:16.376 13234-13277/com.cantalk.ruen.dialogs V/FA: Recording user engagement, ms: 3543
12-05 14:52:16.376 13234-13277/com.cantalk.ruen.dialogs D/FA: Logging event (FE): user_engagement(_e), Bundle[{firebase_event_origin(_o)=auto, firebase_screen_id(_si)=184663540899271273, engagement_time_msec(_et)=3543, firebase_screen_class(_sc)=DonationActivity}]
12-05 14:52:16.386 13234-13277/com.cantalk.ruen.dialogs V/FA: Connection attempt already in progress
12-05 14:52:16.406 13234-13236/com.cantalk.ruen.dialogs D/dalvikvm: GC_CONCURRENT freed 453K, 6% free 10123K/10695K, paused 0ms+0ms
12-05 14:52:16.406 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Closing open sessions.
12-05 14:52:16.406 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Closing session: 5A26B2850090-0001-33B2-7685F7DB472C
12-05 14:52:16.406 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Collecting session parts for ID 5A26B2850090-0001-33B2-7685F7DB472C
12-05 14:52:16.406 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Session 5A26B2850090-0001-33B2-7685F7DB472C has fatal exception: true
12-05 14:52:16.406 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Session 5A26B2850090-0001-33B2-7685F7DB472C has non-fatal exceptions: false
12-05 14:52:16.406 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Collecting SessionStart data for session ID 5A26B2850090-0001-33B2-7685F7DB472C
12-05 14:52:16.406 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Collecting SessionUser data for session ID 5A26B2850090-0001-33B2-7685F7DB472C
12-05 14:52:16.406 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Collecting SessionApp data for session ID 5A26B2850090-0001-33B2-7685F7DB472C
12-05 14:52:16.406 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Collecting SessionOS data for session ID 5A26B2850090-0001-33B2-7685F7DB472C
12-05 14:52:16.406 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Collecting SessionDevice data for session ID 5A26B2850090-0001-33B2-7685F7DB472C
12-05 14:52:16.406 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Removing session part files for ID 5A26B2850090-0001-33B2-7685F7DB472C
12-05 14:52:16.406 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Opening a new session with ID 5A26B2A0019E-0002-33B2-7685F7DB472C
12-05 14:52:16.406 13234-13262/com.cantalk.ruen.dialogs D/Beta: Beta device token present: false
12-05 14:52:16.406 13234-13262/com.cantalk.ruen.dialogs D/Fabric: Falling back to Crashlytics key lookup from Manifest
12-05 14:52:16.406 13234-13262/com.cantalk.ruen.dialogs D/Fabric: Falling back to Crashlytics key lookup from Strings
12-05 14:52:16.406 13234-13262/com.cantalk.ruen.dialogs D/Fabric: Falling back to Crashlytics key lookup from Manifest
12-05 14:52:16.406 13234-13262/com.cantalk.ruen.dialogs D/Fabric: Falling back to Crashlytics key lookup from Strings
12-05 14:52:16.416 13234-13234/com.cantalk.ruen.dialogs D/CrashlyticsCore: Crashlytics completed exception processing. Invoking default exception handler.
12-05 14:52:16.416 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Attempting to send crash report at time of crash...
12-05 14:52:16.416 13234-13234/com.cantalk.ruen.dialogs E/AndroidRuntime: FATAL EXCEPTION: main
                                                                        java.lang.ArrayIndexOutOfBoundsException: length=2; index=10
                                                                            at lr.f(Unknown Source)
                                                                            at dm.c(Unknown Source)
                                                                            at com.cantalk.application.DonationActivity$1.onProgressChanged(Unknown Source)
                                                                            at android.widget.SeekBar.onProgressRefresh(SeekBar.java:89)
                                                                            at android.widget.ProgressBar.doRefreshProgress(ProgressBar.java:609)
                                                                            at android.widget.ProgressBar.refreshProgress(ProgressBar.java:621)
                                                                            at android.widget.ProgressBar.setProgress(ProgressBar.java:670)
                                                                            at android.widget.AbsSeekBar.trackTouchEvent(AbsSeekBar.java:411)
                                                                            at android.widget.AbsSeekBar.onTouchEvent(AbsSeekBar.java:349)
                                                                            at android.view.View.dispatchTouchEvent(View.java:5541)
                                                                            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
                                                                            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
                                                                            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
                                                                            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
                                                                            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
                                                                            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
                                                                            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
                                                                            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
                                                                            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
                                                                            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
                                                                            at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1912)
                                                                            at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1371)
                                                                            at android.app.Activity.dispatchTouchEvent(Activity.java:2364)
                                                                            at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1860)
                                                                            at android.view.View.dispatchPointerEvent(View.java:5721)
                                                                            at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:2890)
                                                                            at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2466)
                                                                            at android.view.ViewRootImpl.processInputEvents(ViewRootImpl.java:845)
                                                                            at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2475)
                                                                            at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                            at android.os.Looper.loop(Looper.java:137)
                                                                            at android.app.ActivityThread.main(ActivityThread.java:4424)
                                                                            at java.lang.reflect.Method.invokeNative(Native Method)
                                                                            at java.lang.reflect.Method.invoke(Method.java:511)
                                                                            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
                                                                            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
                                                                            at dalvik.system.NativeStart.main(Native Method)
12-05 14:52:16.736 13234-13236/com.cantalk.ruen.dialogs D/dalvikvm: GC_CONCURRENT freed 394K, 6% free 10113K/10695K, paused 1ms+1ms
12-05 14:52:16.896 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Adding single file 5A26B2850090-0001-33B2-7685F7DB472C.cls to report 5A26B2850090-0001-33B2-7685F7DB472C
12-05 14:52:16.896 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Sending report to: https://reports.crashlytics.com/spi/v1/platforms/android/apps/com.cantalk.ruen.dialogs/reports
12-05 14:52:16.916 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: threadid=3: reacting to signal 3
12-05 14:52:16.916 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
12-05 14:52:17.176 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Create report request ID: null
12-05 14:52:17.176 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Result was: 202
12-05 14:52:17.176 13234-13262/com.cantalk.ruen.dialogs I/CrashlyticsCore: Crashlytics report upload complete: 5A26B2850090-0001-33B2-7685F7DB472C
12-05 14:52:17.176 13234-13262/com.cantalk.ruen.dialogs D/CrashlyticsCore: Removing report at /data/data/com.cantalk.ruen.dialogs/files/.Fabric/com.crashlytics.sdk.android.crashlytics-core/fatal-sessions/5A26B2850090-0001-33B2-7685F7DB472C.cls
12-05 14:52:17.416 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: threadid=3: reacting to signal 3
12-05 14:52:17.426 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
12-05 14:52:17.926 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: threadid=3: reacting to signal 3
12-05 14:52:17.926 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
12-05 14:52:18.426 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: threadid=3: reacting to signal 3
12-05 14:52:18.426 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
12-05 14:52:18.926 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: threadid=3: reacting to signal 3
12-05 14:52:18.926 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
12-05 14:52:19.426 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: threadid=3: reacting to signal 3
12-05 14:52:19.426 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
12-05 14:52:19.926 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: threadid=3: reacting to signal 3
12-05 14:52:19.926 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
12-05 14:52:20.426 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: threadid=3: reacting to signal 3
12-05 14:52:20.426 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
12-05 14:52:20.936 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: threadid=3: reacting to signal 3
12-05 14:52:20.936 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
12-05 14:52:21.436 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: threadid=3: reacting to signal 3
12-05 14:52:21.436 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
12-05 14:52:21.936 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: threadid=3: reacting to signal 3
12-05 14:52:21.936 13234-13237/com.cantalk.ruen.dialogs I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
12-05 14:52:22.246 13234-13234/? I/Process: Sending signal. PID: 13234 SIG: 9

Body:
Try this -

if (!BuildConfig.DEBUG) {
                FirebaseCrash.log("this is a crash"));
                FirebaseCrash.report("any error logs or object");
            }


来源: stackexchange

问:
How to Pass parameters to PowerShell script while building from VSTS
I am running the below PowerShell Script to deploy csv file data into Azure table storage. But The below parameters are different for different environment in the azure.Suppose the below script can be deployed to any environment but the below parameters will be varied as per the environment.So I want to pass the below parameters to the script while running from the PowerShell task in VSTS.How to accomplish task.Please help me out on this.So

```<code>**$subscriptionName = "Tech Enabled Solutions"
$resourceGroupName = "abc"
$storageAccountName = "defghi"
$location = "North Central US, South Central US"
$StorageAccountKey = "12345678"**
</code>```

PowerShell Script:

```<code>   function Add-Entity()
{
 [CmdletBinding()]

 param
 (
 $table,
 [string] $partitionKey,
 [string] $RowKey,
 [string] $Label_Usage,
 [string] $Label_Value,
 [string] $Usage_Location,
 [string] $subscriptionName,
 [string] $resourceGroupName,
 [string] $storageAccountName,
 [string] $location,
 [string] $StorageAccountKey
)

 $entity = New-Object -TypeName Microsoft.WindowsAzure.Storage.Table.DynamicTableEntity -ArgumentList $partitionKey, $rowKey
 $entity.Properties.Add("Label_Value",$Label_Value)
 $entity.Properties.Add("Label_Usage",$Label_Usage)
 $entity.Properties.Add("Usage_Location",$Usage_Location)
 $result = $table.CloudTable.Execute([Microsoft.WindowsAzure.Storage.Table.TableOperation]::InsertOrReplace($entity))
}
$tableName = "sampletable"

# Get a storage context
$ctx = New-AzureStorageContext $StorageAccountName $StorageAccountKey

# Get a reference to the table
$table = Get-AzureStorageTable -Name $tableName -Context $ctx -ErrorAction Ignore
$csv = Import-CSV "d:\a\1\s\DeploymentScripts\sampletable.csv"

ForEach ($line in $csv)
{
 Add-Entity -Table $table -partitionKey $line.partitionkey -rowKey $line.RowKey -Label_Usage $line.Label_Usage -Label_Value $line.Label_Value -Usage_Location $line.Usage_Location

}
</code>```

答:
You need to use the arguments text box to pass your parameters into the script (either inline or script file).

Your script would need to look like this:

```<code>param (
    [string] $table,
    [string] $partitionKey,
    [string] $RowKey,
    [string] $Label_Usage,
    [string] $Label_Value,
    [string] $Usage_Location,
    [string] $subscriptionName,
    [string] $resourceGroupName,
    [string] $storageAccountName,
    [string] $location,
    [string] $StorageAccountKey
)

    $entity = New-Object -TypeName Microsoft.WindowsAzure.Storage.Table.DynamicTableEntity -ArgumentList $partitionKey, $rowKey
    $entity.Properties.Add("Label_Value",$Label_Value)
    $entity.Properties.Add("Label_Usage",$Label_Usage)
    $entity.Properties.Add("Usage_Location",$Usage_Location)
    $result = $table.CloudTable.Execute([Microsoft.WindowsAzure.Storage.Table.TableOperation]::InsertOrReplace($entity))
    $tableName = "sampletable"

    # Get a storage context
    $ctx = New-AzureStorageContext $StorageAccountName $StorageAccountKey

    # Get a reference to the table
    $table = Get-AzureStorageTable -Name $tableName -Context $ctx -ErrorAction Ignore
    $csv = Import-CSV "d:\a\1\s\DeploymentScripts\sampletable.csv"

    ForEach ($line in $csv)
    {
        Add-Entity -Table $table -partitionKey $line.partitionkey -rowKey $line.RowKey -Label_Usage $line.Label_Usage -Label_Value $line.Label_Value -Usage_Location $line.Usage_Location
    }
</code>```

Each of your variables will either need to be defaulted or passed in as arguments. In your example, you would look something like the following in the text box:

-subscriptionName "Tech Enabled Solutions" -$resourceGroupName "abc" -storageAccountName "defghi" -location "North Central US, South Central US" -StorageAccountKey "12345678

The box is expecting you input the arguments exactly as you would if you were calling the PowerShell script from the command line.

ContentLicense: CC BY-SA 3.0

Body:
I am running the below PowerShell Script to deploy csv file data into Azure table storage. But The below parameters are different for different environment in the azure.Suppose the below script can be deployed to any environment but the below parameters will be varied as per the environment.So I want to pass the below parameters to the script while running from the PowerShell task in VSTS.How to accomplish task.Please help me out on this.So

**$subscriptionName = "Tech Enabled Solutions"
$resourceGroupName = "abc"
$storageAccountName = "defghi"
$location = "North Central US, South Central US"
$StorageAccountKey = "12345678"**

PowerShell Script:

   function Add-Entity()
{
 [CmdletBinding()]

 param
 (
 $table,
 [string] $partitionKey,
 [string] $RowKey,
 [string] $Label_Usage,
 [string] $Label_Value,
 [string] $Usage_Location,
 [string] $subscriptionName,
 [string] $resourceGroupName,
 [string] $storageAccountName,
 [string] $location,
 [string] $StorageAccountKey
)

 $entity = New-Object -TypeName Microsoft.WindowsAzure.Storage.Table.DynamicTableEntity -ArgumentList $partitionKey, $rowKey
 $entity.Properties.Add("Label_Value",$Label_Value)
 $entity.Properties.Add("Label_Usage",$Label_Usage)
 $entity.Properties.Add("Usage_Location",$Usage_Location)
 $result = $table.CloudTable.Execute([Microsoft.WindowsAzure.Storage.Table.TableOperation]::InsertOrReplace($entity))
}
$tableName = "sampletable"

# Get a storage context
$ctx = New-AzureStorageContext $StorageAccountName $StorageAccountKey

# Get a reference to the table
$table = Get-AzureStorageTable -Name $tableName -Context $ctx -ErrorAction Ignore
$csv = Import-CSV "d:\a\1\s\DeploymentScripts\sampletable.csv"

ForEach ($line in $csv)
{
 Add-Entity -Table $table -partitionKey $line.partitionkey -rowKey $line.RowKey -Label_Usage $line.Label_Usage -Label_Value $line.Label_Value -Usage_Location $line.Usage_Location

}

Body:
You need to use the arguments text box to pass your parameters into the script (either inline or script file).

Your script would need to look like this:

param (
    [string] $table,
    [string] $partitionKey,
    [string] $RowKey,
    [string] $Label_Usage,
    [string] $Label_Value,
    [string] $Usage_Location,
    [string] $subscriptionName,
    [string] $resourceGroupName,
    [string] $storageAccountName,
    [string] $location,
    [string] $StorageAccountKey
)

    $entity = New-Object -TypeName Microsoft.WindowsAzure.Storage.Table.DynamicTableEntity -ArgumentList $partitionKey, $rowKey
    $entity.Properties.Add("Label_Value",$Label_Value)
    $entity.Properties.Add("Label_Usage",$Label_Usage)
    $entity.Properties.Add("Usage_Location",$Usage_Location)
    $result = $table.CloudTable.Execute([Microsoft.WindowsAzure.Storage.Table.TableOperation]::InsertOrReplace($entity))
    $tableName = "sampletable"

    # Get a storage context
    $ctx = New-AzureStorageContext $StorageAccountName $StorageAccountKey

    # Get a reference to the table
    $table = Get-AzureStorageTable -Name $tableName -Context $ctx -ErrorAction Ignore
    $csv = Import-CSV "d:\a\1\s\DeploymentScripts\sampletable.csv"

    ForEach ($line in $csv)
    {
        Add-Entity -Table $table -partitionKey $line.partitionkey -rowKey $line.RowKey -Label_Usage $line.Label_Usage -Label_Value $line.Label_Value -Usage_Location $line.Usage_Location
    }

Each of your variables will either need to be defaulted or passed in as arguments. In your example, you would look something like the following in the text box:

-subscriptionName "Tech Enabled Solutions" -$resourceGroupName "abc" -storageAccountName "defghi" -location "North Central US, South Central US" -StorageAccountKey "12345678

The box is expecting you input the arguments exactly as you would if you were calling the PowerShell script from the command line.


问:
A Persistent Store for Increment/Decrementing Integers Easily and Quickly
Does there exist some sort of persistent key-value like store that allows for quick and easy incrementing, decrementing, and retrieval of integers (and nothing else). I know that I could implement something with a SQL database, but I see two drawbacks to that:

It's heavyweight for the task at hand. All I need is the ability to say "server[key].inc()" or "server[key].dec()"

I need the ability to handle potentially thousands of writes to a single key simultaneously. I don't want to deal with excessive resource contention. Change the value and get out - that's all I need.

I know memcached supports inc/dec, but it's not persistent. My strategy at this point is going to be to use a SQL server behind a queueing system of some sort such that there's only one process updating the database. It just seems... harder than it should be.

Is there something someone can recommend?

答: Redis is a key-value store that supports several data types. Integer is present, along with incr and decr commands.</p>

ContentLicense: CC BY-SA 2.5


问:
Javascript-searching for a string in the properties of an array of objects
I have an array of JSON objects. Given a search string, I want to filter the array for only those objects which have that string as a substring of one of their properties. How do I do this efficiently?</p>

答:
Maybe you want to do something like this:</p>

```<code>var list = [
    {var1: "value1", var2: "value2", var3: "value3"},
    {var1: "value4", var2: "value5", var3: "value6"},
    {var1: "value4", var2: "value3", var3: "value2"},
    {var1: "value2", var2: "value8", var3: "value6"},
    {var1: "value1", var2: "value7", var3: "value7"},
    {var1: "value1", var2: "value6", var3: "value2"},
];

var searchString = "value2";

var newList = list.filter(element => {
    for (var property in element) {
        if (element.hasOwnProperty(property)) {
            if(element[property] == searchString) {
                return true;
            }
        }
    }
});

console.log(newList);
</code>```

Body:
Maybe you want to do something like this:

var list = [
    {var1: "value1", var2: "value2", var3: "value3"},
    {var1: "value4", var2: "value5", var3: "value6"},
    {var1: "value4", var2: "value3", var3: "value2"},
    {var1: "value2", var2: "value8", var3: "value6"},
    {var1: "value1", var2: "value7", var3: "value7"},
    {var1: "value1", var2: "value6", var3: "value2"},
];

var searchString = "value2";

var newList = list.filter(element => {
    for (var property in element) {
        if (element.hasOwnProperty(property)) {
            if(element[property] == searchString) {
                return true;
            }
        }
    }
});

console.log(newList);


问:
How to log in LibGdx while running desktop:run?
I cannot see logs when I run desktop:run on Android Studio.
My log message is simple:

```<code>@Override
public void show() {
    spriteBatch = new SpriteBatch();
    viewport = new ExtendViewport(WORLD_WIDTH, WORLD_HEIGHT);
    buttonNewGame = EpheButton.newInstance(
            "New Game",
            WORLD_WIDTH / 2,
            WORLD_HEIGHT - 50,
            viewport.getCamera().combined);
    Gdx.app.log("Tag", "Debug message");

}
</code>```

Should I edit the configuration for the desktop:run task?

答:
You need to check log level setting. Your issue looks like log level Application.LOG_NONE is enabled:

```<code>Gdx.app.setLogLevel(Application.LOG_NONE);
</code>```

Don't use System.out.println("Your log") - it's not logging system. With it you miss cross platform logging benefits of LibGDX:

Depending on the platform, the messages are logged to the console (desktop), LogCat (Android) or a GWT TextArea provided in the GwtApplicationConfiguration or created automatically (html5).

Read more about LibGDX logging system

Body:
I cannot see logs when I run desktop:run on Android Studio.
My log message is simple:

@Override
public void show() {
    spriteBatch = new SpriteBatch();
    viewport = new ExtendViewport(WORLD_WIDTH, WORLD_HEIGHT);
    buttonNewGame = EpheButton.newInstance(
            "New Game",
            WORLD_WIDTH / 2,
            WORLD_HEIGHT - 50,
            viewport.getCamera().combined);
    Gdx.app.log("Tag", "Debug message");

}

Should I edit the configuration for the desktop:run task?

Body:
You need to check log level setting. Your issue looks like log level Application.LOG_NONE is enabled:

Gdx.app.setLogLevel(Application.LOG_NONE);

Don't use System.out.println("Your log") - it's not logging system. With it you miss cross platform logging benefits of LibGDX:

Depending on the platform, the messages are logged to the console (desktop), LogCat (Android) or a GWT TextArea provided in the GwtApplicationConfiguration or created automatically (html5).

Read more about LibGDX logging system


问:
function requiring more than one return statements
I am posting here two functions. In the findPrime(int m, int i, int n) I have one outer if and outer else block from both the block I am getting return so it can be considered that the function is returning something I put same structure in endOther(String a, String b) i.e.
there are two main if-else blocks both are returning value as per function's return type so we can say that function is returning something but the endOther(String a, String b)
function is throwing compile time error saying that put return statement while first function is not throwing such error. I am not understanding this issue please help me. Type both the functions in eclipse and check

1.

```<code>static boolean findPrime(int m, int i, int n){
    if(n == 0 || n == 1)
        return false;
    else {
        if(i <= m) {
            if(n%i == 0)
                //if(m%i == 0)
                return false;
            else {
                i++;
                //return findPrime(m,i);
                return findPrime(m,i,n);
            }

        }
        else {
            return true;
        }
    }
}
</code>```

2.

```<code>public boolean endOther(String a, String b) {
    if(a.length()==b.length()) {
        if(a.equals(b))
            return true;
        else
            return false;
    }
    else {
        if(a.length()>b.length()) {
            if(a.substring(a.length()-b.length(),b.length()).equals(b))
                return true;
        }
        else {
            if(b.substring(b.length()-a.length(),a.length()).equals(a))
                return true;
            else
                return false;
        }
    }
}
</code>```

答:
Your endOther function must return a value on all possible execution paths. In case a.length() > b.length() the return may not be executed based on the condition of the inner if.

```<code>public boolean endOther(String a, String b) {
    if(a.length()==b.length()) {
        if(a.equals(b))
            return true;
        else
            return false;
    }
    else {
        if(a.length()>b.length()) {
            // IF THIS FAILS THERE IS NO RETURN!
            if(a.substring(a.length()-b.length(),b.length()).equals(b))
                return true;
        }
        else {
            if(b.substring(b.length()-a.length(),a.length()).equals(a))
                return true;
            else
                return false;
        }
    }
}
</code>```

As a general note, you could use some of the methods in String to improve your code, e.g. String.endsWith instead of the substring operation. This would be more readable. a and b being identical is a special case of String.endsWith, so the following should be equivalent:

```<code>public boolean endOther(String a, String b) {
    return a.endsWith(b) || b.endsWith(a);
}
</code>```

Body:
I am posting here two functions. In the findPrime(int m, int i, int n) I have one outer if and outer else block from both the block I am getting return so it can be considered that the function is returning something I put same structure in endOther(String a, String b) i.e.
there are two main if-else blocks both are returning value as per function's return type so we can say that function is returning something but the endOther(String a, String b)
function is throwing compile time error saying that put return statement while first function is not throwing such error. I am not understanding this issue please help me. Type both the functions in eclipse and check

1.

static boolean findPrime(int m, int i, int n){
    if(n == 0 || n == 1)
        return false;
    else {
        if(i <= m) {
            if(n%i == 0)
                //if(m%i == 0)
                return false;
            else {
                i++;
                //return findPrime(m,i);
                return findPrime(m,i,n);
            }

        }
        else {
            return true;
        }
    }
}

2.

public boolean endOther(String a, String b) {
    if(a.length()==b.length()) {
        if(a.equals(b))
            return true;
        else
            return false;
    }
    else {
        if(a.length()>b.length()) {
            if(a.substring(a.length()-b.length(),b.length()).equals(b))
                return true;
        }
        else {
            if(b.substring(b.length()-a.length(),a.length()).equals(a))
                return true;
            else
                return false;
        }
    }
}

Body:
Your endOther function must return a value on all possible execution paths. In case a.length() > b.length() the return may not be executed based on the condition of the inner if.

public boolean endOther(String a, String b) {
    if(a.length()==b.length()) {
        if(a.equals(b))
            return true;
        else
            return false;
    }
    else {
        if(a.length()>b.length()) {
            // IF THIS FAILS THERE IS NO RETURN!
            if(a.substring(a.length()-b.length(),b.length()).equals(b))
                return true;
        }
        else {
            if(b.substring(b.length()-a.length(),a.length()).equals(a))
                return true;
            else
                return false;
        }
    }
}

As a general note, you could use some of the methods in String to improve your code, e.g. String.endsWith instead of the substring operation. This would be more readable. a and b being identical is a special case of String.endsWith, so the following should be equivalent:

public boolean endOther(String a, String b) {
    return a.endsWith(b) || b.endsWith(a);
}


问:
Elasticsearch query to find documents with number of values of a term equal to a specified number
I have an Elasticsearch index "library" with below mapping:

```<code>{
  "mappings": {
    "book": {
      "properties": {
        "title":    { "type": "text", "index": "not_analyzed" },
        "author":   { "type": "text", "index": "not_analyzed" },
        "price":    { "type": "integer" },
    }
  }
}
</code>```

Now I want make a query to find all documents(book) where number of author is equal to 3. i.e. I want to make a query which will match

```<code>curl -XGET "http://localhost:9200/library/_search?pretty=true" -d '{
    "query": {
        "match": {
            Number of values of term "author" = 3.
        }
    }
}'
</code>```

Is there any way to make such an query without adding an extra term?

[I know the aggregation to find all possible values of a term in search result but wasn't able to convert that aggregation in according to above criteria.]

答:
Can't find a way to get exactly each author with 3 documents.
Aggregation will give you all possible values. But, it also show you the doc_count - and there we can find our way:

```<code>{
  "size": 0,
  "aggregations": {
    "authors": {
      "terms": {
        "field": "author",
        "min_doc_count": 3,
        "size": 5
      }
    }
  }
}
</code>```

min_doc_count - will filter only buckets with, at least, 3 documents.

size - will give you only first 5 documents (remember that, by default, buckets are sorted by 'doc_count' ascending).

Now you can adjust size to get exactly those authors with 3 documents.

Body:
I have an Elasticsearch index "library" with below mapping:

{
  "mappings": {
    "book": {
      "properties": {
        "title":    { "type": "text", "index": "not_analyzed" },
        "author":   { "type": "text", "index": "not_analyzed" },
        "price":    { "type": "integer" },
    }
  }
}

Now I want make a query to find all documents(book) where number of author is equal to 3. i.e. I want to make a query which will match

curl -XGET "http://localhost:9200/library/_search?pretty=true" -d '{
    "query": {
        "match": {
            Number of values of term "author" = 3.
        }
    }
}'

Is there any way to make such an query without adding an extra term?

[I know the aggregation to find all possible values of a term in search result but wasn't able to convert that aggregation in according to above criteria.]

Body:
Can't find a way to get exactly each author with 3 documents.
Aggregation will give you all possible values. But, it also show you the doc_count - and there we can find our way:

{
  "size": 0,
  "aggregations": {
    "authors": {
      "terms": {
        "field": "author",
        "min_doc_count": 3,
        "size": 5
      }
    }
  }
}

min_doc_count - will filter only buckets with, at least, 3 documents.

size - will give you only first 5 documents (remember that, by default, buckets are sorted by 'doc_count' ascending).

Now you can adjust size to get exactly those authors with 3 documents.


问:
how to change directory to a path stored in variable bash
I'm trying to change the CD to a path stored in a variable. The variable gets its value from text stored in a file.

This gets the value inside the text file:

```<code>devdir=$(<\$HOME/devdir.txt)
cd $devdir
</code>```

Inside the text file is the text: $HOME/bin

The error I get is:

```<code>/bin/dev: line 41: cd: $HOME/bin: No such file or directory
</code>```

This is the result of trying to use the variable, compared to manually typing it:

UPDATE:
This is the snippet of Bash given with the improvement given by fabiotk, which seems to yield no result when it is within the script, however it works fine when run in the cmd window...Snippet

Here is the entire script so far: script
and here is me running the given line on its own, then running the script showing it doesn't work inside: enter image description here

答:
The value of $HOME is not getting expanded.  If you want to expand it, the eval posted in another answer might help; but we generally want to avoid eval if we can, especially if you only need this specific variable to be expanded.

```<code>devdir=$(sed "s%^\$HOME/%$HOME/%" $HOME/devdir.txt)
</code>```

Body:
I'm trying to change the CD to a path stored in a variable. The variable gets its value from text stored in a file.

This gets the value inside the text file:

devdir=$(<\$HOME/devdir.txt)
cd $devdir

Inside the text file is the text: $HOME/bin

The error I get is:

/bin/dev: line 41: cd: $HOME/bin: No such file or directory

This is the result of trying to use the variable, compared to manually typing it:

UPDATE:
This is the snippet of Bash given with the improvement given by fabiotk, which seems to yield no result when it is within the script, however it works fine when run in the cmd window...Snippet

Here is the entire script so far: script
and here is me running the given line on its own, then running the script showing it doesn't work inside: enter image description here

Body:
The value of $HOME is not getting expanded.  If you want to expand it, the eval posted in another answer might help; but we generally want to avoid eval if we can, especially if you only need this specific variable to be expanded.

devdir=$(sed "s%^\$HOME/%$HOME/%" $HOME/devdir.txt)


问:
Calling AppEngine from Firebase Functions
I couldn't find any resource about how to call an App Engine Service from a
Firebase function

I know I could call it by the URL but in that case it would be an external call and it would apply charges to it.

Besides in every video they say it's posible to access Google API's
Did I understand it bad or there is a API call for App Engine?

Thanks!

答:
You cannot access the App Engine service internally, through the private network of your Google Cloud Project. Only specific Products are interconnected in your Virtual Private Cloud, as specified here.

The API for App Engine can have two meanings:

The Google App Engine Admin API - this allows you to manage your App Engine deployments programmatically through a REST API service. All the interactions available through the Console (web browser), and maybe more, are available through these API endpoints. Google's API Explorer is a tool which brings together all available API endpoints for Google services.

You can enable your own API endpoints for the services that you have deployed in your App Engine - this time it is you who defines what will the actual endpoints be and how requests to that endpoints are treated (i.e. by your App Engine app). These are still external calls between Firebase and App Engine. They will go through the Internet.


问:
Analysis of list elements
I have a list of strings of variable length, from which I should remove elements of a certain length ONLY IF all the elements don't have the same length.

e.g.:

```<code>my_list = ['a', 'b', 'c'] # should remains the same (all elements have the same lenght)
</code>```

but:

```<code>my_list = ['a', 'ab', 'abc', 'abcd', 'b', 'bcd'] # 'a' and 'b' because their length is <2.
</code>```

Any ideas?

答:
```<code>def funtion(list, length):
    my_list_len = len(list)
    for i in range(my_list_len - 1):
        if len(list[i]) != len(list[i + 1]):
            for j in range(my_list_len - 1, -1, -1):
                if len(list[j]) < length:
                    list.pop(j)

            break
    return list
</code>```

Function

```<code>list = ['a', 'ab', 'abc', 'abcd', 'b', 'bcd']
list2 = funtion(list, 2)
</code>```

return

```<code>['ab', 'abc', 'abcd', 'bcd']
</code>```

Title: Analysis of list elements

Body:
I have a list of strings of variable length, from which I should remove elements of a certain length ONLY IF all the elements don't have the same length.

e.g.:

my_list = ['a', 'b', 'c'] # should remains the same (all elements have the same lenght)

but:

my_list = ['a', 'ab', 'abc', 'abcd', 'b', 'bcd'] # 'a' and 'b' because their length is <2.

Any ideas?

Body:
def funtion(list, length):
    my_list_len = len(list)
    for i in range(my_list_len - 1):
        if len(list[i]) != len(list[i + 1]):
            for j in range(my_list_len - 1, -1, -1):
                if len(list[j]) < length:
                    list.pop(j)

            break
    return list

Function

list = ['a', 'ab', 'abc', 'abcd', 'b', 'bcd']
list2 = funtion(list, 2)

return

['ab', 'abc', 'abcd', 'bcd']


问:
How to animate background-color center to right and left like google form?
i really lack of css animation. i try to create animation effect on div like google form.

if above link not work (like in my pc now), you can see it here https://ibb.co/cYsYKb

i try transition: all 1s ease; background: linear-gradient(to right, #673ab7);  but not work.

this is my fiddle: https://jsfiddle.net/hL8mncqa/

i try to find it in google, but still cant solve my problem, since i dont know what keyword to find it.

How to do this? any advice are welcome.

答:
You can do it with the CSS3 Animation:

$(function(){
  $('body').on('focus', 'textarea', function(){
    $(this).next().addClass('active');
  });

  $('body').on('focusout', 'textarea', function(){
    $(this).next().removeClass('active');
  });
});```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body {
  background: #fff;
}
.container {
  position: relative; /* needs to be set since the child has position absolute */
}
textarea {
  width: 100%;
  border: 0;
  outline: 0;
}
.txt-underline {
  background: rgba(0,0,0,0.12);
  height: 1px;
  /* to grow from center: */
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.txt-underline.active {
  background: #673ab7;
  height: 2px;
  animation-name: underline; /* "calling" the animation */
  animation-duration: .3s; /* adjust to your needs */
  animation-timing-function: ease; /* also experiment with other values */
  animation-fill-mode: forwards; /* retains 100% width when it gets there */
}
@keyframes underline { /* lets call it the "underline" */
  0%   {width:0} /* start width */
  100% {width:100%} /* end width */
}</code>```

  <textarea>asddas dasdasdas asdas</textarea>

```

ContentLicense: CC BY-SA 4.0

Body:
You can do it with the CSS3 Animation:

$(function(){
  $('body').on('focus', 'textarea', function(){
    $(this).next().addClass('active');
  });

  $('body').on('focusout', 'textarea', function(){
    $(this).next().removeClass('active');
  });
});

body {
  background: #fff;
}
.container {
  position: relative; /* needs to be set since the child has position absolute */
}
textarea {
  width: 100%;
  border: 0;
  outline: 0;
}
.txt-underline {
  background: rgba(0,0,0,0.12);
  height: 1px;
  /* to grow from center: */
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.txt-underline.active {
  background: #673ab7;
  height: 2px;
  animation-name: underline; /* "calling" the animation */
  animation-duration: .3s; /* adjust to your needs */
  animation-timing-function: ease; /* also experiment with other values */
  animation-fill-mode: forwards; /* retains 100% width when it gets there */
}
@keyframes underline { /* lets call it the "underline" */
  0%   {width:0} /* start width */
  100% {width:100%} /* end width */
}

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

<div class="container">
  <textarea>asddas dasdasdas asdas</textarea>
  <div class="txt-underline"></div>
</div>


答:
You could use the filter method to filter the array and then use the Object.keys function to get an array of keys on the current object.  You can then loop over each key and check if it has the substring (I added some guards to protect against calling .indexOf on an identifier without that method.)

```<code>const search = 'xyz';
const data = yourDataFunction();
const filteredData = data.filter(item => {
  let found = false;
  Object.keys(item).forEach(key => {
    if (item[key] && item[key].indexOf && item[key].indexOf(search) > -1) {
      found = true;
    }
  });
  return found;
});
</code>```

Title: Javascript-searching for a string in the properties of an array of objects

Body: I have an array of JSON objects. Given a search string, I want to filter the array for only those objects which have that string as a substring of one of their properties. How do I do this efficiently?

Body:
You could use the filter method to filter the array and then use the Object.keys function to get an array of keys on the current object.  You can then loop over each key and check if it has the substring (I added some guards to protect against calling .indexOf on an identifier without that method.)

const search = 'xyz';
const data = yourDataFunction();
const filteredData = data.filter(item => {
  let found = false;
  Object.keys(item).forEach(key => {
    if (item[key] && item[key].indexOf && item[key].indexOf(search) > -1) {
      found = true;
    }
  });
  return found;
});


问:
Xcode 4 beta not working
I downloaded and installed Xcode 4 Developer Preview 6 (January 10, 2011 /  Build: 4A251a )
After the installation i see my old version 3.2.5

any idea why this is not working ?

cheers endo

EDIT: My solution was to fully uninstall Xcode then install the xcode 4 Developer Preview

sudo Developer/Library/uninstall-devtools --mode=all

答: Have you tried removing the old Xcode before installing the new one? Also, did you move the Developer directory from where it was originally located?</p>

Title: Xcode 4 beta not working


问:
Acces Outlook via Visual Basic error
I'm trying to create a program which retrieves all emails from Outlook's(2007 desktop version) Inbox and puts them into a DataGridView.

Code:

```<code>Imports Outlook = Microsoft.Office.Interop.Outlook

Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    Dim dt As DataTable
    Try
        Dim app As Outlook.Application = New Outlook.Application()
        Dim ns As Outlook.[NameSpace] = app.GetNamespace("MAPI")
        Dim inbox As Outlook.MAPIFolder = ns.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox)
        ns.SendAndReceive(True)
        dt = New DataTable("Inbox")
        dt.Columns.Add("Subject", GetType(String))
        dt.Columns.Add("Sender", GetType(String))
        dt.Columns.Add("Body", GetType(String))
        dt.Columns.Add("Date", GetType(String))
        DataGridView1.DataSource = dt
        For Each item As Object In inbox.Items
            If TypeOf item Is Outlook.MailItem Then
                Dim item1 As Outlook.MailItem = CType(item, Outlook.MailItem)
                dt.Rows.Add(New Object() {item1.Subject, item1.Sender, item1.HTMLBody, item1.SentOn.ToLongDateString() & "" + item1.SentOn.ToLongTimeString()})
            End If
        Next
        MessageBox.Show("done")
    Catch ex As Exception
        MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.[Error])
    End Try
End Sub
End Class
</code>```

When I try to Build the project I'm getting the follow error:

System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))

UPDATE

I've changed the Compiler CPU to x86 and x64, this does not solve the error.

Target platform

答:
try this method and Send arguments to it such as Subject,body,Toaddress,filename...Im Sure this will works..

```<code>Private Sub SendfromOutlook(sSubject As String, sBody As String, sTo As String, sFilename As String)
    Dim oApp As Interop.Outlook._Application
    oApp = New Interop.Outlook.Application
    Dim oMsg As Interop.Outlook._MailItem

    Dim strS As String()
    strS = sTo.Split(",")
    For i As Integer = 0 To strS.Length - 1

        oMsg = oApp.CreateItem(Interop.Outlook.OlItemType.olMailItem)
        oMsg.Subject = sSubject
        oMsg.Body = sBody
        oMsg.To = strS(i)

        Dim str As String = sFilename

        If sFilename <> "" Then

            Dim sBodyLen As Integer = Int(sBody.Length)
            Dim oAttachs As Interop.Outlook.Attachments = oMsg.Attachments
            Dim oAttach As Interop.Outlook.Attachment
            oAttach = oAttachs.Add(str, , sBodyLen)

        End If

        oMsg.Send()

    Next
    MessageBox.Show("EMail Sent Successfully!", "Information", MessageBoxButtons.OK)
    ClearAll()
End Sub
</code>```

here I use To address with "," to send Multiple mails at a time..thats why i just split it and used this functions as a looping one ( Dim strS As String() and
    strS = sTo.Split(","))

Title: Acces Outlook via Visual Basic error

Body:
I'm trying to create a program which retrieves all emails from Outlook's(2007 desktop version) Inbox and puts them into a DataGridView.

Code:

Imports Outlook = Microsoft.Office.Interop.Outlook

Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    Dim dt As DataTable
    Try
        Dim app As Outlook.Application = New Outlook.Application()
        Dim ns As Outlook.[NameSpace] = app.GetNamespace("MAPI")
        Dim inbox As Outlook.MAPIFolder = ns.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox)
        ns.SendAndReceive(True)
        dt = New DataTable("Inbox")
        dt.Columns.Add("Subject", GetType(String))
        dt.Columns.Add("Sender", GetType(String))
        dt.Columns.Add("Body", GetType(String))
        dt.Columns.Add("Date", GetType(String))
        DataGridView1.DataSource = dt
        For Each item As Object In inbox.Items
            If TypeOf item Is Outlook.MailItem Then
                Dim item1 As Outlook.MailItem = CType(item, Outlook.MailItem)
                dt.Rows.Add(New Object() {item1.Subject, item1.Sender, item1.HTMLBody, item1.SentOn.ToLongDateString() & "" + item1.SentOn.ToLongTimeString()})
            End If
        Next
        MessageBox.Show("done")
    Catch ex As Exception
        MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.[Error])
    End Try
End Sub
End Class

When I try to Build the project I'm getting the follow error:

System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))

UPDATE

I've changed the Compiler CPU to x86 and x64, this does not solve the error.

Target platform

Body:
try this method and Send arguments to it such as Subject,body,Toaddress,filename...Im Sure this will works..

Private Sub SendfromOutlook(sSubject As String, sBody As String, sTo As String, sFilename As String)
    Dim oApp As Interop.Outlook._Application
    oApp = New Interop.Outlook.Application
    Dim oMsg As Interop.Outlook._MailItem

    Dim strS As String()
    strS = sTo.Split(",")
    For i As Integer = 0 To strS.Length - 1

        oMsg = oApp.CreateItem(Interop.Outlook.OlItemType.olMailItem)
        oMsg.Subject = sSubject
        oMsg.Body = sBody
        oMsg.To = strS(i)

        Dim str As String = sFilename

        If sFilename <> "" Then

            Dim sBodyLen As Integer = Int(sBody.Length)
            Dim oAttachs As Interop.Outlook.Attachments = oMsg.Attachments
            Dim oAttach As Interop.Outlook.Attachment
            oAttach = oAttachs.Add(str, , sBodyLen)

        End If

        oMsg.Send()

    Next
    MessageBox.Show("EMail Sent Successfully!", "Information", MessageBoxButtons.OK)
    ClearAll()
End Sub

here I use To address with "," to send Multiple mails at a time..thats why i just split it and used this functions as a looping one ( Dim strS As String() and
    strS = sTo.Split(","))


问:
how to show html on pop over using angular ui bootstrap?
I make demo of pop over like this .It show a pop over on right side when I click the button .But now problem is that how I will show some html on pop over .

```<code><html ng-app="plunker">

  <head>
     <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.10/angular.js"></script>
    <script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.11.0.js"></script>
    <script src="example.js"></script>
    <link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
  </head>

  <body>
    <button popover-placement="right" popover="On the Right!" class="btn btn-default">Right</button>
  </body>
<script>
angular.module('plunker', ['ui.bootstrap']);

</script>

</html>
</code>```

I have this HTML I need to how on  add this on pop over .I know there is way in bootrap.js to add html on popover .I don't want to use that I want to use angular UI bootrap.js

```<code><div ng-controller="axcont">
<ul class="list-group">
  <li class="list-group-item" ng-click="add()">add row</li>
  <li class="list-group-item " ng-click="deleteRow($index)">Deleterow</li>

</ul>
</div>
</code>```

I did more try on that like that but getting undefined.May be I am wrong I just doing RND

```<code><html ng-app="plunker">

  <head>
     <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.10/angular.js"></script>
    <script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.11.0.js"></script>
    <script src="example.js"></script>
    <link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet"/>
  </head>

  <body>
    <button pop-over title="Mode of transport" content-url="pop.html" class="btn btn-default">Right</button>
  </body>
<script>
var a=angular.module('plunker', ['ui.bootstrap']);
a.directive('popOver', function ($compile, $http, $templateCache) {
  return {
    restrict: 'A',
    scope: true,
    link: function popOverPostLink(scope, elem, attrs) {
      $http.get(attrs.contentUrl, {cache: $templateCache}).success(
        function (tmpl) {
          var options = {
            content: $compile(tmpl)(scope),
            placement: 'bottom',
            html: true,
            trigger:'click',
            title: attrs.title
          };
          elem.popover(options);
          scope.hidePopover = function () {
            elem.popover('hide');
          }
        }
      );
    }
  };
});

</script>

</html>
</code>```

答:
According to the docs Angular-ui, you should be defining the popover as uib-popover instead of just popover, and if you would like to bind html to the popover you would either use uib-popover-html="
 hello
" or template binding uib-popover-template="<<teamplateNameHere>>"

Body:
I make demo of pop over like this .It show a pop over on right side when I click the button .But now problem is that how I will show some html on pop over .

    <link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">

    <button popover-placement="right" popover="On the Right!" class="btn btn-default">Right</button>

I have this HTML I need to how on  add this on pop over .I know there is way in bootrap.js to add html on popover .I don't want to use that I want to use angular UI bootrap.js

add row

Deleterow

I did more try on that like that but getting undefined.May be I am wrong I just doing RND

    <link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet"/>

    <button pop-over title="Mode of transport" content-url="pop.html" class="btn btn-default">Right</button>

Body: According to the docs Angular-ui, you should be defining the popover as uib-popover instead of just popover, and if you would like to bind html to the popover you would either use uib-popover-html="<div> hello </div>" or template binding uib-popover-template="<<teamplateNameHere>>"


问:
why the height of the out div is affected by vertical-align

in chrome, I thought the height of .wrap should be 24px.

it is 25px when the vertial-align is set to middle. can someone explain why?

answer in this article

body {
  line-height: 1.5;
}

.wrap {
  font-size:16px;  /* 16*1.5= 24 */
}

.btn {
  font-size: 14px;
  padding: 4px;
  line-height: 1;
  box-sizing: border-box;
  border: 1px solid blue;
  vertical-align: middle;
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div class="wrap">
  <button class="btn">
    OK
  </button>
</div></code>```

答:
Inline elements (for whatever reason) are surrounded by whitespace.
Changing the element to display: block will fix your problem but there are other ways to fix it whilst keeping it inline.

One way would be to set font-size: 0 on the .wrap element as the whitespace is governed by font size. In this instance that would be fine as you are setting a font size on the child button (beware when using ems as they are relative to the parent font size).

More options can be found here - https://css-tricks.com/fighting-the-space-between-inline-block-elements/

Body:
in chrome, I thought the height of .wrap should be 24px.

it is 25px when the vertial-align is set to middle. can someone explain why?

answer in this article

body {
  line-height: 1.5;
}

.wrap {
  font-size:16px;  /* 16*1.5= 24 */
}

.btn {
  font-size: 14px;
  padding: 4px;
  line-height: 1;
  box-sizing: border-box;
  border: 1px solid blue;
  vertical-align: middle;
}

  <button class="btn">
    OK
  </button>