I am developing a application which automatically load class from external dex from external apk file (external apk file is stored in internal storage of application). The external apk file have class using com.google.gson. The source code of the application // Internal storage where the DexClassLoader writes the optimized dex file to. final File optimizedDexOutputPath = mContext.getDir("optimize_offload", Context.MODE_PRIVATE); // Initialize the class loader with the s dex file. DexClassLoader dexClassLoader = new DexClassLoader(apkPath, optimizedDexOutputPath.getAbsolutePath(), null,