rosu alin rosu alin - 4 months ago 19x
Android Question

Instabug not sending attachements

I changed to instabug v2 from v1 recently and I do not get my attachments anymore.
this is how I initialise:

try {
instabug = new Instabug.Builder(this, "API_KEY")
instabug.setPreSendingRunnable(new Runnable() {
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/"); CrudStateCallback() {
public void onResponse(String string) {
Log.i("", "ended making the archive");
instabug.setFileAttachment(Uri.parse(Environment.getExternalStorageDirectory() + "/Passenger/"));
}catch (Exception e){
Log.e("","error instabug:" + e.getMessage());
Utils.appendLog("In case instabug crashes asyncTask process, will not crash app",true);

Before, on v1 I had this in the manifest, which is not recognised anymore:

<service android:name=""/>
<receiver android:name="">
<action android:name=""/>

Should I put something instead?


the URI apparently was incorrect. This fixes it:

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