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

Update react and react-native #49

Merged
merged 7 commits into from
Jul 28, 2023

Conversation

sarahsporck
Copy link
Collaborator

@sarahsporck sarahsporck commented Jul 12, 2023

Description

Fixes #7

Checklist

  • I have tested this on a device/simulator for each compatible OS
  • I formatted JS and TS files with running yarn lint:fix in the root folder
  • I have run tests via yarn test in the root folder
  • I updated the documentation with running yarn generate in the root folder
  • I mentioned this change in CHANGELOG.md
  • I updated the typings files (index.d.ts)
  • I added/updated a sample (/example)

@ianthetechie
Copy link
Collaborator

@sarahsporck I pushed a few minor changes and also enabled CI checks (don't know why those weren't there before TBH; my bad haha).

Everything looks good to me on iOS, but Android appears to get stuck on the React Native Flipper integration, which is enabled by default. I stumbled across this issue on GitHub: facebook/react-native#36091. It seems like the initial issue was that assemble is trying to run a release build but this is only in the debug tree (seems logical; it's only for debugging, right?). I tried moving it under the main tree for fun and then it yelled about not having anything that it needed 🤷

at 22:23:44 ❯ ./gradlew assemble

> Task :app:compileDebugJavaWithJavac
Note: /Users/ianthetechie/maplibre-react-native/example/android/app/src/main/java/com/rnmaplibreexample/ReactNativeFlipper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

> Task :app:compileReleaseJavaWithJavac FAILED
/Users/ianthetechie/maplibre-react-native/example/android/app/src/main/java/com/rnmaplibreexample/ReactNativeFlipper.java:10: error: package com.facebook.flipper.android does not exist
import com.facebook.flipper.android.AndroidFlipperClient;
                                   ^
/Users/ianthetechie/maplibre-react-native/example/android/app/src/main/java/com/rnmaplibreexample/ReactNativeFlipper.java:11: error: package com.facebook.flipper.android.utils does not exist
import com.facebook.flipper.android.utils.FlipperUtils;
                                         ^
/Users/ianthetechie/maplibre-react-native/example/android/app/src/main/java/com/rnmaplibreexample/ReactNativeFlipper.java:12: error: package com.facebook.flipper.core does not exist
import com.facebook.flipper.core.FlipperClient;
                                ^
/Users/ianthetechie/maplibre-react-native/example/android/app/src/main/java/com/rnmaplibreexample/ReactNativeFlipper.java:13: error: package com.facebook.flipper.plugins.crashreporter does not exist
import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
                                                 ^
/Users/ianthetechie/maplibre-react-native/example/android/app/src/main/java/com/rnmaplibreexample/ReactNativeFlipper.java:14: error: package com.facebook.flipper.plugins.databases does not exist
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
                                             ^
/Users/ianthetechie/maplibre-react-native/example/android/app/src/main/java/com/rnmaplibreexample/ReactNativeFlipper.java:15: error: package com.facebook.flipper.plugins.fresco does not exist
import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
                                          ^
/Users/ianthetechie/maplibre-react-native/example/android/app/src/main/java/com/rnmaplibreexample/ReactNativeFlipper.java:16: error: package com.facebook.flipper.plugins.inspector does not exist
import com.facebook.flipper.plugins.inspector.DescriptorMapping;
                                             ^
/Users/ianthetechie/maplibre-react-native/example/android/app/src/main/java/com/rnmaplibreexample/ReactNativeFlipper.java:17: error: package com.facebook.flipper.plugins.inspector does not exist
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
                                             ^
/Users/ianthetechie/maplibre-react-native/example/android/app/src/main/java/com/rnmaplibreexample/ReactNativeFlipper.java:18: error: package com.facebook.flipper.plugins.network does not exist
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
                                           ^
/Users/ianthetechie/maplibre-react-native/example/android/app/src/main/java/com/rnmaplibreexample/ReactNativeFlipper.java:19: error: package com.facebook.flipper.plugins.sharedpreferences does not exist
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
                                                     ^
