amitshekhariitbhu / Android-Debug-Database

A library for debugging android databases and shared preferences - Make Debugging Great Again
https://outcomeschool.com
Apache License 2.0
8.39k stars 872 forks source link

Signed apk issue - package com.amitshekhar does not exist #184

Closed pravingaikwad07 closed 4 years ago

pravingaikwad07 commented 4 years ago

While creating a signed apk I always get this error : package com.amitshekhar does not exist. Even I have disabled proguard. it works fine for debug builds.

pravingaikwad07 commented 4 years ago

Solved this using this code snippet :

 public static void showDebugDBAddressLogToast(Context context) {
        if (BuildConfig.DEBUG) {
            try {
                Class<?> debugDB = Class.forName("com.amitshekhar.DebugDB");
                Method getAddressLog = debugDB.getMethod("getAddressLog");
                Object value = getAddressLog.invoke(null);
                Toast.makeText(context, (String) value, Toast.LENGTH_LONG).show();
                Log.d(TAG, "onCreate: Debug ++++++++ DATABASE ++++++++ URL: " + (String) value);
            } catch (Exception ignore) {

            }
        }
    }