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

plugin with id 'maven' not found #114

Open
NiccoloCase opened this issue Nov 26, 2022 · 1 comment
Open

plugin with id 'maven' not found #114

NiccoloCase opened this issue Nov 26, 2022 · 1 comment
Labels
question Further information is requested

Comments

@NiccoloCase
Copy link

Question

When using the package with Expo the command eas build --profile development --platform android fails with a series of warnings and errors.

Expo doctor:

Running "expo doctor"
- Finding all copies of expo-modules-autolinking
- Finding all copies of @expo/config-plugins
[stderr] [20:13:25] Expected package @expo/config-plugins@^5.0.0
[stderr] [20:13:25] Found invalid:
[stderr] [20:13:25]   @expo/[email protected]
[stderr] [20:13:25]   (for more info, run: npm why @expo/config-plugins)
- Finding all copies of @expo/prebuild-config
- Finding all copies of @unimodules/core
- Finding all copies of @unimodules/react-native-adapter
- Finding all copies of react-native-unimodules
Command "expo doctor" failed.
bash exited with non-zero code: 1

Gradlew:

[stderr] FAILURE: Build completed with 2 failures.
[stderr] 1: Task failed with an exception.
[stderr] -----------
[stderr] * Where:
[stderr] Build file '/home/expo/workingdir/build/node_modules/react-native-google-nearby-messages/android/build.gradle' line: 24
[stderr] * What went wrong:
[stderr] A problem occurred evaluating project ':react-native-google-nearby-messages'.
[stderr] > Plugin with id 'maven' not found.
[stderr] * Try:
[stderr] > Run with --stacktrace option to get the stack trace.
[stderr] > Run with --info or --debug option to get more log output.
[stderr] > Run with --scan to get full insights.
[stderr] ==============================================================================
[stderr] 2: Task failed with an exception.
[stderr] -----------
[stderr] * What went wrong:
[stderr] A problem occurred configuring project ':react-native-google-nearby-messages'.
[stderr] > compileSdkVersion is not specified. Please add it to build.gradle
[stderr] * Try:
[stderr] > Run with --stacktrace option to get the stack trace.
[stderr] > Run with --info or --debug option to get more log output.
[stderr] > Run with --scan to get full insights.
[stderr] ==============================================================================
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 1m 49s
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.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/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings
6 actionable tasks: 6 executed
Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.

This instead is the plugin that I implemented according to the package requests:

  const { AndroidConfig, withAndroidManifest } = require("@expo/config-plugins");
  const { addMetaDataItemToMainApplication, getMainApplicationOrThrow } =
    AndroidConfig.Manifest;
  
  module.exports = withMyCustomConfig = (config) => {
    return withAndroidManifest(config, async (config) => {
      // Modifiers can be async, but try to keep them fast.
      config.modResults = await setCustomConfigAsync(config, config.modResults);
      return config;
    });
  };
  
  // Splitting this function out of the mod makes it easier to test.
  async function setCustomConfigAsync(config, androidManifest) {
    const appId = "my-app-id";
    // Get the <application /> tag and assert if it doesn't exist.
    const mainApplication = getMainApplicationOrThrow(androidManifest);
  
    addMetaDataItemToMainApplication(
      mainApplication,
      // value for `android:name`
      "com.google.android.nearby.messages.API_KEY",
      // value for `android:value`
      "myabikey"
    );
  
    return androidManifest;
  }

I honestly have no idea if this is the correct implementation, help would be very welcome. Thanks in advance.

Environment

"react": 18.1.0,
"react-native": 0.70.5,
"react-native-google-nearby-messages": 1.0.22
@NiccoloCase NiccoloCase added the question Further information is requested label Nov 26, 2022
@Romoli-Gabriele
Copy link

I have the same problem too. I have the same error not with Expo but with react-native init.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants