Context appContext = InstrumentationRegistry.getTargetContext();
改为:
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
Context appContext = InstrumentationRegistry.getTargetContext();
改为:
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();