If you have Debugging on you might get a more helpful error message output (or at least added to your webserver error logs).
At a brief guess, you may be missing the lib.php file in your plugin, or missing the function PLUGINNAME_add_instance() or PLUGINNAME_update_instance() functions.
Have you read through https://docs.moodle.org/dev/Activity_modules ?
Have you tried starting with https://github.com/moodlehq/moodle-mod_newmodule ?