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 is causing APK build failure #215

Open
rum-n opened this issue Jun 24, 2022 · 1 comment
Open

react-native-photo-view is causing APK build failure #215

rum-n opened this issue Jun 24, 2022 · 1 comment

Comments

@rum-n
Copy link

rum-n commented Jun 24, 2022

My react-native-photo-view version is 1.5.2
My RN version is 0.63.4

The error I'm getting when trying to create an APK:

> Task :react-native-photo-view:compileReleaseJavaWithJavac FAILED /[...]/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; ^ /[...]/app/node_modules/react-native-photo-view/android/src/main/java/com/reactnative/photoview/ImageEvent.java:21: error: cannot find symbol @IntDef({ON_ERROR, ON_LOAD, ON_LOAD_END, ON_LOAD_START, ON_TAP, ON_VIEW_TAP, ON_SCALE}) ^ symbol: class IntDef location: class ImageEvent /[...]/app/node_modules/react-native-photo-view/android/src/main/java/com/reactnative/photoview/PhotoView.java:7: error: package android.support.annotation does not exist import android.support.annotation.NonNull; ^ /[...]/app/node_modules/react-native-photo-view/android/src/main/java/com/reactnative/photoview/PhotoView.java:60: error: cannot find symbol @NonNull ResourceDrawableIdHelper resourceDrawableIdHelper) { ^ symbol: class NonNull location: class PhotoView /[...]/app/node_modules/react-native-photo-view/android/src/main/java/com/reactnative/photoview/PhotoView.java:143: error: cannot find symbol public void maybeUpdateView(@NonNull PipelineDraweeControllerBuilder builder) { ^ symbol: class NonNull location: class PhotoView Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 5 errors

Any help would be greatly appreciated.

@vinaysaini89
Copy link

Please Add the following two flags to true in your gradle.properties file at ProjectFolder/android/gradle.properties
android.useAndroidX=true
android.enableJetifier=true

run below command
npm install --save-dev jetifier

add the following to scripts your package.json
"postinstall" : "npx jetify"

this will solve the problem of android annotation

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

2 participants