Skip to content
This repository has been archived by the owner on Jun 23, 2023. It is now read-only.

Android build fails #13

Open
dragonfax opened this issue Oct 16, 2020 · 8 comments
Open

Android build fails #13

dragonfax opened this issue Oct 16, 2020 · 8 comments

Comments

@dragonfax
Copy link

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
Copy link
Author

Latest Android Studio.

Very simple project that just uses your example code.

MacOS

@hicnar
Copy link

hicnar commented Nov 3, 2020

@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).

@dragonfax
Copy link
Author

dragonfax commented Nov 3, 2020

I'm trying to use this on Android.

@hicnar
Copy link

hicnar commented Nov 3, 2020

Go for RawKeyboardListener then! It has it all.

@apecoraro
Copy link
Contributor

apecoraro commented Nov 3, 2020

@dragonfax: Does the example app build for you?

@apecoraro
Copy link
Contributor

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.

@Snowworm3000
Copy link

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

@aevzp
Copy link

aevzp commented Jun 29, 2021

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants