build 누르면 자동으로 생성되는 코드 중에
\AndroidStudioProjects\apollographql01\app\build\generated\source\apollo\classes\debug\com\mytube\apollographql01\SayByeQuery.java
import org.jetbrains.annotations.NotNull;
이게 계속 생기는데 이것을 바꾸고 싶어요
schema.json, .graphql 을 넣고 build를 누르면 자동으로 sayByeQuery.java 를 만들어 주고 있는데, 저기 NotNull이 계속 문제였습니다.
(여러가지를 손대서 지금은 그 메시지를 못 띄우겠네요)
핵심 질문.
build를 누르면 자동 생성되는 코드에서 @NotNull을 다루는 것을 바꾸는 방법을 알면 해결할 것 같은데 알려주세요. (jetbrains.annotations.NotNull -> android.annotation.NonNull)
자동 생성된 결과물에서 android.annotation을 import 하려해도 안됩니다. 해도 어차피 새로 생성될때 덮어써지고요.
해결방법이나 검색 키워드를 도와주시면 정말정말 감사하겠습니다.
서버는 잘 동작하는데, apollo-android로 client단 만들다가 Query문을 Java문으로 자동으로 변경해줄때 문제가 생깁니다.
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.apollographql.apollo:apollo-runtime:1.2.1'
implementation "com.apollographql.apollo:apollo-android-support:1.0.0"
implementation 'com.squareup.okhttp3:okhttp:3.0.1'
// For @Nullable/@NonNull
// implementation 'com.android.support:support-annotations:+'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'org.jetbrains:annotations-java5:15.0'
지금까지 해본 것
1.
annotation을 jetbrains 말고 android 제공되는 것으로 바꿔봤습니다.
구글링에서는 된다는데, 저는 다른 상황인지 자꾸 jetbrains가 import 됩니다.
2.
settings -> Inspections -> java/Probable bugs/
"Constant conditions & exceptions" , "@NotNull/@Nullable problems"
2가지 각각 annotation 을 android.support.annotation.Nullable/ NonNull ,android.annotation.Nullable/NonNull
2가지 조합으로 모두 시도해봤습니다.
이것 저것 손대다가 생긴 문제..
jetbrains..annotation이 13.0 15.0 2개나 적용된 것 같은데
13.0은 찾아 볼 수가 없는데, 어디서 갑자기 나온건지 모르겠어요.
NotNull 문제만 해결 되면 새로 프로젝트를 만들어서라도 잘 됐으면 좋겠네요.
초보의 글을 여기까지 읽어주셔서 감사합니다.
Duplicate class org.intellij.lang.annotations.Flow found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-15.0.jar (org.jetbrains:annotations-java5:15.0)
Duplicate class org.intellij.lang.annotations.Identifier found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-15.0.jar (org.jetbrains:annotations-java5:15.0)
Duplicate class org.intellij.lang.annotations.JdkConstants found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-15.0.jar (org.jetbrains:annotations-java5:15.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$AdjustableOrientation found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-15.0.jar (org.jetbrains:annotations-java5:15.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$BoxLayoutAxis found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-15.0.jar (org.jetbrains:annotations-java5:15.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$CalendarMonth found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-15.0.jar (org.jetbrains:annotations-java5:15.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$CursorType found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-15.0.jar (org.jetbrains:annotations-java5:15.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$FlowLayoutAlignment found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-15.0.jar (org.jetbrains:annotations-java5:15.0)