Open letsar opened 4 years ago
As a workaround, there is another plugin which is a fork of this plugin called :
flutter_keyboard_visibility: 0.7.0
I've gone over the code and the class names and usage is identical - so it should work out of the box.
You can get around the issue by :
1) Using this plugin 2) Change your gradle class to com.android.tools.build:gradle:3.5.0 3) Change your targetSdkVersion to 28 4) Ensure you reference latest gradle distribution URL : distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip 5) Ensure your dependencies do not reference firebase, i.e change
dependencies { testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test: runner:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' implementation 'com.google.firebase:firebase-core:16.0.8' }
to
dependencies { testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test: runner:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' }
Once all 1-5 is done, Do in order :
1. flutter clean 2. Open pubspec.yaml and just make a simple change and SAVE file 3. flutter pub cache repair
Thanks for the workaround @alexda12. It worked like a charm!
As a workaround, there is another plugin which is a fork of this plugin called :
flutter_keyboard_visibility: 0.7.0
I've gone over the code and the class names and usage is identical - so it should work out of the box.
You can get around the issue by :
- Using this plugin
- Change your gradle class to com.android.tools.build:gradle:3.5.0
- Change your targetSdkVersion to 28
- Ensure you reference latest gradle distribution URL : distributionUrl=https://services.gradle.org/distributions/gradle-5.6.2-all.zip
- Ensure your dependencies do not reference firebase, i.e change
dependencies { testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test: runner:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' implementation 'com.google.firebase:firebase-core:16.0.8' }
to
dependencies { testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test: runner:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' }
Once all 1-5 is done, Do in order :
1. flutter clean 2. Open pubspec.yaml and just make a simple change and SAVE file 3. flutter pub cache repair
After following above procedure, throw another error when I run flutter build apk
D:\Development\Node JS\XpertMemos\XpertMemo_flutter>flutter build apk You are building a fat APK that includes binaries for android-arm, android-arm64, android-x64. If you are deploying the app to the Play Store, it's recommended to use app bundles or split the APK to reduce the APK size. To generate an app bundle, run: flutter build appbundle --target-platform android-arm,android-arm64,android-x64 Learn more on: https://developer.android.com/guide/app-bundle To split the APKs per ABI, run: flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi Learn more on: https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split Running Gradle task 'assembleRelease'...
Note: D:\Development\FlutterSDK\flutter.pub-cache\hosted\pub.dartlang.org\connectivity-0.4.3+6\android\src\main\java\io\flutter\plugins\connectivity\ConnectivityPlugin.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. Note: D:\Development\FlutterSDK\flutter.pub-cache\hosted\pub.dartlang.org\permission_handler-3.3.0\android\src\main\java\com\baseflow\permissionhandler\PermissionHandlerPlugin.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: D:\Development\FlutterSDK\flutter.pub-cache\hosted\pub.dartlang.org\share-0.6.3+1\android\src\main\java\io\flutter\plugins\share\SharePlugin.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: D:\Development\FlutterSDK\flutter.pub-cache\hosted\pub.dartlang.org\url_launcher-5.1.3\android\src\main\java\io\flutter\plugins\urllauncher\WebViewActivity.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. D:\Development\Node JS\XpertMemos\XpertMemo_flutter\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java:16: error: a type with the same simple name is already defined by the single-type-import of KeyboardVisibilityPlugin import com.github.adee42.keyboardvisibility.KeyboardVisibilityPlugin; ^ 1 errorFAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:compileReleaseJavaWithJavac'.
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 4m 29s Running Gradle task 'assembleRelease'... Running Gradle task 'assembleRelease'... Done 270.4s (!) Gradle task assembleRelease failed with exit code 1
pubspec.yaml file
dependencies: flutter: sdk: flutter cupertino_icons: ^0.1.2 sqflite: 1.1.7+2 path_provider: 0.5.0+1 http: 0.12.0+2 connectivity: 0.4.3+6 font_awesome_flutter: 8.5.0 flutter_sparkline: any flutter_staggered_grid_view: 0.3.0 intl: ^0.15.8 datetime_picker_formfield: ^0.4.3 qr_flutter: ^3.0.1 flutter_typeahead : 1.6.1
permission_handler: 3.3.0 encrypt: 1.0.1 loader_search_bar: any url_launcher : any geolocator: 5.1.5 file_picker: ^1.4.3+1 image_picker: ^0.6.1+4 progress_indicators: any mime: ^0.9.6+2 fluttertoast: ^3.1.0 pdf: ^1.3.11 printing: ^2.1.3 flutter_local_notifications: 0.7.1+3 image: 2.1.4 flutter_image_compress: ^0.6.3 carousel_slider: ^1.3.0 random_string: ^0.0.2 dio: 2.1.0 file_utils: ^0.1.3 translator: ^0.1.2 photo_view: 0.4.2 flutter_webrtc: 0.1.7 shared_preferences: any auto_size_text: ^2.1.0 firebase_messaging: ^5.1.2 workmanager: ^0.1.2 flutter_barcode_scanner: ^0.1.5+1 progress_dialog: ^1.1.0+1 archive: ^2.0.10 charts_flutter: ^0.8.1 flutter_vector_icons: ^0.2.1 flutter_google_places: ^0.2.3 share: ^0.6.3+1 flutter_keyboard_visibility: ^0.7.0
android\build.gradle file
dependencies { classpath 'com.android.tools.build:gradle:3.5.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.google.gms:google-services:4.2.0' }
targetSdkVersion already 28 android\app\build.gradle file
dependencies { testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test: runner:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' }
I have still facing this error
C:\Users\XPERT_005\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\shared_preferences-0.5.6\android\src\main\java\io\flutter\plugins\sharedpreferences\SharedPreferencesPlugin.java:25: warning: [deprecation] getFlutterEngine() in FlutterPluginBinding has been deprecated setupChannel(binding.getFlutterEngine().getDartExecutor(), binding.getApplicationContext()); ^ 1 warning Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':keyboard_visibility:verifyReleaseResources'.
java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
D:\Development\Node JS\XpertMemos\XpertMemo_flutter\build\keyboard_visibility\intermediates\res\merged\release\values\values.xml:236: error: resource android:attr/fontVariationSettings not found. D:\Development\Node JS\XpertMemos\XpertMemo_flutter\build\keyboard_visibility\intermediates\res\merged\release\values\values.xml:237: error: resource android:attr/ttcIndex not found. error: failed linking references.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 4m 26s Running Gradle task 'assembleRelease'... Running Gradle task 'assembleRelease'... Done 267.8s (!) Gradle task assembleRelease failed with exit code 1
I also follow this steps. click here to see that post
How I fixed it, from your text.
My error was
* What went wrong:
Execution failed for task ':keyboard_visibility:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
C:\a_progra\hg\flutter\the_wind_method\build\keyboard_visibility\intermediates\res\merged\release\values\values.xml:236: AAPT: error: resource android:attr/fontVariationSettings not found.
C:\a_progra\hg\flutter\the_wind_method\build\keyboard_visibility\intermediates\res\merged\release\values\values.xml:237: AAPT: error: resource android:attr/ttcIndex not found.
The keyboard_visibility
sticks out 3 times, so I went in my .dart files and found
import 'package:keyboard_visibility/keyboard_visibility.dart';
I clicked on keyboard_visibility.dart
so it takes me to the source - it appears north in Visual Studio Code - path was: c:\flutter\.pub-cache\hosted\pub.dartlang.org\keyboard_visibility-0.5.6\lib\keyboard_visibility.dart
I then went to c:\flutter\.pub-cache\hosted\pub.dartlang.org\keyboard_visibility-0.5.6\android\build.gradle
changed compileSdkVersion 27 to compileSdkVersion 28 and voila, it works!
It = running this flutter build apk --release
many many thanks brother, @adrianvintu . finaly solved this issue
How I fixed it, from your text.
My error was
* What went wrong: Execution failed for task ':keyboard_visibility:verifyReleaseResources'. > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade > Android resource linking failed C:\a_progra\hg\flutter\the_wind_method\build\keyboard_visibility\intermediates\res\merged\release\values\values.xml:236: AAPT: error: resource android:attr/fontVariationSettings not found. C:\a_progra\hg\flutter\the_wind_method\build\keyboard_visibility\intermediates\res\merged\release\values\values.xml:237: AAPT: error: resource android:attr/ttcIndex not found.
- The
keyboard_visibility
sticks out 3 times, so I went in my .dart files and foundimport 'package:keyboard_visibility/keyboard_visibility.dart';
- I clicked on
keyboard_visibility.dart
so it takes me to the source - it appears north in Visual Studio Code - path was:c:\flutter\.pub-cache\hosted\pub.dartlang.org\keyboard_visibility-0.5.6\lib\keyboard_visibility.dart
- I then went to
c:\flutter\.pub-cache\hosted\pub.dartlang.org\keyboard_visibility-0.5.6\android\build.gradle
changed compileSdkVersion 27 to compileSdkVersion 28 and voila, it works!It = running this
flutter build apk --release
Yes It's Work
@adrianvintu you safe mine ton of time
@adrianvintu Thank you!
I run into the same problem but found a better solution without hacking https://stackoverflow.com/a/25736483/1016472
Solved:
How I fixed it, from your text.
My error was
* What went wrong: Execution failed for task ':keyboard_visibility:verifyReleaseResources'. > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade > Android resource linking failed C:\a_progra\hg\flutter\the_wind_method\build\keyboard_visibility\intermediates\res\merged\release\values\values.xml:236: AAPT: error: resource android:attr/fontVariationSettings not found. C:\a_progra\hg\flutter\the_wind_method\build\keyboard_visibility\intermediates\res\merged\release\values\values.xml:237: AAPT: error: resource android:attr/ttcIndex not found.
- The
keyboard_visibility
sticks out 3 times, so I went in my .dart files and foundimport 'package:keyboard_visibility/keyboard_visibility.dart';
- I clicked on
keyboard_visibility.dart
so it takes me to the source - it appears north in Visual Studio Code - path was:c:\flutter\.pub-cache\hosted\pub.dartlang.org\keyboard_visibility-0.5.6\lib\keyboard_visibility.dart
- I then went to
c:\flutter\.pub-cache\hosted\pub.dartlang.org\keyboard_visibility-0.5.6\android\build.gradle
changed compileSdkVersion 27 to compileSdkVersion 28 and voila, it works!It = running this
flutter build apk --release
I have same error cn you help me solve it ?
3. keyboard_visibility-0.5.6
my Path is not same as yours, mine is in D:\flutter\.pub-cache\hosted\pub.flutter-io.cn\keyboard_visibility-0.5.6\android
@adrianvintu yes, it works.
@alexda12 worked thanks
I find two ways to resolve this problem:
./gradlw :app:assembleRelease
instead of ./gradlew assembleRelease
in android
folder.But i don't know why it does work. 😢
Como eu o consertei, no seu texto. Meu erro foi
* What went wrong: Execution failed for task ':keyboard_visibility:verifyReleaseResources'. > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade > Android resource linking failed C:\a_progra\hg\flutter\the_wind_method\build\keyboard_visibility\intermediates\res\merged\release\values\values.xml:236: AAPT: error: resource android:attr/fontVariationSettings not found. C:\a_progra\hg\flutter\the_wind_method\build\keyboard_visibility\intermediates\res\merged\release\values\values.xml:237: AAPT: error: resource android:attr/ttcIndex not found.
- As
keyboard_visibility
varas se destacam três vezes, então eu fui nos meus arquivos .dart e encontreiimport 'package:keyboard_visibility/keyboard_visibility.dart';
- Cliquei
keyboard_visibility.dart
para que ele me leve à fonte - aparece ao norte no Código do Visual Studio - o caminho era:c:\flutter\.pub-cache\hosted\pub.dartlang.org\keyboard_visibility-0.5.6\lib\keyboard_visibility.dart
- Depois fui
c:\flutter\.pub-cache\hosted\pub.dartlang.org\keyboard_visibility-0.5.6\android\build.gradle
compileSdkVersion 27 para compileSdkVersion 28 e pronto, funciona!It = executando isso
flutter build apk --release
Sim, é trabalho
it really works. in my case C:\Users\loure\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\keyboard_visibility-0.5.6\android\build.gradle
from: android { compileSdkVersion 27 ...
for: android { compileSdkVersion 28 ...
thank you very much
Any updates on this? Is there any better way to do solve this than this workaround?
I have still facing this error
C:\Users\XPERT_005\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\shared_preferences-0.5.6\android\src\main\java\io\flutter\plugins\sharedpreferences\SharedPreferencesPlugin.java:25: warning: [deprecation] getFlutterEngine() in FlutterPluginBinding has been deprecated setupChannel(binding.getFlutterEngine().getDartExecutor(), binding.getApplicationContext()); ^ 1 warning Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':keyboard_visibility:verifyReleaseResources'.
java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed D:\Development\Node JS\XpertMemos\XpertMemo_flutter\build\keyboard_visibility\intermediates\res\merged\release\values\values.xml:236: error: resource android:attr/fontVariationSettings not found. D:\Development\Node JS\XpertMemos\XpertMemo_flutter\build\keyboard_visibility\intermediates\res\merged\release\values\values.xml:237: error: resource android:attr/ttcIndex not found. error: failed linking references.
- 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 4m 26s Running Gradle task 'assembleRelease'... Running Gradle task 'assembleRelease'... Done 267.8s (!) Gradle task assembleRelease failed with exit code 1
I also follow this steps. click here to see that post
How did you resolve this error? I have the same error
@zjy886 Look in the posts below, I migrated to flutter_keyboard_visibility and changed just two lines of code. Works fine now. Look at what @alexda12 wrote
Como eu o consertei, no seu texto.
Meu erro foi
* What went wrong: Execution failed for task ':keyboard_visibility:verifyReleaseResources'. > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade > Android resource linking failed C:\a_progra\hg\flutter\the_wind_method\build\keyboard_visibility\intermediates\res\merged\release\values\values.xml:236: AAPT: error: resource android:attr/fontVariationSettings not found. C:\a_progra\hg\flutter\the_wind_method\build\keyboard_visibility\intermediates\res\merged\release\values\values.xml:237: AAPT: error: resource android:attr/ttcIndex not found.
- As
keyboard_visibility
varas se destacam três vezes, então eu fui nos meus arquivos .dart e encontreiimport 'package:keyboard_visibility/keyboard_visibility.dart';
- Cliquei
keyboard_visibility.dart
para que ele me leve à fonte - aparece ao norte no Código do Visual Studio - o caminho era:c:\flutter\.pub-cache\hosted\pub.dartlang.org\keyboard_visibility-0.5.6\lib\keyboard_visibility.dart
- Fui então
c:\flutter\.pub-cache\hosted\pub.dartlang.org\keyboard_visibility-0.5.6\android\build.gradle
alterado compileSdkVersion 27 para compileSdkVersion 28 e pronto, ele funciona!It = executando isso
flutter build apk --release
it's worked to me when proximity_plugin on flutter doesn't worked. I changed the sdk version on build.gradle of the plugin above. Thank You!!!
How I fixed it, from your text.
My error was
* What went wrong: Execution failed for task ':keyboard_visibility:verifyReleaseResources'. > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade > Android resource linking failed C:\a_progra\hg\flutter\the_wind_method\build\keyboard_visibility\intermediates\res\merged\release\values\values.xml:236: AAPT: error: resource android:attr/fontVariationSettings not found. C:\a_progra\hg\flutter\the_wind_method\build\keyboard_visibility\intermediates\res\merged\release\values\values.xml:237: AAPT: error: resource android:attr/ttcIndex not found.
- The
keyboard_visibility
sticks out 3 times, so I went in my .dart files and foundimport 'package:keyboard_visibility/keyboard_visibility.dart';
- I clicked on
keyboard_visibility.dart
so it takes me to the source - it appears north in Visual Studio Code - path was:c:\flutter\.pub-cache\hosted\pub.dartlang.org\keyboard_visibility-0.5.6\lib\keyboard_visibility.dart
- I then went to
c:\flutter\.pub-cache\hosted\pub.dartlang.org\keyboard_visibility-0.5.6\android\build.gradle
changed compileSdkVersion 27 to compileSdkVersion 28 and voila, it works!It = running this
flutter build apk --release
It's works for me. Thanks
Sooo... Will the creators finally bump up compileSdkVersion
of this app, so that we don't have to remember that?
I have property updated the package and bumped compile version here: https://github.com/MisterJimson/flutter_keyboard_visibility
I run into the same problem but found a better solution without hacking https://stackoverflow.com/a/25736483/1016472
After fighting for few hours and digging a ton of internet I'm really looking for a way to broadcast this to the world. This is the most correct solution so far, without doing magic of digging into each and every of particular flutter plugins with old versions in build.gradle.
Thanks, man!
After a lot of searching I finally reached the pub.dartlang.org folder only to find there is no keyboard-visibility package there. Any clue?
@Dhar15 I suggest using my updated fork: https://pub.dev/packages/flutter_keyboard_visibility
How I fixed it, from your text.
My error was
* What went wrong: Execution failed for task ':keyboard_visibility:verifyReleaseResources'. > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade > Android resource linking failed C:\a_progra\hg\flutter\the_wind_method\build\keyboard_visibility\intermediates\res\merged\release\values\values.xml:236: AAPT: error: resource android:attr/fontVariationSettings not found. C:\a_progra\hg\flutter\the_wind_method\build\keyboard_visibility\intermediates\res\merged\release\values\values.xml:237: AAPT: error: resource android:attr/ttcIndex not found.
- The
keyboard_visibility
sticks out 3 times, so I went in my .dart files and foundimport 'package:keyboard_visibility/keyboard_visibility.dart';
- I clicked on
keyboard_visibility.dart
so it takes me to the source - it appears north in Visual Studio Code - path was:c:\flutter\.pub-cache\hosted\pub.dartlang.org\keyboard_visibility-0.5.6\lib\keyboard_visibility.dart
- I then went to
c:\flutter\.pub-cache\hosted\pub.dartlang.org\keyboard_visibility-0.5.6\android\build.gradle
changed compileSdkVersion 27 to compileSdkVersion 28 and voila, it works!It = running this
flutter build apk --release
thank you mass broo.
Hi @letsar have you solved your issue with the latest version of flutter? Thanks.
How I fixed it, from your text.
My error was
* What went wrong: Execution failed for task ':keyboard_visibility:verifyReleaseResources'. > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade > Android resource linking failed C:\a_progra\hg\flutter\the_wind_method\build\keyboard_visibility\intermediates\res\merged\release\values\values.xml:236: AAPT: error: resource android:attr/fontVariationSettings not found. C:\a_progra\hg\flutter\the_wind_method\build\keyboard_visibility\intermediates\res\merged\release\values\values.xml:237: AAPT: error: resource android:attr/ttcIndex not found.
- The
keyboard_visibility
sticks out 3 times, so I went in my .dart files and foundimport 'package:keyboard_visibility/keyboard_visibility.dart';
- I clicked on
keyboard_visibility.dart
so it takes me to the source - it appears north in Visual Studio Code - path was:c:\flutter\.pub-cache\hosted\pub.dartlang.org\keyboard_visibility-0.5.6\lib\keyboard_visibility.dart
- I then went to
c:\flutter\.pub-cache\hosted\pub.dartlang.org\keyboard_visibility-0.5.6\android\build.gradle
changed compileSdkVersion 27 to compileSdkVersion 28 and voila, it works!It = running this
flutter build apk --release
It Works !! Thanks a lot for very detail steps.
As a workaround, there is another plugin which is a fork of this plugin called :
flutter_keyboard_visibility: 0.7.0
I've gone over the code and the class names and usage is identical - so it should work out of the box.
You can get around the issue by :
- Using this plugin
- Change your gradle class to com.android.tools.build:gradle:3.5.0
- Change your targetSdkVersion to 28
- Ensure you reference latest gradle distribution URL : distributionUrl=https://services.gradle.org/distributions/gradle-5.6.2-all.zip
- Ensure your dependencies do not reference firebase, i.e change
dependencies { testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test: runner:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' implementation 'com.google.firebase:firebase-core:16.0.8' }
to
dependencies { testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test: runner:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' }
Once all 1-5 is done, Do in order :
1. flutter clean 2. Open pubspec.yaml and just make a simple change and SAVE file 3. flutter pub cache repair
It worked! Thank you, I owe you my life
For those facing problem, I have deployed a fix at https://github.com/nimi0112/flutter_keyboard_visibility and it can be used as
keyboard_visibility:
git:
url: "https://github.com/nimi0112/flutter_keyboard_visibility.git"
Please use this and ⭐ the repo.
I have also raised PR https://github.com/adee42/flutter_keyboard_visibility/pull/69 but the repo is inactive now.
For months now I have been maintaining this fork. It also has a bunch of other fixes and features: https://pub.dev/packages/flutter_keyboard_visibility
How is this a fork? It doesn't even include "KeyboardVisibilityNotification().addNewListener" anymore.
@ventr1x its been a while since it was forked and we have updated the API based on feedback. The replacement call for that would be something like this:
import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';
@override
void initState() {
super.initState();
var keyboardVisibilityController = KeyboardVisibilityController();
// Query
print('Keyboard visibility direct query: ${keyboardVisibilityController.isVisible}');
// Subscribe
keyboardVisibilityController.onChange.listen((bool visible) {
print('Keyboard visibility update. Is visible: ${visible}');
});
}
Update compileSdkVersion and targetSdkVersion to 31
And add this code snippet in your android/build.gradle file at the very end.
configurations.all {
resolutionStrategy {
force 'androidx.core:core-ktx:1.6.0'
}
}
Sooo... Will the creators finally bump up
compileSdkVersion
of this app, so that we don't have to remember that?
I think they cannot. Because every project will not have the same compileSdkVersion.
How I fixed it, from your text.
My error was
* What went wrong: Execution failed for task ':keyboard_visibility:verifyReleaseResources'. > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade > Android resource linking failed C:\a_progra\hg\flutter\the_wind_method\build\keyboard_visibility\intermediates\res\merged\release\values\values.xml:236: AAPT: error: resource android:attr/fontVariationSettings not found. C:\a_progra\hg\flutter\the_wind_method\build\keyboard_visibility\intermediates\res\merged\release\values\values.xml:237: AAPT: error: resource android:attr/ttcIndex not found.
- The
keyboard_visibility
sticks out 3 times, so I went in my .dart files and foundimport 'package:keyboard_visibility/keyboard_visibility.dart';
- I clicked on
keyboard_visibility.dart
so it takes me to the source - it appears north in Visual Studio Code - path was:c:\flutter\.pub-cache\hosted\pub.dartlang.org\keyboard_visibility-0.5.6\lib\keyboard_visibility.dart
- I then went to
c:\flutter\.pub-cache\hosted\pub.dartlang.org\keyboard_visibility-0.5.6\android\build.gradle
changed compileSdkVersion 27 to compileSdkVersion 28 and voila, it works!It = running this
flutter build apk --release
It actually worked for me tooo... Just make the compileSdkVersion the same to that of your project. It will work absolutely fine then.
How I fixed it, from your text.
My error was
* What went wrong: Execution failed for task ':keyboard_visibility:verifyReleaseResources'. > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade > Android resource linking failed C:\a_progra\hg\flutter\the_wind_method\build\keyboard_visibility\intermediates\res\merged\release\values\values.xml:236: AAPT: error: resource android:attr/fontVariationSettings not found. C:\a_progra\hg\flutter\the_wind_method\build\keyboard_visibility\intermediates\res\merged\release\values\values.xml:237: AAPT: error: resource android:attr/ttcIndex not found.
- The
keyboard_visibility
sticks out 3 times, so I went in my .dart files and foundimport 'package:keyboard_visibility/keyboard_visibility.dart';
- I clicked on
keyboard_visibility.dart
so it takes me to the source - it appears north in Visual Studio Code - path was:c:\flutter\.pub-cache\hosted\pub.dartlang.org\keyboard_visibility-0.5.6\lib\keyboard_visibility.dart
- I then went to
c:\flutter\.pub-cache\hosted\pub.dartlang.org\keyboard_visibility-0.5.6\android\build.gradle
changed compileSdkVersion 27 to compileSdkVersion 28 and voila, it works!It = running this
flutter build apk --release
life saving
Hi,
Thanks for your work on this plugin. We upgraded Flutter to the latest stable version (1.12.13+hotfix.5) and while our project can run, it cannot build an apk using
We have this error:
Our projet has been migrated to AndroidX, but the same error appears when I build with the example of this plugin.
Do you know how to resolve this?