Doesn't work with Android build react-native@0.60+
See original GitHub issuefeature request
Add support for AndroidX (react-native@0.60+)
bug report Application cannot be built for Android platform with latest react-native@0.60+. See following errors when trying to assemble dev build:
oid.support.annotation does not exist
import android.support.annotation.IntDef;
^
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/ViewShot.java:12: error: package android.support.annotation does not exist
import android.support.annotation.NonNull;
^
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/ViewShot.java:13: error: package android.support.annotation does not exist
import android.support.annotation.StringDef;
^
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/ViewShot.java:70: error: cannot find symbol
@IntDef({Formats.JPEG, Formats.PNG, Formats.WEBP, Formats.RAW})
^
symbol: class IntDef
location: class ViewShot
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/ViewShot.java:87: error: cannot find symbol
@StringDef({Results.BASE_64, Results.DATA_URI, Results.TEMP_FILE, Results.ZIP_BASE_64})
^
symbol: class StringDef
location: class ViewShot
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/RNViewShotModule.java:8: error: package android.support.annotation does not exist
import android.support.annotation.NonNull;
^
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/DebugViews.java:8: error: package android.support.annotation does not exist
import android.support.annotation.NonNull;
^
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/DebugViews.java:9: error: package android.support.v4.util does not exist
import android.support.v4.util.Pair;
^
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/ViewShot.java:202: error: cannot find symbol
private void saveToTempFileOnDevice(@NonNull final View view) throws IOException {
^
symbol: class NonNull
location: class ViewShot
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/ViewShot.java:209: error: cannot find symbol
private void saveToRawFileOnDevice(@NonNull final View view) throws IOException {
^
symbol: class NonNull
location: class ViewShot
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/ViewShot.java:228: error: cannot find symbol
private void saveToDataUriString(@NonNull final View view) throws IOException {
^
symbol: class NonNull
location: class ViewShot
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/ViewShot.java:243: error: cannot find symbol
private void saveToBase64String(@NonNull final View view) throws IOException {
^
symbol: class NonNull
location: class ViewShot
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/ViewShot.java:278: error: cannot find symbol
private List<View> getAllChildren(@NonNull final View v) {
^
symbol: class NonNull
location: class ViewShot
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/ViewShot.java:277: error: cannot find symbol
@NonNull
^
symbol: class NonNull
location: class ViewShot
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/ViewShot.java:302: error: cannot find symbol
private Point captureView(@NonNull final View view, @NonNull final OutputStream os) throws IOException {
^
symbol: class NonNull
location: class ViewShot
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/ViewShot.java:302: error: cannot find symbol
private Point captureView(@NonNull final View view, @NonNull final OutputStream os) throws IOException {
^
symbol: class NonNull
location: class ViewShot
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/ViewShot.java:318: error: cannot find symbol
private Point captureViewImpl(@NonNull final View view, @NonNull final OutputStream os) {
^
symbol: class NonNull
location: class ViewShot
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/ViewShot.java:318: error: cannot find symbol
private Point captureViewImpl(@NonNull final View view, @NonNull final OutputStream os) {
^
symbol: class NonNull
location: class ViewShot
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/ViewShot.java:405: error: cannot find symbol
private Matrix applyTransformations(final Canvas c, @NonNull final View root, @NonNull final View child) {
^
symbol: class NonNull
location: class ViewShot
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/ViewShot.java:405: error: cannot find symbol
private Matrix applyTransformations(final Canvas c, @NonNull final View root, @NonNull final View child) {
^
symbol: class NonNull
location: class ViewShot
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/ViewShot.java:403: error: cannot find symbol
@NonNull
^
symbol: class NonNull
location: class ViewShot
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/ViewShot.java:458: error: cannot find symbol
private static int proposeSize(@NonNull final View view) {
^
symbol: class NonNull
location: class ViewShot
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/ViewShot.java:468: error: cannot find symbol
private static void recycleBitmap(@NonNull final Bitmap bitmap) {
^
symbol: class NonNull
location: class ViewShot
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/ViewShot.java:477: error: cannot find symbol
@NonNull
^
symbol: class NonNull
location: class ViewShot
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/ViewShot.java:496: error: cannot find symbol
@NonNull
^
symbol: class NonNull
location: class ViewShot
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/ViewShot.java:521: error: cannot find symbol
public ReusableByteArrayOutputStream(@NonNull final byte[] buffer) {
^
symbol: class NonNull
location: class ReusableByteArrayOutputStream
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/ViewShot.java:534: error: cannot find symbol
@NonNull
^
symbol: class NonNull
location: class ReusableByteArrayOutputStream
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/RNViewShotModule.java:166: error: cannot find symbol
private File createTempFile(@NonNull final Context context, @NonNull final String ext) throws IOException {
^
symbol: class NonNull
location: class RNViewShotModule
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/RNViewShotModule.java:166: error: cannot find symbol
private File createTempFile(@NonNull final Context context, @NonNull final String ext) throws IOException {
^
symbol: class NonNull
location: class RNViewShotModule
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/RNViewShotModule.java:165: error: cannot find symbol
@NonNull
^
symbol: class NonNull
location: class RNViewShotModule
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/RNViewShotModule.java:148: error: cannot find symbol
private void cleanDirectory(@NonNull final File directory) {
^
symbol: class NonNull
location: class CleanTask
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/DebugViews.java:44: error: cannot find symbol
public static int longDebug(@NonNull final String tag, @NonNull final String message) {
^
symbol: class NonNull
location: class DebugViews
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/DebugViews.java:44: error: cannot find symbol
public static int longDebug(@NonNull final String tag, @NonNull final String message) {
^
symbol: class NonNull
location: class DebugViews
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/DebugViews.java:67: error: cannot find symbol
public static String logViewHierarchy(@NonNull final Activity activity) {
^
symbol: class NonNull
location: class DebugViews
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/DebugViews.java:66: error: cannot find symbol
@NonNull
^
symbol: class NonNull
location: class DebugViews
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/DebugViews.java:80: error: cannot find symbol
private static String logViewHierarchy(@NonNull final View root) {
^
symbol: class NonNull
location: class DebugViews
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/DebugViews.java:79: error: cannot find symbol
@NonNull
^
symbol: class NonNull
location: class DebugViews
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/DebugViews.java:112: error: cannot find symbol
private static String dumpProperties(@NonNull final Resources r, @NonNull final View v) {
^
symbol: class NonNull
location: class DebugViews
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/DebugViews.java:112: error: cannot find symbol
private static String dumpProperties(@NonNull final Resources r, @NonNull final View v) {
^
symbol: class NonNull
location: class DebugViews
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/DebugViews.java:111: error: cannot find symbol
@NonNull
^
symbol: class NonNull
location: class DebugViews
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/DebugViews.java:214: error: cannot find symbol
private static String resolveIdToName(@Nullable final Resources r, @NonNull final View v) {
^
symbol: class NonNull
location: class DebugViews
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/DebugViews.java:213: error: cannot find symbol
@NonNull
^
symbol: class NonNull
location: class DebugViews
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/DebugViews.java:83: error: cannot find symbol
final Stack<Pair<String, View>> stack = new Stack<>();
^
symbol: class Pair
location: class DebugViews
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/DebugViews.java:84: error: cannot find symbol
stack.push(Pair.create("", root));
^
symbol: variable Pair
location: class DebugViews
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/DebugViews.java:87: error: cannot find symbol
@NonNull final Pair<String, View> p = stack.pop();
^
symbol: class Pair
location: class DebugViews
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/DebugViews.java:87: error: cannot find symbol
@NonNull final Pair<String, View> p = stack.pop();
^
symbol: class NonNull
location: class DebugViews
/Users/sanogtx/WebstormProjects/EPAM_Projects/ELAT-DEV/mobile-ui-configure/node_modules/react-native-view-shot/android/src/main/java/fr/greweb/reactnativeviewshot/DebugViews.java:88: error: cannot find symbol
@NonNull final View v = p.second;
Version & Platform
react-native-view-shot@2.6.0
Platform: Android
Expected behavior
Android bundle can be assembled with react-native@0.60+
Actual behavior
Android bundle cannot be assembled with react-native@0.60+
Steps to reproduce the behavior
- react-native init NewProject (create fresh react-native@0.60+ project)
- yarn add react-native-view-shot (add react-native-view-shot dependency)
- react-native run-android (run android dev build)
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (4 by maintainers)
Top Results From Across the Web
Android release build doesn't work with react-native@0.60 ...
Init new fresh project with latest react-native@0.60.3; Install latest react-native-share (with autolinking); Run RELEASE Android build ...
Read more >Hermes is not working in Android with React-native 0.60.2
build is successfull, but Hermes does not seems to work, in RN 0.59.0 apk was 29 Mb, now it's 46 Mb. If I...
Read more >Upgrade to React Native 0.60 - Matt Oakes
React Native 0.60 is a major update which brings many welcome changes. This article explains what's new, how to upgrade, and what it...
Read more >Troubleshooting
These are some common issues you may run into while setting up ... Try downgrading your Gradle version to 1.2.3 in android/build.gradle ....
Read more >Upgrading a React Native app from 0.60 to 0.65 - YouTube
Jamon attempts to upgrade a React Native app from 0.60 to 0.65 with ... mixed results. ... Your browser can't play this video....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
you can try " yarn add react-native-view-shot@2.6.0" work for me
released a 3.0.0