As the part of creating bundle product programmatically in Magento 2. I am getting below error. Even i removed var/cache and generation.
This may be a duplicate question but none of the answer is working for this issue.
Fatal error: Cannot instantiate interface Magento\Catalog\Api\Data\ProductExtensionInterface in \ObjectManager\Factory\Dynamic\Developer.php on line 73
Used below code as the reference of link
$productExtension = $objectManager->create(\Magento\Catalog\Api\Data\ProductExtensionInterface::class);
$option = $objectManager->create(\Magento\Bundle\Api\Data\OptionInterface::class);
$option->setTitle('Size');
$option->setType('radio');
$option->setRequired(true);
$option->setPosition(1);
//$option->setProductLinks($links);
$productExtension->setBundleOptions([$option]);
$_product->setExtensionAttributes($productExtension);
I am using object manager for temporary/quick purpose, will convert the object manager to constructor injunction.
Any one can help me on this issue.