0

there two questions ('Cannot resolve symbol') here sounds a bit similar:

This question its much diffecent i think: Cannot resolve symbol

but this ('Cannot resolve symbol') gives me ideas: Cannot resolve symbol

solution there is by adding a google...ndroid dependency

that's why I tried this:

import com.android.volley.Request.Method.GET;

and its gets red. so line 2 and 11 is red now of this source:

package com.example.demo;
import com.android.volley.Request.Method.GET; // <== red
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class DemoApplication {
    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
        System.out.println("hiHo");
    }
    @RequestMapping(name = "/test", method = RequestMethod.GET)  // <== red
    public String helloWorld() { return "hi"; }
}

if you interested in the complete source: https://gist.github.com/5cb61eb89573d5882991aab7ba860b9b

most of it is a downlod from https://start.spring.io/ without dependicies. i addet spring-boot-starter-jetty in the pom.xml

SL5net
  • 2,282
  • 4
  • 28
  • 44
  • 1
    Why are you importing the `Request.Method` (not `RequestMethod`) from Android (not Spring)? Use https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/bind/annotation/RequestMethod.html – jonrsharpe Mar 09 '21 at 16:17
  • better but also red. https://i.imgur.com/K4j7WGE.png – SL5net Mar 09 '21 at 16:20
  • 1
    Have you actually installed the dependencies? Try `mvn install`. – jonrsharpe Mar 09 '21 at 16:22
  • i did not. now i get by using mvn install `package org.springframework.web.bind.annotation does not exist` https://stackoverflow.com/questions/46087835/package-org-springframework-web-bind-annotation-does-not-exist-even-though-its – SL5net Mar 09 '21 at 16:24
  • works. i have deleted the test folder and did some magic by used the IDEA-Quick-Fix by enter Alt + Enter. run your `mvn install` now its not red anymore https://i.imgur.com/ZlOOYmX.png – SL5net Mar 09 '21 at 16:36

0 Answers0