【问题标题】:Instabug not sending attachementsInstabug不发送附件
【发布时间】:2016-04-04 14:38:40
【问题描述】:

我最近从 v1 更改为 instabug v2,但我不再收到我的附件。 这就是我的初始化方式:

 try {
        instabug =   new Instabug.Builder(this, "API_KEY")
                .setDebugEnabled(true)
                .setEmailFieldRequired(true)
                .setFloatingButtonOffsetFromTop(400)
                .setShouldShowIntroDialog(true)
                .setColorTheme(IBGColorTheme.IBGColorThemeLight)
                .setCommentFieldRequired(true)
                .setInvocationEvent(IBGInvocationEvent.IBGInvocationEventShake)
                .build();
        instabug.setPrimaryColor(getResources().getColor(R.color.background));
        instabug.setPreSendingRunnable(new Runnable() {
            @Override
            public void run() {
                Log.i("","entered pre sending runnable");
                String[] files = new String[2];
                files[0] = Environment.getExternalStorageDirectory() + "/Passenger/passenger_log.txt";
                files[1] = Environment.getExternalStorageDirectory() + "/Passenger/passenger_log2.txt";
                Compress compress = new Compress(files, Environment.getExternalStorageDirectory() + "/Passenger/log.zip");
                compress.zip(new CrudStateCallback() {
                    @Override
                    public void onResponse(String string) {
                        Log.i("", "ended making the archive");
                    }
                });
            }
        });
        instabug.setFileAttachment(Uri.parse(Environment.getExternalStorageDirectory() + "/Passenger/log.zip"));
    }catch (Exception e){
        Log.e("","error instabug:" + e.getMessage());
        Utils.appendLog("In case instabug crashes asyncTask process, will not crash app",true);
    }

之前,在 v1 上,我在清单中有这个,现在无法识别:

   <service android:name="com.instabug.library.network.UploadCacheService"/>
 <receiver android:name="com.instabug.library.network.InstabugNetworkReceiver">
        <intent-filter>
            <action android:name="android.net.conn.CONNECTIVITY_CHANGE"/>
        </intent-filter>
    </receiver>

我应该放点东西吗?

【问题讨论】:

  • 你没有得到任何附件,或者只是截图?
  • 只是截图。附件按钮不可见

标签: android file attachment bug-reporting instabug


【解决方案1】:

URI 显然不正确。 这解决了它:

   File file = new File(Environment.getExternalStorageDirectory() + "/Passenger/log.zip");
        Uri uri = Uri.fromFile(file);
        Log.i("","instabug uri is:" + uri);
        instabug.setFileAttachment(uri);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-09-04
    • 2019-07-02
    • 2012-09-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多