question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

App don't run: BUILD FAILED error: cannot find symbol import android.support.annotation.Nullable

See original GitHub issue

I have a project just created with version 0.59.10 of react native and after trying to install react-navigation my android app doesn’t build anymore. When I try to build on android I get this error:

warning: [options] source value 7 is obsolete and will be removed in a future release
warning: [options] target value 7 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:36: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRegistry.java:11: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
/Users/leonardomosiah/Projetos/smash-meet/node_modules/react-native-gesture-handler/android/lib/src/main/java/com/swmansion/gesturehandler/GestureHandlerOrchestrator.java:14: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.java:3: error: package android.support.v4.util does not exist
import android.support.v4.util.Pools;
                              ^
/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.java:11: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.java:19: error: package Pools does not exist
  private static final Pools.SynchronizedPool<RNGestureHandlerEvent> EVENTS_POOL =
                            ^
/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.java:3: error: package android.support.v4.util does not exist
import android.support.v4.util.Pools;
                              ^
/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.java:11: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.java:19: error: package Pools does not exist
  private static final Pools.SynchronizedPool<RNGestureHandlerStateChangeEvent> EVENTS_POOL =
                            ^
/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerPackage.java:16: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootInterface.java:3: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootViewManager.java:10: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootView.java:10: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEnabledRootView.java:10: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:529: error: cannot find symbol
  public @Nullable Map getConstants() {
          ^
  symbol:   class Nullable
  location: class RNGestureHandlerModule
/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:632: error: cannot find symbol
  private @Nullable RNGestureHandlerRootHelper findRootHelperForViewAncestor(int viewTag) {
           ^
  symbol:   class Nullable
  location: class RNGestureHandlerModule
/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:649: error: cannot find symbol
  private @Nullable HandlerFactory findFactoryForHandler(GestureHandler handler) {
           ^
  symbol:   class Nullable
  location: class RNGestureHandlerModule
/node_modules/react-native-gesture-handler/android/lib/src/main/java/com/swmansion/gesturehandler/GestureHandlerOrchestrator.java:321: error: cannot find symbol
  private boolean isViewAttachedUnderWrapper(@Nullable View view) {
                                              ^
  symbol:   class Nullable
  location: class GestureHandlerOrchestrator
/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRegistry.java:23: error: cannot find symbol
  public synchronized @Nullable GestureHandler getHandler(int handlerTag) {
                       ^
  symbol:   class Nullable
  location: class RNGestureHandlerRegistry
/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.java:24: error: cannot find symbol
          @Nullable RNGestureHandlerEventDataExtractor dataExtractor) {
           ^
  symbol:   class Nullable
  location: class RNGestureHandlerEvent
/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.java:40: error: cannot find symbol
          @Nullable RNGestureHandlerEventDataExtractor dataExtractor) {
           ^
  symbol:   class Nullable
  location: class RNGestureHandlerEvent
/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.java:26: error: cannot find symbol
          @Nullable RNGestureHandlerEventDataExtractor dataExtractor) {
           ^
  symbol:   class Nullable
  location: class RNGestureHandlerStateChangeEvent
/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.java:44: error: cannot find symbol
          @Nullable RNGestureHandlerEventDataExtractor dataExtractor) {
           ^
  symbol:   class Nullable
  location: class RNGestureHandlerStateChangeEvent
/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootInterface.java:6: error: cannot find symbol
  @Nullable RNGestureHandlerRootHelper getRootHelper();
   ^
  symbol:   class Nullable
  location: interface RNGestureHandlerRootInterface
/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootViewManager.java:42: error: cannot find symbol
  public @Nullable Map getExportedCustomDirectEventTypeConstants() {
          ^
  symbol:   class Nullable
  location: class RNGestureHandlerRootViewManager
/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootView.java:14: error: cannot find symbol
  private @Nullable RNGestureHandlerRootHelper mRootHelper;
           ^
  symbol:   class Nullable
  location: class RNGestureHandlerRootView
/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEnabledRootView.java:14: error: cannot find symbol
  private @Nullable ReactInstanceManager mReactInstanceManager;
           ^
  symbol:   class Nullable
  location: class RNGestureHandlerEnabledRootView
/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEnabledRootView.java:15: error: cannot find symbol
  private @Nullable RNGestureHandlerRootHelper mGestureRootHelper;
           ^
  symbol:   class Nullable
  location: class RNGestureHandlerEnabledRootView
node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEnabledRootView.java:63: error: cannot find symbol
          @Nullable Bundle initialProperties) {
           ^
  symbol:   class Nullable
  location: class RNGestureHandlerEnabledRootView
/node_modules/react-native-gesture-handler/android/lib/src/main/java/com/swmansion/gesturehandler/GestureHandlerOrchestrator.java:328: error: cannot find symbol
    @Nullable ViewParent parent = view.getParent();
     ^
  symbol:   class Nullable
  location: class GestureHandlerOrchestrator
/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.java:20: error: package Pools does not exist
          new Pools.SynchronizedPool<>(TOUCH_EVENTS_POOL_SIZE);
                   ^
react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.java:20: error: package Pools does not exist
          new Pools.SynchronizedPool<>(TOUCH_EVENTS_POOL_SIZE);
                   ^
Note: /react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.java uses or overrides 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.
32 errors
3 warnings

Does anybody had the same problem?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:6

github_iconTop GitHub Comments

4reactions
flapsccommented, Oct 11, 2019

Try npx jetify. it solved the problem to me. yes, thanks a lot, it helped and now everything works!!!

4reactions
seergiioo6commented, Oct 11, 2019

Try npx jetify. it solved the problem to me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

error: cannot find symbol import androidx.annotation.Nullable
To solve these two new errors, I tried adding the line implementation "com.android.support:support-annotations:+" to my gradle.build ...
Read more >
Known issues with Android Studio and Android Gradle Plugin
To fix the issue for the current project, click Run > Edit Configurations and change the default JUnit configuration to only include the...
Read more >
error: package android.support.annotation does not exist
When building your Android application, you might find an error saying that the package android.support.annotation does not exist. Here's an ...
Read more >
Android build keeps failing when at the Gradle phase no ...
... error log in this;. CommandInvokationFailure: Gradle build failed. ... error: package android.support.annotation does not exist; import ...
Read more >
Have trouble with QReader with fuse X - Bug Reports
I have do this integration in the past (3 years) with fuse and everithing work ... error: cannot find symbol import android.support.v4.app.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found