flutter_gamepad icon indicating copy to clipboard operation
flutter_gamepad copied to clipboard

Android build fails

Open dragonfax opened this issue 4 years ago • 8 comments

e: /Users/jstillwell/Code/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_gamepad-0.3.2/android/src/main/kotlin/com/example/flutter_gamepad/FlutterGamepadPlugin.kt: (23, 95): No value passed for parameter 'p1'
e: /Users/jstillwell/Code/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_gamepad-0.3.2/android/src/main/kotlin/com/example/flutter_gamepad/FlutterGamepadPlugin.kt: (33, 124): Type mismatch: inferred type is KeyEventChannel but View was expected
e: /Users/jstillwell/Code/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_gamepad-0.3.2/android/src/main/kotlin/com/example/flutter_gamepad/FlutterGamepadPlugin.kt: (33, 141): Type mismatch: inferred type is TextInputPlugin but KeyEventChannel was expected
e: /Users/jstillwell/Code/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_gamepad-0.3.2/android/src/main/kotlin/com/example/flutter_gamepad/FlutterGamepadPlugin.kt: (33, 156): No value passed for parameter 'p2'
e: /Users/jstillwell/Code/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_gamepad-0.3.2/android/src/main/kotlin/com/example/flutter_gamepad/FlutterGamepadPlugin.kt: (34, 18): Return type of 'onKeyDown' is not a subtype of the return type of the overridden member 'public open fun onKeyDown(@NonNull p0: KeyEvent): Boolean defined in io.flutter.embedding.android.AndroidKeyProcessor'
e: /Users/jstillwell/Code/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_gamepad-0.3.2/android/src/main/kotlin/com/example/flutter_gamepad/FlutterGamepadPlugin.kt: (41, 18): Return type of 'onKeyUp' is not a subtype of the return type of the overridden member 'public open fun onKeyUp(@NonNull p0: KeyEvent): Boolean defined in io.flutter.embedding.android.AndroidKeyProcessor'

FAILURE: Build failed with an exception.

dragonfax avatar Oct 16 '20 10:10 dragonfax

Latest Android Studio.

Very simple project that just uses your example code.

MacOS

dragonfax avatar Oct 16 '20 10:10 dragonfax

@dragonfax Here's what you can do as a temporary measure:

  1. Fork the flutter_gamepad package.
  2. From the Android part of the package remove all code that causes problems and leave just barebones skeleton of the plugin (or "do nothing plugin") so that it registers instead of throwing an exception (which is what happens if you remove everything) when your app loads.
  3. Use the functionality provided by the package for iOS only
  4. Use RawKeyboardListener on Android as it can handle all the keys from gamepad controllers (RawKeyboardListener functionality is not implemented on iOS).

hicnar avatar Nov 03 '20 02:11 hicnar

I'm trying to use this on Android.

dragonfax avatar Nov 03 '20 02:11 dragonfax

Go for RawKeyboardListener then! It has it all.

hicnar avatar Nov 03 '20 02:11 hicnar

@dragonfax: Does the example app build for you?

apecoraro avatar Nov 03 '20 16:11 apecoraro

Oh I think perhaps we just haven't updated pub.dev in a while. The latest code in the master branch of our repo will build though.

apecoraro avatar Nov 03 '20 16:11 apecoraro

The example in the master branch doesn't compile either. I get the same error messages as dragonfax.

Snowworm3000 avatar Mar 21 '21 18:03 Snowworm3000

https://github.com/flutter/flutter/issues/50789#issuecomment-870514415

aevzp avatar Jun 29 '21 11:06 aevzp