Tencent/QMUI_Android · error · RuntimeException
Can not instance the Class RecordMetaMapImpl. Please file a
Error message
Can not instance the Class RecordMetaMapImpl. Please file a issue to report this.
What it means
Same reflective static-init path as the access error: QMUILatestVisit tries Class.newInstance() on the internal RecordMetaMapImpl, and an InstantiationException means the class could not be instantiated (missing no-arg constructor, abstract/interface, or constructor threw). The library converts it into a RuntimeException telling the developer to report it, since this is an internal invariant, not something app code normally controls.
Source
Thrown at arch/src/main/java/com/qmuiteam/qmui/arch/QMUILatestVisit.java:55
Class<?> cls = Class.forName(RecordIdClassMap.class.getCanonicalName() + "Impl");
mRecordMap = (RecordIdClassMap) cls.newInstance();
} catch (ClassNotFoundException e) {
mRecordMap = new RecordIdClassMap() {
@Override
public Class<?> getRecordClassById(int id) {
return null;
}
@Override
public int getIdByRecordClass(Class<?> clazz) {
return QMUILatestVisitStorage.NOT_EXIST;
}
};
} catch (IllegalAccessException e) {
throw new RuntimeException("Can not access the Class RecordMetaMapImpl. " +
"Please file a issue to report this.");
} catch (InstantiationException e) {
throw new RuntimeException("Can not instance the Class RecordMetaMapImpl. " +
"Please file a issue to report this.");
}
}
@MainThread
public static QMUILatestVisit getInstance(Context context) {
if (sInstance == null) {
sInstance = new QMUILatestVisit(context);
}
return sInstance;
}
public static Intent intentOfLatestVisit(Activity activity) {
return getInstance(activity).getLatestVisitIntent(activity);
}
public void setStorage(QMUILatestVisitStorage storage) {
mStorage = storage;View on GitHub (pinned to 026e7d4866)
Solutions
- Add/verify keep rules so RecordMetaMapImpl and its default constructor survive: -keep class com.qmuiteam.qmui.arch.QMUILatestVisit$RecordMetaMapImpl { *; }.
- Clean and re-sync dependencies to rule out a corrupted artifact (./gradlew clean --refresh-dependencies).
- Disable suspect bytecode transforms (hot-fix plugins, gradle transforms) to isolate the cause.
- Upgrade the QMUI dependency or report the issue upstream with build and device details.
Example fix
// before
# nothing
// after
-keep class com.qmuiteam.qmui.arch.QMUILatestVisit { *; }
-keep class com.qmuiteam.qmui.arch.QMUILatestVisit$RecordMetaMapImpl { <init>(); *; } Defensive patterns
Strategy: try-catch
Try / catch
try {
QMUILatestVisit.getInstance(context);
} catch (RuntimeException e) {
if (e.getMessage() != null && e.getMessage().contains("Can not instance")) {
Log.e(TAG, "RecordMetaMapImpl instantiation failed; check build transforms", e);
} else throw e;
} Prevention
- Add -keepattributes Signature and keep rules for QMUILatestVisit internals
- Avoid bytecode transforms/hot-patch tools on library classes
- Rebuild with clean dependencies if the error appears suddenly
When it happens
Trigger: Triggering QMUILatestVisit class initialization when RecordMetaMapImpl lacks an accessible no-arg constructor after transformation — commonly due to R8/ProGuard optimization altering constructors, or bytecode manipulation (instrumentation, hot-fix frameworks) breaking the class.
Common situations: Minified release builds, hot-patch/InstantRun tooling replacing class bytes, custom gradle transforms, or a genuinely corrupted dependency artifact.
Related errors
- Can not access the Class RecordMetaMapImpl. Please file a is
- Can not access the Class SchemeMapImpl. Please file a issue
- Can not instance the Class SchemeMapImpl. Please file a issu
- Error to get FragmentEffectHandler's generic parameter type
- no QMUIMediaPhotoProviderFactory is provided.
AI-assisted analysis of Tencent/QMUI_Android@026e7d4866 (2026-09-06).
Data as JSON: /api/errors/766a3ef916830593.
Report an issue: GitHub.