ArcGIS Pro is crashing when I try to create a .gpkx package using Package Result Geoprocessing tool.
I have following script tool which creates a .mmpk from a layer file. Tool execute successfully if I run it in ArcGIS pro and it creates .mmpk successfully.
But When I try to create a .gpkx from my script tool result ArcGIS Pro Crashes.
import arcpy
def script_tool():
#MyProject.aprx is empty project
aprx = arcpy.mp.ArcGISProject("D:\ESRI\projectfolder\MyProject.aprx")
newMap = aprx.createMap("NewMap11", "Map")
#Layer folder has .lyr file with shapefiles
lyrx1 = arcpy.mp.LayerFile(r"D:\ESRI\somelayer\Powder Grid_LYR.lyr")
newMap.addLayer(lyrx1)
arcpy.management.CreateMobileMapPackage(newMap, 'D:\ESRI\outputfolder\MyMap.mmpk')
#aprx.deleteItem(newMap)
return
if __name__ == "__main__":
script_tool()