Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

构建的时候报org.jetbrains.annotations不存在 #155

Open
wenjianli92 opened this issue Oct 31, 2022 · 4 comments
Open

构建的时候报org.jetbrains.annotations不存在 #155

wenjianli92 opened this issue Oct 31, 2022 · 4 comments

Comments

@wenjianli92
Copy link

/Users/wenjianli/muyuan/my-slaughter-logistics-driver/node_modules/react-native-amap-geolocation/lib/android/src/main/java/cn/qiuxiang/react/geolocation/AMapGeolocationModule.java:9: 错误: 程序包org.jetbrains.annotations不存在
import org.jetbrains.annotations.NotNull;
^
/Users/wenjianli/muyuan/my-slaughter-logistics-driver/node_modules/react-native-amap-geolocation/lib/android/src/main/java/cn/qiuxiang/react/geolocation/AMapGeolocationPackage.java:7: 错误: 程序包org.jetbrains.annotations不存在
import org.jetbrains.annotations.NotNull;
^
/Users/wenjianli/muyuan/my-slaughter-logistics-driver/node_modules/react-native-amap-geolocation/lib/android/src/main/java/cn/qiuxiang/react/geolocation/AMapGeolocationModule.java:23: 错误: 找不到符号
@NotNull
^
符号: 类 NotNull
位置: 类 AMapGeolocationModule
/Users/wenjianli/muyuan/my-slaughter-logistics-driver/node_modules/react-native-amap-geolocation/lib/android/src/main/java/cn/qiuxiang/react/geolocation/AMapGeolocationPackage.java:15: 错误: 找不到符号
public List createViewManagers(@NotNull ReactApplicationContext reactContext) {
^
符号: 类 NotNull
位置: 类 AMapGeolocationPackage
/Users/wenjianli/muyuan/my-slaughter-logistics-driver/node_modules/react-native-amap-geolocation/lib/android/src/main/java/cn/qiuxiang/react/geolocation/AMapGeolocationPackage.java:13: 错误: 找不到符号
@NotNull
^
符号: 类 NotNull
位置: 类 AMapGeolocationPackage
/Users/wenjianli/muyuan/my-slaughter-logistics-driver/node_modules/react-native-amap-geolocation/lib/android/src/main/java/cn/qiuxiang/react/geolocation/AMapGeolocationPackage.java:21: 错误: 找不到符号
public List createNativeModules(@NotNull ReactApplicationContext reactContext) {
^
符号: 类 NotNull
位置: 类 AMapGeolocationPackage
/Users/wenjianli/muyuan/my-slaughter-logistics-driver/node_modules/react-native-amap-geolocation/lib/android/src/main/java/cn/qiuxiang/react/geolocation/AMapGeolocationPackage.java:19: 错误: 找不到符号
@NotNull
^
符号: 类 NotNull
位置: 类 AMapGeolocationPackage
/Users/wenjianli/muyuan/my-slaughter-logistics-driver/node_modules/react-native-amap-geolocation/lib/android/src/main/java/cn/qiuxiang/react/geolocation/AMapGeolocationPackage.java:22: 错误: 不兼容的类型: List无法转换为List
return Collections.singletonList(new AMapGeolocationModule(reactContext));
^
8 个错误

@wenjianli92
Copy link
Author

在build.grale中加了compileOnly 'org.jetbrains:annotations:23.0.0'可以了,但是最后一个错误还在,
/Users/wenjianli/muyuan/my-slaughter-logistics-driver/node_modules/react-native-amap-geolocation/lib/android/src/main/java/cn/qiuxiang/react/geolocation/AMapGeolocationPackage.java:22: 错误: 不兼容的类型: List无法转换为List
return Collections.singletonList(new AMapGeolocationModule(reactContext));
^
1 个错误

@qduck
Copy link

qduck commented Nov 1, 2022

一样的错误+1;大佬来帮忙!

@wenjianli92
Copy link
Author

image
/node_modules/react-native-amap-geolocation/lib/android/build.gradle按上图加compileOnly 'org.jetbrains:annotations:23.0.0'

@dxmzk
Copy link

dxmzk commented Dec 16, 2022

最直接的办法是删除 @NotNull

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants