Closed alex-iotiq closed 1 year ago
Thanks for the issue. I've added a first implementation of this issue: https://github.com/DaGeRe/kieker-source-instrumentation-dagere/commit/ac5f749bbd6b6143462f27b61db107b10a9a8bd5
Does this work for you? (You can test this in Peass if you install the current version or the source-instrumentation by running mvn clean install
inside of it and afterwards change the dependency of kieker-source-instrumentation-library
in dependency/pom.xml
:
<dependency>
<groupId>de.dagere.kieker</groupId>
<artifactId>kieker-source-instrumentation-library</artifactId>
<version>1.15.16-SNAPSHOT</version>
</dependency>
Thanks for this implementation.
Unfortunately it adds the static initializer after kieker.monitoring.core.controller.MonitoringController.getInstance()
causing the same NetworkOnMainThreadException
.
I've created a fix for this https://github.com/DaGeRe/kieker-source-instrumentation-dagere/pull/3.
Thanks for the PR! Its now part of the branch (by rebase). Does this work for you now?
Yes thank you.
On Android network operations aren't allowed on the main thread by default.
While initializing
kieker.monitoring.core.controller.MonitoringController
the methodjava.net.InetAddress.getLocalHost()
is used which causesNetworkOnMainThreadException
and crashes the process.This limitation can by turned off by setting ThreadPolicy accordingly before the kieker initialization in
every classthe class which extends fromApplication
. It will per. It will permit network operations on the main thread. See Stack Overflow