siddhesh-tamhanekar / media_player

An flutter media player to make media streaming apps effortlessly! read getting started tutorial on https://medium.com/@tamhanekar.siddhesh95/integrate-media-player-into-your-flutter-application-23040213f0c9
MIT License
46 stars 22 forks source link

Build error (androidx) #11

Open tarekbazine opened 5 years ago

tarekbazine commented 5 years ago

I got this error once I build (I think it is related to androidx migration )

Running Gradle task 'assembleDebug'...
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
D:\src\flutter\.pub-cache\hosted\pub.dartlang.org\media_player-0.0.7\android\src\main\java\com\example\mediaplayer\VideoPlayer.java:44: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
D:\src\flutter\.pub-cache\hosted\pub.dartlang.org\media_player-0.0.7\android\src\main\java\com\example\mediaplayer\PersistentNotification.java:22: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
D:\src\flutter\.pub-cache\hosted\pub.dartlang.org\media_player-0.0.7\android\src\main\java\com\example\mediaplayer\PersistentNotification.java:59: error: cannot find symbol
        @Nullable
         ^
  symbol:   class Nullable
  location: class PersistentNotification.MyMediaDescriptionAdapter
D:\src\flutter\.pub-cache\hosted\pub.dartlang.org\media_player-0.0.7\android\src\main\java\com\example\mediaplayer\PersistentNotification.java:65: error: cannot find symbol
        @Nullable
         ^
  symbol:   class Nullable
  location: class PersistentNotification.MyMediaDescriptionAdapter
D:\src\flutter\.pub-cache\hosted\pub.dartlang.org\media_player-0.0.7\android\src\main\java\com\example\mediaplayer\PersistentNotification.java:72: error: cannot find symbol
        @Nullable
         ^
  symbol:   class Nullable
  location: class PersistentNotification.MyMediaDescriptionAdapter
Note: D:\src\flutter\.pub-cache\hosted\pub.dartlang.org\media_player-0.0.7\android\src\main\java\com\example\mediaplayer\VideoPlayer.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\src\flutter\.pub-cache\hosted\pub.dartlang.org\media_player-0.0.7\android\src\main\java\com\example\mediaplayer\MediaPlayerPlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
5 errors

FAILURE: Build failed with an exception.

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

BUILD FAILED in 2m 15s
*******************************************************************************************
The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.
See https://goo.gl/CP92wY for more information on the problem and how to fix it.
*******************************************************************************************
Finished with error: Gradle task assembleDebug failed with exit code 1

Please any help, thanks

albertloubet commented 5 years ago

I have this problem too.

ronaldG19 commented 5 years ago

flutter 1.10.1 dev channel worked for me

zhuruyi2013 commented 5 years ago

same error too

zhuruyi2013 commented 5 years ago

comments the follow code can temp fix the problem : android.useAndroidX=true android.enableJetifier=true