title: java.lang.IllegalArgumentException: The project ID can't be null or empty
body: <p>I installed the PubSub dependency in my project.</p>
  <pre><code>&lt;dependency&gt;
          &lt;groupId&gt;com.google.cloud&lt;/groupId&gt;
          &lt;artifactId&gt;spring-cloud-gcp-starter-pubsub&lt;/artifactId&gt;
      &lt;/dependency&gt;
  </code></pre>
  <p>I implemented a <code>TopicChannel</code> and <code>SubscriptionChannel</code>:</p>
  <pre><code>  @Configuration
  @Slf4j
  
  public class SubscriberChannel {
      private final String subscription = &quot;test-sub&quot;;
      @Autowired
      private DeviceRepository deviceRepository;
      @Autowired
      private RfidReaderRepository rfidReaderRepository;
      @Autowired
      private BagDetectionRepository bagDetectionRepository;
      @Autowired
      private PersonDetectionRepository personDetectionRepository;
  
  
      @Bean
      @ServiceActivator(inputChannel = &quot;pubsubInputChannel&quot;)
      public MessageHandler messageReceiver() {
          return message -&gt; {
  
              String payload = (String) message.getPayload();
              long start = System.currentTimeMillis();
              log.info(&quot;Message arrived! Payload: &quot; + payload);
  
              BasicAcknowledgeablePubsubMessage originalMessage =
                      message.getHeaders().get(GcpPubSubHeaders.ORIGINAL_MESSAGE, BasicAcknowledgeablePubsubMessage.class);
              originalMessage.ack();
  
           
          };
      }
  
      @Bean
      public PubSubInboundChannelAdapter messageChannelAdapter(
              @Qualifier(&quot;pubsubInputChannel&quot;) MessageChannel inputChannel,
              PubSubTemplate pubSubTemplate) {
          PubSubInboundChannelAdapter adapter =
                  new PubSubInboundChannelAdapter(pubSubTemplate, subscription);
          adapter.setErrorChannelName(&quot;pubsubErrors&quot;);
          adapter.setOutputChannel(inputChannel);
          adapter.setAckMode(AckMode.MANUAL);
  
          return adapter;
      }
  
      @ServiceActivator(inputChannel = &quot;pubsubErrors&quot;)
      public void pubsubErrorHandler(Message&lt;MessagingException&gt; exceptionMessage) {
          BasicAcknowledgeablePubsubMessage originalMessage =
                  (BasicAcknowledgeablePubsubMessage) exceptionMessage.getPayload().getFailedMessage()
                          .getHeaders().get(GcpPubSubHeaders.ORIGINAL_MESSAGE);
  
          originalMessage.nack();
      }
  
      @Bean
      public MessageChannel pubsubInputChannel() {
          return new DirectChannel();
      }
  
      @Bean
      @InboundChannelAdapter(channel = &quot;pubsubInputChannel&quot;, poller = @Poller(fixedDelay = &quot;100&quot;))
      public MessageSource&lt;Object&gt; pubsubAdapter(PubSubTemplate pubSubTemplate) {
          PubSubMessageSource messageSource = new PubSubMessageSource(pubSubTemplate, subscription);
          messageSource.setAckMode(AckMode.MANUAL);
          messageSource.setPayloadType(String.class);
          messageSource.setBlockOnPull(true);
          messageSource.setMaxFetchSize(20 * 1024 * 1024);
          return messageSource;
      }
  }
  </code></pre>
  <p>The topic channel</p>
  <pre><code>@Configuration
      public class TopicChannel {
          private final String topic = &quot;testt&quot;;
      
          @Bean
          @ServiceActivator(inputChannel = &quot;pubsubOutputChannel&quot;)
          public MessageHandler messageSender(PubSubTemplate pubsubTemplate) {
              return new PubSubMessageHandler(pubsubTemplate, topic);
          }
      
          @MessagingGateway(defaultRequestChannel = &quot;pubsubOutputChannel&quot;)
          public interface PubsubOutboundGateway {
              void sendToPubsub(String text);
          }
      
      }
  </code></pre>
  <p>When  run the app I get this error</p>
  <blockquote>
  <p>org.springframework.beans.factory.UnsatisfiedDependencyException:
  Error creating bean with name 'messageChannelAdapter' defined in class
  path resource
  [com/payfree/bftConfiguration/pubsub/SubscriberChannel.class]:
  Unsatisfied dependency expressed through method
  'messageChannelAdapter' parameter 1; nested exception is
  org.springframework.beans.factory.UnsatisfiedDependencyException:
  Error creating bean with name 'pubSubTemplate' defined in class path
  resource
  [com/google/cloud/spring/autoconfigure/pubsub/GcpPubSubAutoConfiguration.class]:
  Unsatisfied dependency expressed through method 'pubSubTemplate'
  parameter 0; nested exception is
  org.springframework.beans.factory.UnsatisfiedDependencyException:
  Error creating bean with name 'pubSubPublisherTemplate' defined in
  class path resource
  [com/google/cloud/spring/autoconfigure/pubsub/GcpPubSubAutoConfiguration.class]:
  Unsatisfied dependency expressed through method
  'pubSubPublisherTemplate' parameter 0; nested exception is
  org.springframework.beans.factory.BeanCreationException: Error
  creating bean with name 'defaultPublisherFactory' defined in class
  path resource
  [com/google/cloud/spring/autoconfigure/pubsub/GcpPubSubAutoConfiguration.class]:
  Bean instantiation via factory method failed; nested exception is
  org.springframework.beans.BeanInstantiationException: Failed to
  instantiate [com.google.cloud.spring.pubsub.support.PublisherFactory]:
  Factory method 'defaultPublisherFactory' threw exception; nested
  exception is java.lang.IllegalArgumentException: The project ID can't
  be null or empty.</p>
  </blockquote>
  <p>How can I fix this error?</p>