Запустить Android реагировать родные карты не удалось построить - PullRequest
0 голосов
/ 09 октября 2019

Я пытаюсь настроить запуск в android собственного реактивного проекта, запустить узел js и подготовиться к запуску "build", который я запускаю

cd android && ./gradlew clean &&cd .. && response-native start

и в другом терминале я запускаю

response-native run-android

мой пакет.json:

"react-native": "0.59.0",
"react-native-maps": "git://github.com/react-native-community/react-native-maps.git#master",

после появления первого терминала, но я получаю следующую ошибку:

    > Task :react-native-maps:compileDebugJavaWithJa
    vac FAILED
    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.
    /node_modules/react-native-maps/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java:12: error: package         androidx.core.view does not exist
    import androidx.core.view.GestureDetectorCompat;
                     ^
    /node_modules/react-native-maps/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java:13: error: package androidx.core.view does not exist
    import androidx.core.view.MotionEventCompat;
                     ^
   /node_modules/react-native-maps/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java:73: error: package androidx.core.content does not exist
    import static androidx.core.content.PermissionChecker.checkSelfPermission;
                               ^
    /node_modules/react-native-maps/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java:73: error: static            
    import only from classes and interfaces
    import static androidx.core.content.PermissionChecker.checkSelfPermission;
    ^
    /node_modules/react-native-maps/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java:108: error: cannot find symbol
      private final GestureDetectorCompat gestureDetector;
            ^
      symbol:   class GestureDetectorCompat
      location: class AirMapView
    /node_modules/react-native-maps/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java:165: error: cannot find symbol
            new GestureDetectorCompat(reactContext, new GestureDetector.SimpleOnGestureListener() {
        ^
      symbol:   class GestureDetectorCompat
      location: class AirMapView

    /node_modules/react-native-maps/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java:421: error: cannot find symbol
        return checkSelfPermission(getContext(), PERMISSIONS[0]) == PackageManager.PERMISSION_GRANTED ||
       ^
      symbol:   method checkSelfPermission(Context,String)
      location: class AirMapView
    /node_modules/react-native-maps/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java:422: error: cannot find symbol
            checkSelfPermission(getContext(), PERMISSIONS[1]) == PackageManager.PERMISSION_GRANTED;
    ^
      symbol:   method checkSelfPermission(Context,String)
      location: class AirMapView

    /node_modules/react-native-maps/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java:949: error: cannot find symbol
        int action = MotionEventCompat.getActionMasked(ev);
                     ^
      symbol:   variable MotionEventCompat
      location: class AirMapView
    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.
    9 errors
    3 warnings

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':react-native-maps:compileDebugJavaWithJavac'.
    > Compilation failed; see the compiler error output for details.

    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

    * Get more help at https://help.gradle.org

    BUILD FAILED in 1s
    186 actionable tasks: 1 executed, 185 up-to-date
    error Could not install the app on the device, r
    ead the error above for details.
    Make sure you have an Android emulator running or a device connected and have
    set up your Android development environment:
    https://facebook.github.io/react-native/docs/getting-started.html
    error Command failed: ./gradlew app:installDebug

Это ошибка с плагиномact-native-maps или проблемы сопределить устройство? (Когда я запускаю устройства adb, он правильно отображает устройство эмулятора)

1 Ответ

0 голосов
/ 10 октября 2019

Решено! Текущая версия response-native-maps совместима только с 0.60. +act-native версиями.

Я изменил версию response-native-maps в package.json с

"react-native-maps": "git://github.com/react-native-community/react-native-maps.git#master",

до

"react-native-maps": "^0.25.0",
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...