# Protobuf compile issues

**URL:** <https://community.firebasestudio.dev/t/protobuf-compile-issues/108>\
**Category:** General\
**Created:** [May 17, 2024, 12:19am UTC](https://community.firebasestudio.dev/t/protobuf-compile-issues/108 "2024-05-17T00:19:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Knasr](https://sea2.discourse-cdn.com/flex002/user_avatar/community.firebasestudio.dev/knasr/32/90_2.png) [@Knasr](https://community.firebasestudio.dev/u/Knasr)\
**Post date:** [May 17, 2024, 12:19am UTC](https://community.firebasestudio.dev/t/protobuf-compile-issues/108/1 "2024-05-17T00:19:28Z")

</div>

Hi,

I’m new to IDX and Flutter and wanted to learn by creating a simple app. I created a protobuf to represent the data and I can’t seem to compile it and get the generated classes. I tried installing the protobuf package and rebuilt the workspace. I’m running the protoc command in the terminal and get the following message:

protoc-gen-dart: program not found or is not executable  
Please specify a program using absolute path or make sure the program is available in your PATH system variable  
–dart\_out: protoc-gen-dart: Plugin failed with status code 1.

Wondering if anyone has this working and could share the steps?

Screenshot of my dev.nix file.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/idxcommunity/original/1X/8622773bfac90e47e436bdb57cbcdbdfdccd0fc6.png)

Thanks!

---

<div class="post-metadata">

**Author:** ![kirupac](https://sea2.discourse-cdn.com/flex002/user_avatar/community.firebasestudio.dev/kirupac/32/5_2.png) [@kirupac](https://community.firebasestudio.dev/u/kirupac)\
**Post date:** [May 17, 2024, 4:45am UTC](https://community.firebasestudio.dev/t/protobuf-compile-issues/108/2 "2024-05-17T04:45:34Z")

</div>

Hi @Knasr - is the package you are installing the same as this?

> **[protobuf | Dart package](https://pub.dev/packages/protobuf)**
>
> Runtime library for protocol buffers support. Use with package:protoc\_plugin to generate dart code for your '.proto' files.

If so, can you try adding it via the Terminal using the commands described here? [protobuf install | Dart package](https://pub.dev/packages/protobuf/install)

Thanks,  
Kirupa

---

<div class="post-metadata">

**Author:** ![Knasr](https://sea2.discourse-cdn.com/flex002/user_avatar/community.firebasestudio.dev/knasr/32/90_2.png) [@Knasr](https://community.firebasestudio.dev/u/Knasr)\
**Post date:** [May 17, 2024, 4:57pm UTC](https://community.firebasestudio.dev/t/protobuf-compile-issues/108/3 "2024-05-17T16:57:29Z")

</div>

Thanks for the help. I don’t think it’s the same package so I want to install it using the recommendation. However, I removed the other package and extension manually in the dev.nix file and selected to rebuild the environment. I think my manual edits put the workspace in a broken state. Now I’m stuck on the “Building environment” screen and I don’t see any option how to revert the changes and get back into my project. Is there a way to get back into see my files and update them?

---

<div class="post-metadata">

**Author:** ![Knasr](https://sea2.discourse-cdn.com/flex002/user_avatar/community.firebasestudio.dev/knasr/32/90_2.png) [@Knasr](https://community.firebasestudio.dev/u/Knasr)\
**Post date:** [May 17, 2024, 6:59pm UTC](https://community.firebasestudio.dev/t/protobuf-compile-issues/108/4 "2024-05-17T18:59:37Z")

</div>

I started a new project to try out the commands suggested. It did not resolve the issue with the protobuf compilation.

It updated the pubspec.yaml to have this

```auto
dependencies:
  protobuf: ^3.1.0

```

but when I run the protoc command I still get this error

```auto
protoc-gen-dart: program not found or is not executable
Please specify a program using absolute path or make sure the program is available in your PATH system variable
--dart_out: protoc-gen-dart: Plugin failed with status code 1.

```

---

<div class="post-metadata">

**Author:** ![Sunny](https://sea2.discourse-cdn.com/flex002/user_avatar/community.firebasestudio.dev/sunny/32/85_2.png) [@Sunny](https://community.firebasestudio.dev/u/Sunny)\
**Post date:** [May 19, 2024, 1:10am UTC](https://community.firebasestudio.dev/t/protobuf-compile-issues/108/5 "2024-05-19T01:10:20Z")

</div>

> **[protobuf.dart/protoc\_plugin at master · google/protobuf.dart](https://github.com/google/protobuf.dart/tree/master/protoc_plugin#how-to-build)**
>
> Runtime library for Dart protobufs. Contribute to google/protobuf.dart development by creating an account on GitHub.

Run

```auto
dart pub global activate protoc_plugin

```

This command would create protoc-gen-dart inside the folder

```auto
~/.pub-cache/bin/

```

---

<div class="post-metadata">

**Author:** ![Knasr](https://sea2.discourse-cdn.com/flex002/user_avatar/community.firebasestudio.dev/knasr/32/90_2.png) [@Knasr](https://community.firebasestudio.dev/u/Knasr)\
**Post date:** [May 20, 2024, 4:28pm UTC](https://community.firebasestudio.dev/t/protobuf-compile-issues/108/7 "2024-05-20T16:28:14Z")

</div>

Perfect, that works. Thank you!
