@@ -213,29 +213,7 @@ private static GradleSettingsFile parseSettings(Project project) {
213
213
214
214
@ SuppressWarnings ("rawtypes" )
215
215
private static BuildModelContext makeBuildModelContext (Project project ) {
216
- // return BuildModelContext.create(project);
217
- Method method = ReflectionUtil .getDeclaredMethod (BuildModelContext .class , "create" , Project .class );
218
- if (method != null ) {
219
- try {
220
- return (BuildModelContext )method .invoke (null , project );
221
- }
222
- catch (IllegalAccessException | InvocationTargetException e ) {
223
- throw new RuntimeException (e );
224
- }
225
- }
226
- // If we get here we're using the 4.1 API.
227
- // return BuildModelContext.create(project, new AndroidLocationProvider());
228
- Class locationProviderClass = AndroidLocationProvider .class .getInterfaces ()[0 ];
229
- // Class.forName("com.android.tools.idea.gradle.dsl.model.BuildModelContext.ResolvedConfigurationFileLocationProvider");
230
- // does not work in the debugger. That's why we get it from the interfaces of AndroidLocationProvider.
231
- method = ReflectionUtil .getDeclaredMethod (BuildModelContext .class , "create" , Project .class , locationProviderClass );
232
- assert method != null ;
233
- try {
234
- return (BuildModelContext )method .invoke (null , project , new AndroidLocationProvider ());
235
- }
236
- catch (IllegalAccessException | InvocationTargetException e ) {
237
- throw new RuntimeException (e );
238
- }
216
+ return BuildModelContext .create (project , new AndroidLocationProvider ());
239
217
}
240
218
241
219
// The project is an Android project that contains a Flutter module.
0 commit comments