/Users/ianthetechie/maplibre-react-native/example/android/app/src/main/java/com/rnmaplibreexample/ReactNativeFlipper.java:27: error: cannot find symbol
    if (FlipperUtils.shouldEnableFlipper(context)) {
        ^
  symbol:   variable FlipperUtils
  location: class ReactNativeFlipper
/Users/ianthetechie/maplibre-react-native/example/android/app/src/main/java/com/rnmaplibreexample/ReactNativeFlipper.java:28: error: cannot find symbol
      final FlipperClient client = AndroidFlipperClient.getInstance(context);
            ^
  symbol:   class FlipperClient
  location: class ReactNativeFlipper
/Users/ianthetechie/maplibre-react-native/example/android/app/src/main/java/com/rnmaplibreexample/ReactNativeFlipper.java:28: error: cannot find symbol
      final FlipperClient client = AndroidFlipperClient.getInstance(context);
                                   ^
  symbol:   variable AndroidFlipperClient
  location: class ReactNativeFlipper
/Users/ianthetechie/maplibre-react-native/example/android/app/src/main/java/com/rnmaplibreexample/ReactNativeFlipper.java:30: error: cannot find symbol
      client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
                           ^
  symbol:   class InspectorFlipperPlugin
  location: class ReactNativeFlipper
/Users/ianthetechie/maplibre-react-native/example/android/app/src/main/java/com/rnmaplibreexample/ReactNativeFlipper.java:30: error: cannot find symbol
      client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
                                                           ^
  symbol:   variable DescriptorMapping
  location: class ReactNativeFlipper
/Users/ianthetechie/maplibre-react-native/example/android/app/src/main/java/com/rnmaplibreexample/ReactNativeFlipper.java:31: error: cannot find symbol
      client.addPlugin(new DatabasesFlipperPlugin(context));
                           ^
  symbol:   class DatabasesFlipperPlugin
  location: class ReactNativeFlipper
/Users/ianthetechie/maplibre-react-native/example/android/app/src/main/java/com/rnmaplibreexample/ReactNativeFlipper.java:32: error: cannot find symbol
      client.addPlugin(new SharedPreferencesFlipperPlugin(context));
                           ^
  symbol:   class SharedPreferencesFlipperPlugin
  location: class ReactNativeFlipper
/Users/ianthetechie/maplibre-react-native/example/android/app/src/main/java/com/rnmaplibreexample/ReactNativeFlipper.java:33: error: cannot find symbol
      client.addPlugin(CrashReporterPlugin.getInstance());
                       ^
  symbol:   variable CrashReporterPlugin
  location: class ReactNativeFlipper
/Users/ianthetechie/maplibre-react-native/example/android/app/src/main/java/com/rnmaplibreexample/ReactNativeFlipper.java:35: error: cannot find symbol
      NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
      ^
  symbol:   class NetworkFlipperPlugin
  location: class ReactNativeFlipper
/Users/ianthetechie/maplibre-react-native/example/android/app/src/main/java/com/rnmaplibreexample/ReactNativeFlipper.java:35: error: cannot find symbol
      NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
                                                      ^
  symbol:   class NetworkFlipperPlugin
  location: class ReactNativeFlipper
/Users/ianthetechie/maplibre-react-native/example/android/app/src/main/java/com/rnmaplibreexample/ReactNativeFlipper.java:61: error: cannot find symbol
                        client.addPlugin(new FrescoFlipperPlugin());
                                             ^
  symbol: class FrescoFlipperPlugin
/Users/ianthetechie/maplibre-react-native/example/android/app/src/main/java/com/rnmaplibreexample/ReactNativeFlipper.java:67: error: cannot find symbol
        client.addPlugin(new FrescoFlipperPlugin());
                             ^
  symbol:   class FrescoFlipperPlugin
  location: class ReactNativeFlipper
Note: /Users/ianthetechie/maplibre-react-native/example/android/app/src/main/java/com/rnmaplibreexample/ReactNativeFlipper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
22 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileReleaseJavaWithJavac'.
> 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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/8.0.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 11s
419 actionable tasks: 105 executed, 314 up-to-date

@sarahsporck
Copy link
Collaborator Author

Should be fixed. But checks have disappeared again o.o

@ianthetechie
Copy link
Collaborator

I think it's a GitHub security setting that requires approval to run actions for first-time contributors. Fixed the lint issue and re-running now.

@ianthetechie
Copy link
Collaborator

Funny enough, while it works great locally, I still can't run assemble on the Android example. Nor am I really sure why this check exists as part of the CI nor why it works when a run yarn android but not assemble in the android dir 🤷‍♂️ I'm guessing RN has an issue with the toolchain on my Mac (should be latest of basically everything?).

Not worth any more fuss over though; I'll merge this as soon as the iOS pipeline succeeds. Thanks for slogging through this!

@ianthetechie ianthetechie merged commit a2b72b6 into maplibre:main Jul 28, 2023
4 checks passed
@sarahsporck sarahsporck mentioned this pull request Jul 28, 2023
7 tasks
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

Successfully merging this pull request may close these issues.

Upgrade to latest React Native
2 participants