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. #204

Open
suryababus opened this issue Jul 10, 2022 · 13 comments
Open

Plugin with id 'maven' not found. #204

suryababus opened this issue Jul 10, 2022 · 13 comments

Comments

@suryababus
Copy link
Contributor

suryababus commented Jul 10, 2022

I created a react native project using npx react-native init SocioMusic --template react-native-template-typescript.
And I did yarn add react-native-spotify-remote.

Tried running react-native android. Got the below error. Please help.

* What went wrong:
A problem occurred evaluating project ':react-native-spotify-remote'.
> Plugin with id 'maven' not found.
@Danondso
Copy link

Danondso commented Aug 5, 2022

I'm running into the same problem and it appears that gradle 7 has deprecated the maven plugin. See this expo issue. Based on that it seems like downgrading to gradle 6 will resolve it.

@cjam is anyone working on upgrading this to gradle 7? I wouldn't mind doing the work

@cjam
Copy link
Owner

cjam commented Aug 9, 2022

@Danondso that would be amazing. I haven't had a chance to look as I've been under water with work.

@cjam
Copy link
Owner

cjam commented Aug 10, 2022

@suryababus what version are you using? There have been quite a few changes that were pushed to the @next tag. Could you try that version and see if the issue persists?

@Danondso
Copy link

I'll start looking into this and if @next is doing all right then I'll drop it 👍

@Danondso
Copy link

Okay I did notice that this commit removes the offending line regarding the apply plugin: 'maven'. So the current master doesn't reflect the issue the latest release has. I'm going to try the RC 1.0.0-1 to see if I can compile android.

@Danondso
Copy link

Danondso commented Aug 13, 2022

Upgraded to 1.0.0-1 and I got an error saying the .aar files couldn't be found. I reverted the build.gradle changes back to using files() to get the .aar dependencies and it compiles now.

edit: I stepped thru the remaining setup process to use it and I've logged in thru an android sim without issue. Though the expirationDate is coming back as a java.util.GregorianCalendar object.

// build.gradle
repositories {
    mavenLocal()
    maven {
        // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
        url "$rootDir/../node_modules/react-native/android"
    }
    google()
    mavenCentral()
    jcenter()
    // remove these
    // flatDir {
    //     dirs 'external/SpotifySDK/app-remote-lib'
    //     dirs 'external/SpotifySDK/auth-lib'
    // }
}

dependencies {
    // use the old files syntax
    implementation (files('external/SpotifySDK/auth-lib/spotify-auth-release-1.2.3.aar'))
    implementation (files('external/SpotifySDK/app-remote-lib/spotify-app-remote-release-0.7.2.aar'))
    implementation "com.google.code.gson:gson:2.8.5"  // needed by spotify-app-remote
    //noinspection GradleDynamicVersion
    implementation "com.facebook.react:react-native:+"  // From node_modules
}

@marcelocrljunior
Copy link

Upgraded to 1.0.0-1 and I got an error saying the .aar files couldn't be found. I reverted the build.gradle changes back to using files() to get the .aar dependencies and it compiles now.

edit: I stepped thru the remaining setup process to use it and I've logged in thru an android sim without issue. Though the expirationDate is coming back as a java.util.GregorianCalendar object.

// build.gradle
repositories {
    mavenLocal()
    maven {
        // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
        url "$rootDir/../node_modules/react-native/android"
    }
    google()
    mavenCentral()
    jcenter()
    // remove these
    // flatDir {
    //     dirs 'external/SpotifySDK/app-remote-lib'
    //     dirs 'external/SpotifySDK/auth-lib'
    // }
}

dependencies {
    // use the old files syntax
    implementation (files('external/SpotifySDK/auth-lib/spotify-auth-release-1.2.3.aar'))
    implementation (files('external/SpotifySDK/app-remote-lib/spotify-app-remote-release-0.7.2.aar'))
    implementation "com.google.code.gson:gson:2.8.5"  // needed by spotify-app-remote
    //noinspection GradleDynamicVersion
    implementation "com.facebook.react:react-native:+"  // From node_modules
}

Hey Guys I'm getting the same issue here, but I don't know if I follow strait right this solution, @Danondso what did you changed to managed the missing .aar files?

@Danondso
Copy link

Danondso commented Aug 16, 2022

In my project I opened up /node_modules/react-native-spotify-remote/android/build.gradle and modified the file like in my original post. More specifically I commented out lines 62-65 then I changed lines 69-70 to use the files() function to pull in the .aar files. The v0.3.10 version uses that syntax.

@cjam I can put up a PR for these if that fix seems appropriate.

@marcelocrljunior
Copy link

In my project I opened up /node_modules/react-native-spotify-remote/android/build.gradle and modified the file like in my original post. More specifically I commented out lines 62-65 then I changed lines 69-70 to use the files() function to pull in the .aar files. The v0.3.10 version uses that syntax.

@cjam I can put up a PR for these if that fix seems appropriate.

Now it's working thanks

@busybox11
Copy link

@Danondso Hey, I'm still having this issue. Tried doing the steps you described in your comment but the referenced lines were not corresponding, apparently. I didn't understand, did you use your initial PR also for this issue?

@Danondso
Copy link

@busybox11 I need to rework how I had it setup. I upgraded gradle to version 7 in my repo and using the files() function to import those doesn't work anymore.

I'm going to fork this repo and try to upgrade gradle and get it cooperating with my app to start.

@CaptainHaider
Copy link

@Danondso did you find any solution?

@Danondso
Copy link

@Danondso did you find any solution?

Not for solving this. I switched to use react-native-app-auth. They have a spotify auth example.

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

No branches or pull requests

6 participants