I’ve been struggling a bit with the activate hook as well. I found that changing my plugin file to all lowercase and with no underscores in the name made the activation hook work.
So instead of myPlugin.php or my_plugin.php I had to use myplugin.php and then the add_action( “activate_myplugin.php”, “install_function” ) worked.
I couldn’t find it in the documentation that this was required so I discovered it with trial and error. Granted I’m quite new at this plugin writing stuff so maybe I just missed it being mentioned somewhere.