Open nicopasso opened 8 years ago
Hey!
AndroidDevMetrics should be initialized in Application class, not Activity (it's too late if you would do this).
Here is example code:
public class ExampleApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
//Use it only in debug builds
if (BuildConfig.DEBUG) {
AndroidDevMetrics.initWith(this);
}
}
}
Yes yes I've done that of course :)
I have same issue with 4.0, getting that runtime exception.
I've tried AndroidDevMetrics.initWith(this);
and MethodsTracingManager.getInstance().init(this);
in Application onCreate() but with no success.
I have errors only in version 0.4, version 0.3.1 is working. Thanks.
I have the same issue with 4.0
It crashes when I do not initialize it. It shouldn't it should just do nothing.
This behavior was correct in 0.3.1
Me too... uff.. i would like to test AndroidDevMetrics
It crashes when I put
if (isInDebugMode) {
AndroidDevMetrics.initWith(this);
}
on top of onCreate of all initializations, but it fine when I put it at the end. It appears that it clashes with some other initialisations. I can say that I have other ActivityLifecycleListeners might be because of it.
The plugin for android dev metrics assumes you will be using it for any debug build. I ran into this issue because I was disabling it when certain properties were passed to gradle. In order for this to work, I did following:
In app/build.gradle
, conditionally apply plugin based on a property passed through gradle (could be any condition of course):
if (project.hasProperty('ENABLE_TOOLS')) {
apply plugin: 'com.frogermcs.androiddevmetrics'
}
If the tool is disabled, add a debugCompile
dependency on the noop
package:
if (project.hasProperty('ENABLE_TOOLS')) {
debugCompile 'com.frogermcs.androiddevmetrics:androiddevmetrics-runtime-noop:0.5'
}
Only initialize AndroidDevMetrics
for debug builds:
onCreate() {
// ...
if (BuildConfig.DEBUG) {
AndroidDevMetrics.initWith(this);
}
// ...
}
DebugApplication
class:Always initialize for debug builds:
onCreate() {
// ...
AndroidDevMetrics.initWith(this);
// ...
}
i meet this problem when i update my gradle`s version, i solve this problem by decreasing the gradle's version .Maybe the problem is the compatibility of the author's plugin.
Hi, my app crashes with this stack trace.
I've already tried to implement
in my StartingActivity as the stack trace says but still I have the same issue.
How can I solve this problem? Thanks