Closed dimas0211 closed 3 years ago
Did you register your Application
class in the Manifest
file?
<application
android:name=".Application"
android:label="app_name"
android:icon="@mipmap/ic_launcher"
Please look at the Use other plugins in callback.
Did you register your
Application
class in theManifest
file?<application android:name=".Application" android:label="app_name" android:icon="@mipmap/ic_launcher"
Please look at the Use other plugins in callback.
I have it as .MainActivity cuz the file name is MainActivity.kt
<activity android:name=".MainActivity" android:launchMode="singleTop" android:theme="@style/LaunchTheme"
Did you register your
Application
class in theManifest
file?<application android:name=".Application" android:label="app_name" android:icon="@mipmap/ic_launcher"
Please look at the Use other plugins in callback.
changing it to .Application didnt help
Can you share your manifest file?
Can you share your manifest file?
Sure!
` <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.appName">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:name="io.flutter.app.FlutterApplication"
android:label="appName"
android:icon="@mipmap/ic_launcher">
<meta-data android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyAPAfxD0c_Q9O0qp8xGJfoiE7-DlPkScxc"/>
<activity
android:name=".Application"
android:label="appName"
android:icon="@mipmap/ic_launcher"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<receiver android:name="rekab.app.background_locator.LocatorBroadcastReceiver"
android:enabled="true"
android:exported="true"/>
<service android:name="rekab.app.background_locator.LocatorService"
android:permission="android.permission.BIND_JOB_SERVICE"
android:exported="true"/>
<service android:name="rekab.app.background_locator.IsolateHolderService"
android:permission="android.permission.FOREGROUND_SERVICE"
android:exported="true"
/>
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
`
OK, there is one simple mistake, you have to declare your Application
in <application
tag, like this:
<application
android:name=".Application"
and revert the <activity
tag like what it looked like before.
thanks! good point!
but even after applying changes still receive the same error
Which version of the plugin you are using?
I can see you have LocatorBroacastReceiver
in your Manifest
which is removed from the latest version.
ahh
I see
updated the package to latest version and removed LocatorBroacastReceiver
so this error doesn't show anymore.
Thank you!
but instead of it I started receiving errors like this:
Do you know what it can be?
Hmm, not sure, but it would be nice to switch to the latest version of Kotlin and do a flutter clean
Yeah, worked out! Thank you a lot!
Hi, @mehdok ! I'm trying to use a code in MainActivity.kt:
` import io.flutter.app.FlutterApplication import io.flutter.plugin.common.PluginRegistry import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback import io.flutter.plugins.pathprovider.PathProviderPlugin import io.flutter.view.FlutterMain import rekab.app.background_locator.IsolateHolderService
class Application : FlutterApplication(), PluginRegistrantCallback { override fun onCreate() { super.onCreate() IsolateHolderService.setPluginRegistrant(this) FlutterMain.startInitialization(this) }
} `
but I receive an error: ' Unresolved reference: setPluginRegistrant' Could you please help me with that?