After upgrading our app to ACRA 5.9 I found that error reports are sent by HttpSender multiple times.
ACRA is initialized like this:
ACRA.init(this, new CoreConfigurationBuilder()
.withBuildConfigClass(BuildConfig.class)
.withReportFormat(StringFormat.KEY_VALUE_LIST)
.withPluginConfigurations(
new ToastConfigurationBuilder()
.withText(getString(R.string.crash_toast_text))
.build()
)
.withPluginConfigurations(
BuildConfig.DEBUG ?
new LimiterConfigurationBuilder()
.withPeriod(1)
.withPeriodUnit(TimeUnit.DAYS)
.withOverallLimit(250)
.withExceptionClassLimit(100)
.withStacktraceLimit(50)
.withFailedReportLimit(50)
.withIgnoredCrashToast("App stopped working again")
.build() :
new LimiterConfigurationBuilder()
.withPeriod(7)
.withPeriodUnit(TimeUnit.DAYS)
.withOverallLimit(25)
.withExceptionClassLimit(10)
.withStacktraceLimit(5)
.withFailedReportLimit(5)
.withIgnoredCrashToast("App stopped working again")
.build()
)
.withPluginConfigurations(
new HttpSenderConfigurationBuilder()
.withConnectionTimeout(8000)
.withDropReportsOnTimeout(true)
.withUri(fs.getCrashReportUrl())
.build()
)
.withReportContent(fields)
);
Custom HTTP sender is created like this:
#AutoService(ReportSenderFactory.class)
public class MyCrashSenderFactory implements ReportSenderFactory {
private static final String TAG = MyCrashSenderFactory.class.getSimpleName();
#NonNull
public ReportSender create(#NonNull Context context, #NonNull CoreConfiguration config) {
MySettings fs = new MySettings(context);
if (BuildConfig.DEBUG) Log.d(TAG,"ACRA create sender for "+fs.getCrashReportUrl());
return new HttpSender(config, HttpSender.Method.POST, StringFormat.KEY_VALUE_LIST, fs.getCrashReportUrl());
}
#Override
public boolean enabled(#NonNull CoreConfiguration coreConfig) {
return true;
}
}
The logcat after a simple crash looks like this:
14:17:25.358 E ACRA caught a ArithmeticException for com.myapp
java.lang.ArithmeticException: divide by zero
at com.myapp.MenuItemHandler.handleMenuClick(MenuItemHandler.java:128)
...
14:17:25.452 D ACRA create sender for https://api.myapp.com/api/error_report.php
14:17:25.468 D ACRA create sender for https://api.myapp.com/api/error_report.php
14:17:25.511 E USNET: appName: com.myapp:acra
---------------------------- PROCESS STARTED (2569) for package com.myapp ----------------------------
---------------------------- PROCESS ENDED (2036) for package com.myapp ----------------------------
14:17:25.896 D ACRA registered
14:17:25.983 D ACRA create sender for https://api.myapp.com/api/error_report.php
14:17:26.006 I Sending report /data/user/0/com.myapp/app_ACRA-approved/2023-02-11T14:17:25.380+07:00.stacktrace
---------------------------- PROCESS STARTED (2606) for package com.myapp ----------------------------
14:17:27.088 I ACRA is enabled for com.myapp, initializing...
14:17:27.227 D ACRA create sender for https://api.myapp.com/api/error_report.php
14:17:27.237 D ACRA create sender for https://api.myapp.com/api/error_report.php
14:17:27.277 D ACRA create sender for https://api.myapp.com/api/error_report.php
14:17:27.278 I Sending report /data/user/0/com.myapp/app_ACRA-approved/2023-02-11T14:17:25.380+07:00.stacktrace
14:17:27.732 I Request received by server
14:17:28.318 I Request received by server
14:17:28.907 I Request received by server
14:17:29.863 I Request received by server
14:17:29.868 W Could not delete file: /data/user/0/com.myapp/app_ACRA-approved/2023-02-11T14:17:25.380+07:00.stacktrace
The report is sent 4 times. If a custom HTTP sender is not used then 2 times. Is there a way to avoid multiple sends?
EDIT: If I disable the HttpSender by ACRA config I still get about 6 custom HttpSender created and 2 reports sent. Here is the logcat:
---------------------------- PROCESS ENDED (15606) for package com.myapp ----------------------------
---------------------------- PROCESS STARTED (15894) for package com.myapp ----------------------------
08:50:18.794 15894-15894 com.myapp I ACRA is enabled for com.myapp, initializing...
08:50:36.376 15894-15894 com.myapp E ACRA caught a ArithmeticException for com.myapp
java.lang.ArithmeticException: divide by zero
at com.myapp.MenuItemHandler.handleMenuClick(MenuItemHandler.java:128)
...
08:50:36.457 15894-15894 com.myapp D ACRA create sender for https://api.myapp.com/api/error_report.php
08:50:36.466 15894-15894 com.myapp D ACRA create sender for https://api.myapp.com/api/error_report.php
08:50:36.539 16093-16093 pid-16093E USNET: appName: com.myapp:acra
---------------------------- PROCESS STARTED (16093) for package com.myapp ----------------------------
---------------------------- PROCESS ENDED (15894) for package com.myapp ----------------------------
08:50:36.599 16093-16093 com.myapp D handleBindApplication()++ app=com.myapp:acra
08:50:37.040 16093-16120 com.myapp D ACRA create sender for https://api.myapp.com/api/error_report.php
08:50:37.063 16093-16120 com.myapp I Sending report /data/user/0/com.myapp/app_ACRA-approved/2023-02-12T08:50:36.395+07:00.stacktrace
---------------------------- PROCESS STARTED (16128) for package com.myapp ----------------------------
08:50:38.208 16128-16128 com.myapp I ACRA is enabled for com.myapp, initializing...
08:50:38.334 16128-16158 com.myapp D ACRA create sender for https://api.myapp.com/api/error_report.php
08:50:38.341 16128-16158 com.myapp D ACRA create sender for https://api.myapp.com/api/error_report.php
08:50:38.381 16093-16160 com.myapp D ACRA create sender for https://api.myapp.com/api/error_report.php
08:50:38.382 16093-16160 com.myapp I Sending report /data/user/0/com.myapp/app_ACRA-approved/2023-02-12T08:50:36.395+07:00.stacktrace
08:50:38.824 16093-16120 com.myapp I Request received by server
08:50:39.916 16093-16160 com.myapp I Request received by server
08:50:39.925 16093-16160 com.myapp W Could not delete file: /data/user/0/com.myapp/app_ACRA-approved/2023-02-12T08:50:36.395+07:00.stacktrace
Related
My team is building an Android application which uses MQTT (Mosquito) to connect to a PCBs. We are seeing an issue where once a day (Sometimes more) it'll disconnect and we have to reboot the computer for it to reconnect. Haven't been able to pinpoint the issue but are able to see logs. Any thoughts on this?
2022-03-29 08:11:24.442 1327 1382 W BroadcastQueue: Timeout of broadcast BroadcastRecord{22a1d6f u0 MqttService.pingSender.paho27313692436} - receiver=android.os.BinderProxy#991d308, started 60001ms ago
2022-03-29 08:11:24.443 1327 1382 W BroadcastQueue: Receiver during timeout of BroadcastRecord{22a1d6f u0 MqttService.pingSender.paho27313692436} : BroadcastFilter{4ae74c6 10157/u0 ReceiverList{1937aa1 3293 com.example.deadbolt_frontend/10157/u0 remote:991d308}}
Shortly after it disconnects
2022-03-29 08:14:14.641 3293 3293 I MqttClientImp: Attempting MQTT connection
2022-03-29 08:14:14.643 1327 6371 I am_uid_active: 10054
2022-03-29 08:14:14.845 3293 20643 I payment : \*\*\* permitsImpl keysize: 2048
2022-03-29 08:14:14.845 3293 20644 I payment : \*\*\* permitsImpl keysize: 2048
2022-03-29 08:14:14.846 3293 20643 I payment : getPCIFlag failed.
2022-03-29 08:14:14.846 3293 20644 I payment : getPCIFlag failed.
2022-03-29 08:14:14.846 3293 20643 I payment : RSA minSize: 1024
2022-03-29 08:14:14.846 3293 20644 I payment : RSA minSize: 1024
We tried completing a silent reconnect to no avail.
I have problem with Android O HIDL. The failure log shows it can't find out the service.
However I can see it by adb shell ps -A | grep fingerprint
system 18758 1 17408 3276 pipe_wait 7c79e93e08 R android.hardware.biometrics.fingerprint#2.1-service`
Could anyone give me a hint how to solve the problem? I checked https://source.android.com/devices/architecture/hidl/ but could not get the solution.
Error log:
08-21 06:00:35.864 1890 2264 V FingerprintService: mDeamon was null, reconnect to fingerprint
08-21 06:00:35.864 1890 2264 I system_server: Looking for service android.hardware.biometrics.fingerprint#2.1::IBiometricsFingerprint/default
08-21 06:00:35.864 2240 2240 D wpa_supplicant: nl80211: Set mode ifindex 24 iftype 2 (STATION)
08-21 06:00:35.866 566 566 W /system/bin/hwservicemanager: getTransportFromManifest: Cannot find entry android.hardware.biometrics.fingerprint#2.1::IBiometricsFingerprint in either framework or device manifest, using default transport.
08-21 06:00:35.866 1890 2264 E system_server: service android.hardware.biometrics.fingerprint#2.1::IBiometricsFingerprint declares transport method EMPTY but framework expects hwbinder.
08-21 06:00:35.867 1890 2264 E FingerprintService: Failed to get biometric interface
08-21 06:00:35.867 1890 2264 E FingerprintService: android.os.RemoteException: HwBinder Error: (-2147483648)
08-21 06:00:35.867 1890 2264 E FingerprintService: at android.os.HwBinder.getService(Native Method)
08-21 06:00:35.867 1890 2264 E FingerprintService: at android.hardware.biometrics.fingerprint.V2_1.IBiometricsFingerprint.getService(IBiometricsFingerprint.java:44)
08-21 06:00:35.867 1890 2264 E FingerprintService: at com.android.server.fingerprint.FingerprintService.getFingerprintDaemon(FingerprintService.java:239)
08-21 06:00:35.867 1890 2264 E FingerprintService: at com.android.server.fingerprint.FingerprintService$FingerprintServiceWrapper.isHardwareDetected(FingerprintService.java:1198)
08-21 06:00:35.867 1890 2264 E FingerprintService: at android.hardware.fingerprint.IFingerprintService$Stub.onTransact(IFingerprintService.java:156)
08-21 06:00:35.867 1890 2264 E FingerprintService: at android.os.Binder.execTransact(Binder.java:674)
08-21 06:00:35.867 1890 2264 W FingerprintService: fingerprint HIDL not available
I've succeeded in running my fingerprint HAL on Android 8.1 executing on HiKey
96 board after modified files as below.
Firstly, it's necessary that adding HIDL configures to declare a device as a vendor or you would get VTS failed.
About HIDL configures
device/linaro/hikey/manifest.xml
+<hal format="hidl">
<name>android.hardware.biometrics.fingerprint</name>
<transport>hwbinder</transport>
<version>2.1</version>
<interface>
<name>IBiometricsFingerprint</name>
<instance>default</instance>
</interface>
</hal>
Secondly, finger service will be started after you define it in the file below.
device/linaro/hikey/device-common.mk
+#init finger service and copy
android.hardware.biometrics.fingerprint#2.1-service.rc to
system/vendor/etc/init
+PRODUCT_PACKAGES += \
+android.hardware.biometrics.fingerprint#2.1-service
+# copy permission file of finger service
+PRODUCT_COPY_FILES += \
+frameworks/native/data/etc/android.hardware.fingerprint.xml:system/etc
/permissions/android.hardware.fingerprint.xml
Finally, check finger service has been started and running in Android system by using terminal commands such as "adb shell" and "ps | grep finger".
Any suggestion is welcome.
I found out that I need to add the code to the manifest.xml
(Ref. https://source.android.com/devices/architecture/vintf/objects )
<hal format="hidl">
<name>android.hardware.biometrics.fingerprint</name>
<transport>hwbinder</transport>
<impl level="generic"></impl>
<version>2.1</version>
<interface>
<name>IBiometricsFingerprint</name>
<instance>default</instance>
</interface>
</hal>
I have implement firebase analytics in my app, but not show up any event or log in fire base console.
Add bellow code in each fragment in onCreateView() method.
private void addFragmentInFirebaseAnalytics() {
FirebaseAnalytics firebaseAnalytics = FirebaseAnalytics.getInstance(getContext());
FragmentItem fragmentItem = new FragmentItem();
fragmentItem.setFragmentId(Constant.FM_ID_MOIST_AIR);
fragmentItem.setFragmentName(MoistAirActivity.class.getSimpleName());
Bundle bundle = new Bundle();
bundle.putInt(FirebaseAnalytics.Param.ITEM_ID, fragmentItem.getFragmentId());
bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, fragmentItem.getFragmentName());
//Logs an app event.
firebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle);
Log.d(TAG,"bundle >>"+bundle);
}
Used dependency is :
compile 'com.google.firebase:firebase-core:9.4.0'
used plugin :
apply plugin: 'com.google.gms.google-services'
Its work fine and show log like this in debug console,
09-14 12:30:42.967 D/FA ( 8821): Logging event (FE): select_content, Bundle
[{_o=app, _ev=item_id, item_name=MoistAirActivity, content_type=Navigation Menu,
_err=4}]
09-14 12:30:42.977 V/FA ( 8821): Using measurement service
09-14 12:30:42.977 V/FA ( 8821): Connecting to remote service
09-14 12:30:43.217 D/FA ( 8821): Connected to remote service
09-14 12:30:43.217 V/FA ( 8821): Processing queued up service tasks: 1
09-14 12:30:43.217 E/FA ( 8821): Task exception on worker thread: java.lang
.IllegalStateException: FirebaseApp with name [DEFAULT] doesn't exist. : com.goo
gle.android.gms.measurement.internal.zzt.zzEd(Unknown Source)
09-14 12:30:48.217 V/FA ( 8821): Inactivity, disconnecting from AppMeasurem
entService
but not show any uploading message in debug console and firebase console after 24 hours,
So, whats wrong here ? please help.
Finally i resolved this problem by replacing tools:node="replace" to tools:node="merge" and add tools:replace="android:label" in menifest file.
Reference : FirebaseApp with name [DEFAULT] doesn't exist
For me this worked:
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
in the AndroidManifest.xml.
I've not specified any tools attribute.
There are a few things that could be going on here. You will see more diagnostic messages if you run:
adb shell setprop log.tag.FA VERBOSE
and if your test device has Google Play Services installed, also run:
adb shell setprop log.tag.FA-SVC VERBOSE
Those commands will display more information in your logcat. Are there any errors from FA or FA-SVC on application startup?
This error happes on update TurnBasedMatch of google play services:
03-31 10:01:15.139 9179-9192/? W/AppOps: Bad call: specified package com.google.android.play.games under uid 10238 but it is really 10062
03-31 10:01:15.139 9179-9803/? W/AppOps: Bad call: specified package com.google.android.play.games under uid 10238 but it is really 10062
03-31 10:01:15.530 14236-4012/? E/Volley: [36392] BasicNetwork.performRequest: Unexpected response code 403 for https://www.googleapis.com/games/v1/turnbasedmatches/ChEKCQTE4Jn3xhYQAhACGAAgARCI66qZ-IqAntsB/turn?language=en_GB
03-31 10:01:15.532 14236-9563/? E/TurnBasedAgent: Failed to update match: null
Few hours before i was playing it, so it's more likely the error on the service's side. Rebooting the phone doesn't help me as was suggested here
I have a single-activity native application which uses the NativeActivity class. If the application crashes it is restarted immediately. I have been searching the Internet the whole day for this problem.
This happens when using any of the following (SIGSEGV is signalled):
- assert() from assert.h
- __android_log_assert() from android/log.h
- abort()
- pthread_exit()
I did some research:
https://stackoverflow.com/a/7387659
Didn't work, sending SIGKILL causes another SIGSEGV sent and the application is restarted.
https://stackoverflow.com/a/6121393/1374605
https://stackoverflow.com/a/2632649
I tried with only having one activity running. Am I missing something?
The restart also occurs when a JNI function (JNIEnv member) call throws and another JNI function is called without calling ExceptionClear() in between them. Has this something to do with the JVM?
Any ideas why the app is restarted after a crash and how can it be prevented?
UPDATE (logcat):
// Previous memory dump ended here
09-26 15:36:48.771: I/BootReceiver(2374): Copying /data/tombstones/tombstone_06 to DropBox (SYSTEM_TOMBSTONE)
09-26 15:36:48.781: I/ActivityManager(2374): Process net.devenec.devengine.sample (pid 4750) has died.
09-26 15:36:48.791: I/ActivityManager(2374): Start proc net.devenec.devengine.sample for activity net.devenec.devengine.sample/android.app.NativeActivity: pid=4763 uid=10075 gids={50075, 1028}
09-26 15:36:48.801: D/Zygote(1953): Process 4750 terminated by signal (11)
09-26 15:36:48.801: D/dalvikvm(4763): Late-enabling CheckJNI
09-26 15:36:48.826: I/dalvikvm(4763): Turning on JNI app bug workarounds for target SDK version 9...
09-26 15:36:48.841: W/Trace(4763): error opening trace file: No such file or directory (2)
// My code starts here
09-26 15:36:48.856: D/DevEngine(4763): [Application] Create
09-26 15:36:48.856: A/libc(4763): source/android/AndroidApplication.cpp:141: static void Platform::Application::create(ANativeActivity*): assertion "false" failed
09-26 15:36:48.856: A/libc(4763): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 4763 (evengine.sample)
09-26 15:36:48.956: I/DEBUG(1950): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
09-26 15:36:48.956: I/DEBUG(1950): Build fingerprint: 'samsung/m3xx/m3:4.1.2/JZO54K/I9305XXBMA6:user/release-keys'
09-26 15:36:48.956: I/DEBUG(1950): Revision: '2'
09-26 15:36:48.956: I/DEBUG(1950): pid: 4763, tid: 4763, name: evengine.sample >>> net.devenec.devengine.sample <<<
09-26 15:36:48.956: I/DEBUG(1950): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad
// Memory dump starts here
EDIT:
About marking this question as a duplicate, I have explained why this is different right after the first link. The solution did not work in my case.
On my Galaxy S III (stock ROM), apps don't restart automatically after crash. So maybe whether they restart depends on which ROM you use?