media_player icon indicating copy to clipboard operation
media_player copied to clipboard

Build error (androidx)

Open tarekbazine opened this issue 5 years ago • 4 comments

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

tarekbazine avatar Aug 15 '19 21:08 tarekbazine

I have this problem too.

albertloubet avatar Aug 16 '19 15:08 albertloubet

flutter 1.10.1 dev channel worked for me

ronaldG19 avatar Sep 18 '19 22:09 ronaldG19

same error too

zhuruyi2013 avatar Sep 23 '19 14:09 zhuruyi2013

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

zhuruyi2013 avatar Sep 23 '19 14:09 zhuruyi2013