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

react-native-photo-view:compileDebugJavaWithJavac FAILED #189

Closed
chinesedfan opened this issue Jun 29, 2019 · 4 comments
Closed

react-native-photo-view:compileDebugJavaWithJavac FAILED #189

chinesedfan opened this issue Jun 29, 2019 · 4 comments

Comments

@chinesedfan
Copy link

I solved this problem by removing those annotations, see chinesedfan@f6527be. Because they only help the compiler find errors.

If someone has a better way, please tell me. And sorry for the untranslated outputs.

> Task :react-native-photo-view:compileDebugJavaWithJavac FAILED
/Users/zhong/Desktop/github/git-point/node_modules/react-native-photo-view/android/src/main/java/com/reactnative/photoview/ImageEvent.java:12: 错误: 程序包android.support.annotation不存在
import android.support.annotation.IntDef;
                                 ^
/Users/zhong/Desktop/github/git-point/node_modules/react-native-photo-view/android/src/main/java/com/reactnative/photoview/ImageEvent.java:21: 错误: 找不到符号
  @IntDef({ON_ERROR, ON_LOAD, ON_LOAD_END, ON_LOAD_START, ON_TAP, ON_VIEW_TAP, ON_SCALE})
   ^
  符号:   类 IntDef
  位置: 类 ImageEvent
注: 某些输入文件使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
注: 某些输入文件使用了未经检查或不安全的操作。
注: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。
2 个错误
@chinesedfan
Copy link
Author

Seems it is due to AndroidX, gitpoint/git-point@017d2e5.

@stevenleeg
Copy link

Hey, I'm also seeing this issue while trying to build an .apk but commenting out both lines in gradle.properties doesn't seem to be working. Do you have any other suggestions for what might be causing this?

@stevenleeg
Copy link

stevenleeg commented Feb 20, 2020

Ooh, just reread this a bit later after seeing another instance of this:

> Task :react-native-photo-view:compileReleaseJavaWithJavac FAILED

[project-path]/app/node_modules/react-native-photo-view/android/src/main/java/com/reactnative/photoview/ImageEvent.java:12: error: package android.support.annotation does not exist
import android.support.annotation.IntDef;

and managed to fix it by making the same changes that you did, but lazily doing so within node_modules/react-native-photo-view. Hope this helps anyone else facing this issue.

@kading
Copy link

kading commented Sep 2, 2021

Please see details here:
facebook/react-native#25483 (comment)

In short: run npx jetify to fix the issue (https://github.com/mikehardy/jetifier)

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