Description
I have the next problem:
`Execution failed for task ':sdk:mavsdk:generateProto'.
protoc: stdout: . stderr: Traceback (most recent call last):
File "C:\Users\alari\AppData\Local\Programs\Python\Python310\Scripts\protoc-gen-mavsdk-script.py", line 33, in
sys.exit(load_entry_point('protoc-gen-mavsdk', 'console_scripts', 'protoc-gen-mavsdk')())
File "c:\users\alari\androidstudioprojects\sdk\proto\pb_plugins\protoc_gen_mavsdk_main_.py", line 17, in main
AutoGen.generate_reactive(request).SerializeToString())
File "c:\users\alari\androidstudioprojects\sdk\proto\pb_plugins\protoc_gen_mavsdk\autogen.py", line 40, in generate_reactive
enums = Enum.collect_enums(plugin_name,
File "c:\users\alari\androidstudioprojects\sdk\proto\pb_plugins\protoc_gen_mavsdk\enum.py", line 61, in collect_enums
_enums[enum.name] = Enum(plugin_name,
File "c:\users\alari\androidstudioprojects\sdk\proto\pb_plugins\protoc_gen_mavsdk\enum.py", line 18, in init
self._template = template_env.get_template("enum.j2")
File "C:\Users\alari\AppData\Local\Programs\Python\Python310\lib\site-packages\jinja2\environment.py", line 1010, in get_template
return self._load_template(name, globals)
File "C:\Users\alari\AppData\Local\Programs\Python\Python310\lib\site-packages\jinja2\environment.py", line 969, in _load_template
template = self.loader.load(self, name, self.make_globals(globals))
File "C:\Users\alari\AppData\Local\Programs\Python\Python310\lib\site-packages\jinja2\loaders.py", line 126, in load
source, filename, uptodate = self.get_source(environment, name)
File "C:\Users\alari\AppData\Local\Programs\Python\Python310\lib\site-packages\jinja2\loaders.py", line 220, in get_source
raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: enum.j2
--mavsdk_out: protoc-gen-mavsdk: Plugin failed with status code 1.`
I did some investigation and found out that if I change
option "template_path=$project.rootDir/templates/"
to
option "template_path=./templates/"
(relative path)
it works ok (well there is another (issue) but there is a workaround.
However, when I add this project to my app by using: includeBuild '../sdk'
I receive same issue.
It looks like problem is partially related to gradle version, because in this case I alaso have issue with checkstyle task, it complains about :
configDir = project.provider({ rootProject.file("config/checkstyle") })
so I looked up that configDir
now has to be changed to configDirectory
.
When I do this change I get back to the first error, related to template folder.
Any ideas on how can I make it work in my project provided that it compiles ok separately in console (after changing template folder path to relative form)
Thank you!