我在官方网站上说明了我在我的应用程序中集成了Stetho。 我可以单击我正在运行的应用程序的检查按钮,并且chrome布局正常加载。 不幸的是我在检查模式下看不到任何数据。 “stetho示例”应用程序也不起作用。
添加了:
的build.gradle:
implementation 'com.facebook.stetho:stetho:1.5.0'
implementation 'com.facebook.stetho:stetho-okhttp3:1.5.0'
调整后的MainActivity:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Stetho.initializeWithDefaults(this);
client = new OkHttpClient.Builder()
.addNetworkInterceptor(new StethoInterceptor())
.build();
...
当我点击Chrome stetho布局时,我可以在日志中看到以下错误消息。
D/ChromeDevtoolsServer: Method not implemented: Not implemented: Debugger.setAsyncCallStackDepth
D/ChromeDevtoolsServer: Method not implemented: Not implemented: Debugger.skipStackFrames
D/ChromeDevtoolsServer: Method not implemented: Not implemented: Runtime.enable
D/ChromeDevtoolsServer: Method not implemented: Not implemented: Worker.enable
D/ChromeDevtoolsServer: Method not implemented: Not implemented: Timeline.enable
D/ChromeDevtoolsServer: Method not implemented: Not implemented: IndexedDB.enable
D/ChromeDevtoolsServer: Method not implemented: Not implemented: Page.getNavigationHistory
D/ChromeDevtoolsServer: Method not implemented: Not implemented: Worker.setAutoconnectToWorkers
D/ChromeDevtoolsServer: Method not implemented: Not implemented: IndexedDB.requestDatabaseNames
D/ChromeDevtoolsServer: Method not implemented: Not implemented: IndexedDB.requestDatabaseNames
D/ChromeDevtoolsServer: Method not implemented: Not implemented: Page.getNavigationHistory
D/ChromeDevtoolsServer: Method not implemented: Not implemented: Page.setColorPickerEnabled
D/ChromeDevtoolsServer: Method not implemented: Not implemented: HeapProfiler.enable
D/ChromeDevtoolsServer: Method not implemented: Not implemented: ApplicationCache.enable
D/ChromeDevtoolsServer: Method not implemented: Not implemented: ApplicationCache.getFramesWithManifests
我读到了一些关于Proguard的原因。如果这是原因我真的无法在任何地方关闭该程序或让它正常工作。我尝试了在互联网上找到的不同方式。
e.g。 添加到所有proguard配置:
-keep class com.facebook.stetho.** {*;}
试图通过以下方式关闭proguard:
帮助将不胜感激。