Program: 163597
Project: 163597
Buggy source:
private void createAppModule(File projectFolder,File exportFolder,String buildToolsVer) throws SketchException, IOException {
  File moduleFolder=mkdirs(exportFolder,"String_Node_Str");
  String minSdk;
  String tmplFile;
  if (appComponent == VR) {
    minSdk=min_sdk_gvr;
    tmplFile=VR_GRADLE_BUILD_TEMPLATE;
  }
 else {
    minSdk=min_sdk_fragment;
    tmplFile=APP_GRADLE_BUILD_TEMPLATE;
  }
  File appBuildTemplate=mode.getContentFile("String_Node_Str" + tmplFile);
  File appBuildFile=new File(moduleFolder,"String_Node_Str");
  HashMap<String,String> replaceMap=new HashMap<String,String>();
  replaceMap.put("String_Node_Str",Base.getToolsFolder().getPath());
  replaceMap.put("String_Node_Str",sdk.getTargetPlatform().getPath());
  replaceMap.put("String_Node_Str",buildToolsVer);
  replaceMap.put("String_Node_Str",getPackageName());
  replaceMap.put("String_Node_Str",minSdk);
  replaceMap.put("String_Node_Str",target_sdk);
  replaceMap.put("String_Node_Str",support_version);
  replaceMap.put("String_Node_Str",wear_version);
  replaceMap.put("String_Node_Str",gvr_sdk_version);
  replaceMap.put("String_Node_Str",manifest.getVersionCode());
  replaceMap.put("String_Node_Str",manifest.getVersionName());
  AndroidMode.createFileFromTemplate(appBuildTemplate,appBuildFile,replaceMap);
  writeFile(new File(moduleFolder,"String_Node_Str"),new String[]{"String_Node_Str"});
  File coreFile=new File(projectFolder,"String_Node_Str");
  File libsFolder=mkdirs(moduleFolder,"String_Node_Str");
  Util.copyFile(coreFile,new File(libsFolder,"String_Node_Str"));
  if (appComponent == VR) {
    File vrFile=new File(projectFolder,"String_Node_Str");
    Util.copyFile(vrFile,new File(libsFolder,"String_Node_Str"));
  }
  File mainFolder=mkdirs(moduleFolder,"String_Node_Str");
  File javaFolder=mkdirs(mainFolder,"String_Node_Str");
  File resFolder=mkdirs(mainFolder,"String_Node_Str");
  File assetsFolder=mkdirs(mainFolder,"String_Node_Str");
  Util.copyFile(new File(projectFolder,"String_Node_Str"),new File(mainFolder,"String_Node_Str"));
  Util.copyDir(new File(projectFolder,"String_Node_Str"),resFolder);
  Util.copyDir(new File(projectFolder,"String_Node_Str"),javaFolder);
  Util.copyDir(new File(projectFolder,"String_Node_Str"),assetsFolder);
}

Fixed version (ground truth):
private void createAppModule(File projectFolder,File exportFolder,String buildToolsVer) throws SketchException, IOException {
  File moduleFolder=mkdirs(exportFolder,"String_Node_Str");
  String minSdk;
  String tmplFile;
  if (appComponent == VR) {
    minSdk=min_sdk_gvr;
    tmplFile=VR_GRADLE_BUILD_TEMPLATE;
  }
 else {
    minSdk=min_sdk_fragment;
    tmplFile=APP_GRADLE_BUILD_TEMPLATE;
  }
  File appBuildTemplate=mode.getContentFile("String_Node_Str" + tmplFile);
  File appBuildFile=new File(moduleFolder,"String_Node_Str");
  HashMap<String,String> replaceMap=new HashMap<String,String>();
  replaceMap.put("String_Node_Str",Base.getToolsFolder().getPath().replace('\\','/'));
  replaceMap.put("String_Node_Str",sdk.getTargetPlatform().getPath().replace('\\','/'));
  replaceMap.put("String_Node_Str",buildToolsVer);
  replaceMap.put("String_Node_Str",getPackageName());
  replaceMap.put("String_Node_Str",minSdk);
  replaceMap.put("String_Node_Str",target_sdk);
  replaceMap.put("String_Node_Str",support_version);
  replaceMap.put("String_Node_Str",wear_version);
  replaceMap.put("String_Node_Str",gvr_sdk_version);
  replaceMap.put("String_Node_Str",manifest.getVersionCode());
  replaceMap.put("String_Node_Str",manifest.getVersionName());
  AndroidMode.createFileFromTemplate(appBuildTemplate,appBuildFile,replaceMap);
  writeFile(new File(moduleFolder,"String_Node_Str"),new String[]{"String_Node_Str"});
  File coreFile=new File(projectFolder,"String_Node_Str");
  File libsFolder=mkdirs(moduleFolder,"String_Node_Str");
  Util.copyFile(coreFile,new File(libsFolder,"String_Node_Str"));
  if (appComponent == VR) {
    File vrFile=new File(projectFolder,"String_Node_Str");
    Util.copyFile(vrFile,new File(libsFolder,"String_Node_Str"));
  }
  File mainFolder=mkdirs(moduleFolder,"String_Node_Str");
  File javaFolder=mkdirs(mainFolder,"String_Node_Str");
  File resFolder=mkdirs(mainFolder,"String_Node_Str");
  File assetsFolder=mkdirs(mainFolder,"String_Node_Str");
  Util.copyFile(new File(projectFolder,"String_Node_Str"),new File(mainFolder,"String_Node_Str"));
  Util.copyDir(new File(projectFolder,"String_Node_Str"),resFolder);
  Util.copyDir(new File(projectFolder,"String_Node_Str"),javaFolder);
  Util.copyDir(new File(projectFolder,"String_Node_Str"),assetsFolder);
}