Plugin with id 'maven' not found.
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.
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
@Danondso that would be amazing. I haven't had a chance to look as I've been under water with work.
@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?
I'll start looking into this and if @next is doing all right then I'll drop it 👍
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.
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
}
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?
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.
In my project I opened up
/node_modules/react-native-spotify-remote/android/build.gradleand modified the file like in my original post. More specifically I commented out lines 62-65 then I changed lines 69-70 to use thefiles()function to pull in the.aarfiles. 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
@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?
@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.
@Danondso did you find any solution?
@Danondso did you find any solution?
Not for solving this. I switched to use react-native-app-auth. They have a spotify auth example.