homerours / cordova-music-controls-plugin

A Cordova plugin displaying music controls in notifications (cordova-plugin-music-controls)
MIT License
155 stars 186 forks source link

Can't build app with this plugin #132

Open IgorRyaboff opened 5 years ago

IgorRyaboff commented 5 years ago

I was trying to build the app with this plugin, but i get this:

`1>MSBUILD : cordova-build error : D:\MyDocs\ProtonMusic\ProtonMusic\platforms\android\src\com\homerours\musiccontrols\MusicControlsNotification.java:28: error: cannot find symbol 1>MSBUILD : cordova-build error : import android.app.NotificationChannel; 1>MSBUILD : cordova-build error : ^ 1>MSBUILD : cordova-build error : symbol: class NotificationChannel 1>MSBUILD : cordova-build error : location: package android.app 1>MSBUILD : cordova-build error : D:\MyDocs\ProtonMusic\ProtonMusic\platforms\android\src\com\homerours\musiccontrols\MusicControlsNotification.java:54: error: cannot find symbol 1>MSBUILD : cordova-build error : int importance = NotificationManager.IMPORTANCE_LOW; 1>MSBUILD : cordova-build error : ^ 1>MSBUILD : cordova-build error : symbol: variable IMPORTANCE_LOW 1>MSBUILD : cordova-build error : location: class NotificationManager 1>MSBUILD : cordova-build error : D:\MyDocs\ProtonMusic\ProtonMusic\platforms\android\src\com\homerours\musiccontrols\MusicControlsNotification.java:56: error: cannot find symbol 1>MSBUILD : cordova-build error : NotificationChannel mChannel = new NotificationChannel(this.CHANNEL_ID, name,importance); 1>MSBUILD : cordova-build error : ^ 1>MSBUILD : cordova-build error : symbol: class NotificationChannel 1>MSBUILD : cordova-build error : location: class MusicControlsNotification 1>MSBUILD : cordova-build error : D:\MyDocs\ProtonMusic\ProtonMusic\platforms\android\src\com\homerours\musiccontrols\MusicControlsNotification.java:56: error: cannot find symbol 1>MSBUILD : cordova-build error : NotificationChannel mChannel = new NotificationChannel(this.CHANNEL_ID, name,importance); 1>MSBUILD : cordova-build error : ^ 1>MSBUILD : cordova-build error : symbol: class NotificationChannel 1>MSBUILD : cordova-build error : location: class MusicControlsNotification 1>MSBUILD : cordova-build error : D:\MyDocs\ProtonMusic\ProtonMusic\platforms\android\src\com\homerours\musiccontrols\MusicControlsNotification.java:156: error: cannot find symbol 1>MSBUILD : cordova-build error : builder.setChannelId(this.CHANNEL_ID); 1>MSBUILD : cordova-build error : ^ 1>MSBUILD : cordova-build error : symbol: method setChannelId(String) 1>MSBUILD : cordova-build error : location: variable builder of type Builder 1>MSBUILD : cordova-build error : 5 errors 1>MSBUILD : cordova-build error : FAILURE: Build failed with an exception. 1>MSBUILD : cordova-build error : What went wrong: 1>MSBUILD : cordova-build error : Execution failed for task ':compileDebugJavaWithJavac'. 1>MSBUILD : cordova-build error : > Compilation failed; see the compiler error output for details. 1>MSBUILD : cordova-build error : Try: 1>MSBUILD : cordova-build error : Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Command finished with error code 1: cmd /s /c "D:\MyDocs\ProtonMusic\ProtonMusic\platforms\android\gradlew.bat cdvBuildDebug -b D:\MyDocs\ProtonMusic\ProtonMusic\platforms\android\build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true" 1>MSBUILD : cordova-build error : Error: cmd: Command failed with exit code 1 Error output: MSBUILD : cordova-build warning : Note: Some input files use or override a deprecated API. MSBUILD : cordova-build warning : Note: Recompile with -Xlint:deprecation for details.

1>MSBUILD : cordova-build error : D:\MyDocs\ProtonMusic\ProtonMusic\platforms\android\src\com\homerours\musiccontrols\MusicControlsNotification.java:28: error: cannot find symbol 1>MSBUILD : cordova-build error : import android.app.NotificationChannel; 1>MSBUILD : cordova-build error : ^ 1>MSBUILD : cordova-build error : symbol: class NotificationChannel 1>MSBUILD : cordova-build error : location: package android.app 1>MSBUILD : cordova-build error : D:\MyDocs\ProtonMusic\ProtonMusic\platforms\android\src\com\homerours\musiccontrols\MusicControlsNotification.java:54: error: cannot find symbol 1>MSBUILD : cordova-build error : int importance = NotificationManager.IMPORTANCE_LOW; 1>MSBUILD : cordova-build error : ^ 1>MSBUILD : cordova-build error : symbol: variable IMPORTANCE_LOW 1>MSBUILD : cordova-build error : location: class NotificationManager 1>MSBUILD : cordova-build error : D:\MyDocs\ProtonMusic\ProtonMusic\platforms\android\src\com\homerours\musiccontrols\MusicControlsNotification.java:56: error: cannot find symbol 1>MSBUILD : cordova-build error : NotificationChannel mChannel = new NotificationChannel(this.CHANNEL_ID, name,importance); 1>MSBUILD : cordova-build error : ^ 1>MSBUILD : cordova-build error : symbol: class NotificationChannel 1>MSBUILD : cordova-build error : location: class MusicControlsNotification 1>MSBUILD : cordova-build error : D:\MyDocs\ProtonMusic\ProtonMusic\platforms\android\src\com\homerours\musiccontrols\MusicControlsNotification.java:56: error: cannot find symbol 1>MSBUILD : cordova-build error : NotificationChannel mChannel = new NotificationChannel(this.CHANNEL_ID, name,importance); 1>MSBUILD : cordova-build error : ^ 1>MSBUILD : cordova-build error : symbol: class NotificationChannel 1>MSBUILD : cordova-build error : location: class MusicControlsNotification 1>MSBUILD : cordova-build error : D:\MyDocs\ProtonMusic\ProtonMusic\platforms\android\src\com\homerours\musiccontrols\MusicControlsNotification.java:156: error: cannot find symbol 1>MSBUILD : cordova-build error : builder.setChannelId(this.CHANNEL_ID); 1>MSBUILD : cordova-build error : ^ 1>MSBUILD : cordova-build error : symbol: method setChannelId(String) 1>MSBUILD : cordova-build error : location: variable builder of type Builder 1>MSBUILD : cordova-build error : 5 errors 1>MSBUILD : cordova-build error : FAILURE: Build failed with an exception. 1>MSBUILD : cordova-build error : What went wrong: 1>MSBUILD : cordova-build error : Execution failed for task ':compileDebugJavaWithJavac'. 1>MSBUILD : cordova-build error : > Compilation failed; see the compiler error output for details. 1>MSBUILD : cordova-build error : Try: 1>MSBUILD : cordova-build error : Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. 1>MSBUILD : cordova-build error : Picked up _JAVA_OPTIONS: -Xmx512M`

What can I do?

aman-gojariya commented 5 years ago

First one remove this plugin with below command ionic cordova plugin rm cordova-plugin-music-controls

then after add this plugin with this command ionic cordova plugin add https://github.com/amitkhare/cordova-music-controls-plugin --save

after you do that, remove the "git+" that gets added to the config.xml and package.json files

I think it's works.

tbergeron commented 5 years ago

@amanpatel1449 WHY does everybody refers to this 3 years old repo when NPM points to this one; which is the most up-to-date?! I see this everywhere, it fixes NOTHING and is just a waste of time. Please EXPLAIN when telling people to simply swap sources. It's borderline a security concern...