MissingPluginException(No implementation found for method gps on channel top.kikt/gps) - flutter

I am trying to implement https://pub.dev/packages/gps. But while using it it is throwing following exception-
MissingPluginException(No implementation found for method gps on channel top.kikt/gps)
what is this exception and how to fix it.
note -I can not use other libraries it is necessary to implement this library.
i wrote this code to access current position but this piece of code returning null to me
var position = await Gps.currentGps();
build.gradle info
compileSdkVersion 28
minSdkVersion 16
targetSdkVersion 28
var position = await Gps.currentGps();
manifest permission I added-
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>

Stop the running project
and run the command -
1)flutter clean
2)flutter pub get
and run the app again

Related

(Flutter) Google Play Console: Issue found: Need to use Media Store API or No Access to Files

I am trying to publish my app on the Google Play Console. They are refusing it because it seems they don't like the permissions I gave to my app:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="my.basketball.cleanmaybe">
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
I found how to ask permission to the camera app but not to the gallery. Can someone tell me how can I resolve this?
This is what I got in my mail:

java.lang.SecurityException: Need android.permission.BLUETOOTH_CONNECT permission

After asking for runtime permission for BLUETOOTH_CONNECT, android 12 crashes , I faced this problem in Samsung Android 12 Device. In other device less then Android 12 is working fine.
I handled bluetooth permission but still my app going to crash
manifest
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
sdk -> 31
Showing this type of error after build the app.
I got the solution.
As you can see the BLUETOOTH permission is disabled in Android 12. This issue resolved if I add the maxSdkVersion for the BLUETOOTH permission.
So I update permissions in manifest file :
Old This:
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
to
new this:
<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" android:required="false" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" android:maxSdkVersion="30" android:required="false" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" android:maxSdkVersion="30" android:required="false" />

APT: error: attribute android:usesPermissionFlags not found

I want to compile simple app in Flutter. I am using flutter_reactive_ble library and I have following error:
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
/Users/michalsniady/Desktop/Engineering Thesis/take_your_pills/build/app/intermediates/packaged_manifests/debug/AndroidManifest.xml:18: AAPT: error: attribute android:usesPermissionFlags not found.
My permissions in main Android Manifest look like that:
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission
android:name="android.permission.BLUETOOTH_SCAN"
android:usesPermissionFlags="neverForLocation"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
And my build.gradle code looks like that:
compileSdkVersion 29
defaultConfig {
minSdkVersion 21
targetSdkVersion 29
}
Does anyone has any idea what might be the problem?
Try to compile and/or target Android 31. The feature you're trying to use has been added to Android 31 (Platform 31 = Android 12).

I am in Unity and I imported a new appodeal sdk and I get this error: Manifest merger failed with errors

1.Before I added the appodeal plug in everything was fine, but I also have unity ads and google services installed, so maybe that's part of the problem. I also removed the target sdk version from the manifest because I thought it will help but it didn't. This is the appodeal manifest :
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="27"/>
<application android:allowBackup="true" android:networkSecurityConfig="#xml/network_security_config"
android:name="androidx.multidex.MultiDexApplication">
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
</application>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<!--optional-->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<!--optional-->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<!--optional-->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<!--optional-->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<!--optional-->
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/>
<!--optional-->
<uses-permission android:name="android.permission.VIBRATE"/>
<!--optional-->
[![enter image description here][1]][1]
I had the same error: Missing 'package' key attribute on element package at [:com.my.target.mytarget-sdk-5.11.7:] AndroidManifest.xml:15:9-54. But you posted the wrong manifest. The error is in a generated one, inside the cache folder of grandle.
But here is the fix:
Preparing your Gradle build for Android 11
You need to change classpath 'com.android.tools.build:gradle:3.4.0' to 'com.android.tools.build:gradle:3.4.3' in gradle file. (Unity 2017.4 - Unity 2019.4)
You need to change classpath 'com.android.tools.build:gradle:3.6.0' to 'com.android.tools.build:gradle:3.6.4' in gradle file. (Unity 2020.1)
For versions (Unity 2017.4 - Unity 2019.2) you can change gradle version in /Unity/Hub/Editor/UNITY_VERSION/PlaybackEngines/AndroidPlayer/Tools/GradleTemplates/mainTemplate.gradle or directly in mainTemplate.gradle in the project.
For versions (Unity 2019.3 - Unity 2020.1) you can change gradle version in /Unity/Hub/Editor/UNITY_VERSION/PlaybackEngines/AndroidPlayer/Tools/GradleTemplates/baseProjectTemplate.gradle or directly in baseProjectTemplate.gradle in the project.
This is from the Appodeal Documentation Docs

MissingPluginException(No implementation found for method hasPermissions on channel flutter_audio_recorder)

I use this plugin https://pub.flutter-io.cn/packages/flutter_audio_recorder. I have received the following error
enter image description here
i also write this code to ask the permission
await FlutterAudioRecorder.hasPermissions
and also add the permissions in Androidmenifiest.xml file
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
this code also does not ask the user to enable the permission for audio.
please tell me how to fix this issue?
Try to quit Flutter and run again. Also, make sure that you use the command flutter pub get before running your app. If you still get the same error, try flutter clean and run your app.