java.lang.RuntimeException: Package manager has died - android

I got the following exception from crashlytics on a API Level 22 YU5510 device. The frequency of occurring this exception is not that higher. Is it any hardware related issue or device specific issue?
Exception java.lang.RuntimeException: Unable to start receivercom.google.firebase.iid.FirebaseInstanceIdInternalReceiver: java.lang.RuntimeException: Package manager has died
android.app.ActivityThread.handleReceiver (ActivityThread.java:2649)
android.app.ActivityThread.access$1800 (ActivityThread.java:154)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:1398)
android.os.Handler.dispatchMessage (Handler.java:102)
android.os.Looper.loop (Looper.java:135)
android.app.ActivityThread.main (ActivityThread.java:5292)
java.lang.reflect.Method.invoke (Method.java)
java.lang.reflect.Method.invoke (Method.java:372)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:904)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:699)
arrow_drop_down
Caused by java.lang.RuntimeException: Package manager has died
android.app.ApplicationPackageManager.resolveService (ApplicationPackageManager.java:638)
com.google.firebase.iid.FirebaseInstanceIdInternalReceiver.zze ()
com.google.firebase.iid.FirebaseInstanceIdInternalReceiver.zzh ()
com.google.firebase.iid.FirebaseInstanceIdInternalReceiver.zzb ()
com.google.firebase.iid.FirebaseInstanceIdInternalReceiver.onReceive ()
android.app.ActivityThread.handleReceiver (ActivityThread.java:2642)
android.app.ActivityThread.access$1800 (ActivityThread.java:154)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:1398)
android.os.Handler.dispatchMessage (Handler.java:102)
android.os.Looper.loop (Looper.java:135)
android.app.ActivityThread.main (ActivityThread.java:5292)
java.lang.reflect.Method.invoke (Method.java)
java.lang.reflect.Method.invoke (Method.java:372)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:904)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:699)
arrow_drop_down
Caused by android.os.DeadObjectException:
android.os.BinderProxy.transactNative (Binder.java)
android.os.BinderProxy.transact (Binder.java:496)
android.content.pm.IPackageManager$Stub$Proxy.resolveService (IPackageManager.java:2669)
android.app.ApplicationPackageManager.resolveService (ApplicationPackageManager.java:632)
com.google.firebase.iid.FirebaseInstanceIdInternalReceiver.zze ()
com.google.firebase.iid.FirebaseInstanceIdInternalReceiver.zzh ()
com.google.firebase.iid.FirebaseInstanceIdInternalReceiver.zzb ()
com.google.firebase.iid.FirebaseInstanceIdInternalReceiver.onReceive ()
android.app.ActivityThread.handleReceiver (ActivityThread.java:2642)
android.app.ActivityThread.access$1800 (ActivityThread.java:154)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:1398)
android.os.Handler.dispatchMessage (Handler.java:102)
android.os.Looper.loop (Looper.java:135)
android.app.ActivityThread.main (ActivityThread.java:5292)
java.lang.reflect.Method.invoke (Method.java)
java.lang.reflect.Method.invoke (Method.java:372)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:904)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:699)
This is my manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.sss.lll" >
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<!-- <uses-permission android:name="android.permission.GET_ACCOUNTS" />-->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission android:name="com.sss.lll.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.sss.lll.permission.C2D_MESSAGE" />
<application
android:allowBackup="false"
android:icon="#drawable/m_icon"
android:label="#string/app_name"
android:name="MyApp"
android:theme="#style/AppTheme">
<activity
android:name=".activities.MainActivity"
android:label="#string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activities.ListActivity"
android:launchMode= "singleTop"
android:screenOrientation="portrait"></activity>
<activity android:name=".activities.DetailActivity"
android:launchMode= "singleTop"
android:parentActivityName=".activities.ListActivity"
android:screenOrientation="portrait"></activity>
<activity android:name=".activities.WebviewActivity"
android:launchMode= "singleTop"
android:parentActivityName=".activities.ListActivity"
android:screenOrientation="portrait"></activity>
<activity android:name=".activities.ViewPagerImageActivity"
android:launchMode= "singleTop"
android:parentActivityName=".activities.DetailActivity"
android:screenOrientation="portrait"></activity>
<activity android:name=".activities.LikeActivity"
android:launchMode= "singleTop"
android:parentActivityName=".activities.ListActivity"
android:screenOrientation="portrait"
></activity>
<service
android:name=".MyFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
<service
android:name=".MyFirebaseInstanceIDService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
</intent-filter>
</service>
<meta-data
android:name="io.fabric.ApiKey"
android:value="1234567899" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="#drawable/ic_notification" />
</application>
</manifest>

Add this receiver and check it.
Internal receiver for FirebaseInstanceId used to start services securely. This receiver is automatically added to your application's manifest file via manifest merge. If necessary it can be manually declared via:
<receiver
android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver"
android:exported="false" />

Related

Kotlin app keeps crashing on run time when trying to load a screen which get details from firebase

E/AndroidRuntime: FATAL EXCEPTION: main
Process: lk.ac.kln.mit.stu.mobileapplicationdevelopment, PID: 5642
java.lang.RuntimeException: Unable to start activity ComponentInfo{lk.ac.kln.mit.stu.mobileapplicationdevelopment/lk.ac.kln.mit.stu.mobileapplicationdevelopment.activities.ShoppingActivity}: java.lang.IllegalStateException: Hilt Activity must be attached to an #HiltAndroidApp Application. Did you forget to specify your Application's class name in your manifest's <application />'s android:name attribute?
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3449)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Caused by: java.lang.IllegalStateException: Hilt Activity must be attached to an #HiltAndroidApp Application. Did you forget to specify your Application's class name in your manifest's <application />'s android:name attribute?
at dagger.hilt.android.internal.managers.ActivityComponentManager.createComponent(ActivityComponentManager.java:76)
at dagger.hilt.android.internal.managers.ActivityComponentManager.generatedComponent(ActivityComponentManager.java:66)
at lk.ac.kln.mit.stu.mobileapplicationdevelopment.activities.Hilt_ShoppingActivity.generatedComponent(Hilt_ShoppingActivity.java:45)
at lk.ac.kln.mit.stu.mobileapplicationdevelopment.activities.Hilt_ShoppingActivity.inject(Hilt_ShoppingActivity.java:67)
at lk.ac.kln.mit.stu.mobileapplicationdevelopment.activities.Hilt_ShoppingActivity$1.onContextAvailable(Hilt_ShoppingActivity.java:38)
at androidx.activity.contextaware.ContextAwareHelper.dispatchOnContextAvailable(ContextAwareHelper.java:99)
at androidx.activity.ComponentActivity.onCreate(ComponentActivity.java:362)
at androidx.fragment.app.FragmentActivity.onCreate(FragmentActivity.java:217)
at lk.ac.kln.mit.stu.mobileapplicationdevelopment.activities.ShoppingActivity.onCreate(ShoppingActivity.kt:21)
at android.app.Activity.performCreate(Activity.java:7994)
at android.app.Activity.performCreate(Activity.java:7978)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3422)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601) 
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85) 
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:223) 
at android.app.ActivityThread.main(ActivityThread.java:7656) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) 
I get this error when I try to load a given screen of the application. How can I resolve this?
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application
android:allowBackup="true"
android:dataExtractionRules="#xml/data_extraction_rules"
android:fullBackupContent="#xml/backup_rules"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/Theme.MobileApplicationDevelopment"
tools:targetApi="31">
<activity
android:name=".activities.ShoppingActivity"
android:exported="false">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".activities.LoginRegisterActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
</application>
</manifest>
ShoppingActivity.kt
package lk.ac.kln.mit.stu.mobileapplicationdevelopment.activities
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View.inflate
import androidx.navigation.findNavController
import androidx.navigation.fragment.NavHostFragment
import androidx.navigation.ui.setupWithNavController
import dagger.hilt.android.AndroidEntryPoint
import lk.ac.kln.mit.stu.mobileapplicationdevelopment.R
import lk.ac.kln.mit.stu.mobileapplicationdevelopment.databinding.ActivityShoppingBinding
#AndroidEntryPoint
class ShoppingActivity : AppCompatActivity() {
val binding by lazy {
ActivityShoppingBinding.inflate(layoutInflater)
}
override fun onCreate(savedInstancesState: Bundle?) {
super.onCreate(savedInstancesState)
setContentView(binding.root)
val navController = findNavController(R.id.shoppingHostFragment)
binding.bottomNavigation.setupWithNavController(navController)
}
}
you should create application class that extend Application() like this :
#HiltAndroidApp
class Application : Application(){...}
then in your manifest add this line :
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application
android:name=".Application"
...>
<activity
android:name=".ShoppingActivity"
android:hardwareAccelerated="true"
android:screenOrientation="portrait"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
for more information check link below :
Hilt Documentation

Fatal Exception: android.content.ActivityNotFoundException | android.gms.ads.AdActivity (ADMOB)

Since today at an amazing speed Admob is crashing when trying to display an Add according to Firebase.
Also Crashlytics is not getting the mapping... do not know why
This happens in every version of android 4, 5, 6, 7, 8, 9, 10.
Fatal Exception: android.content.ActivityNotFoundException
Unable to find explicit activity class {com.myCompany.myApp/com.google.android.gms.ads.AdActivity}; have you declared this activity in your AndroidManifest.xml?
com.myCompany.myApp.GameActivity.E
android.app.Instrumentation.checkStartActivityResult (Instrumentation.java:1933)
android.app.Instrumentation.execStartActivity (Instrumentation.java:1616)
android.app.ContextImpl.startActivity (ContextImpl.java:904)
android.app.ContextImpl.startActivity (ContextImpl.java:882)
android.content.ContextWrapper.startActivity (ContextWrapper.java:383)
com.google.android.gms.internal.ads.Di.a (Unknown Source:9)
com.google.android.gms.ads.internal.overlay.zzn.a (Unknown Source:77)
com.google.android.gms.internal.ads.KC.a (Unknown Source:76)
com.google.android.gms.internal.ads.zu.a (Unknown Source:9)
com.google.android.gms.internal.ads.cF.showInterstitial (Unknown Source:24)
com.google.android.gms.internal.ads.Cea.c (Unknown Source:7)
com.google.android.gms.ads.InterstitialAd.c (Unknown Source:2)
com.myCompany.myApp.GameActivity.E (Unknown Source:82)
com.myCompany.myApp.X.onClick (Unknown Source:4)
android.view.View.performClick (View.java:6390)
Tried to reproduce the error locally, but couldn't
This started suddenly... and is in the only app that I'm getting that error in Firebase (all are implemented the same way)
Gradle
dependencies {
...
implementation 'com.google.android.gms:play-services-ads:18.2.0'
implementation 'com.google.firebase:firebase-core:17.2.0'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
...
}
MANIFEST
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myCompany.MyApp"
android:installLocation="auto">
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true"
android:xlargeScreens="true"
/>
<application
android:allowBackup="true"
android:fullBackupContent="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:largeHeap="true"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme"
>
<uses-library
android:name="org.apache.http.legacy"
android:required="false"/>
<meta-data
android:name="com.google.android.gms.ads.AD_MANAGER_APP"
android:value="true"/>
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="THENUMBERFORMYADMOB"/>
<service
android:name=".services.MusicService"
android:enabled="true"/>
<meta-data
android:name="firebase_crashlytics_collection_enabled"
android:value="${crashlyticsCollectionEnabled}" />
<activity
android:name=".SplashActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name=".LevelsActivity"
android:label="#string/title_activity_game"
android:parentActivityName=".SplashActivity">
</activity>
<activity
android:name=".GameActivity"
android:keepScreenOn="true"
android:label="#string/title_activity_game"
android:parentActivityName=".LevelsActivity">
</activity>
...
OTHER ACTIVITIES
...
</application>
</manifest>
I implemented Admob accordingly to the guide.
¿Should I add an Admob activity?
In google play crash report I'm getting reports regarding
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR)
WebViewGoogle.apk
#00 pc 00000000008fca14 /system/app/WebViewGoogle/WebViewGoogle.apk
But this has been for a long time (since 1' July... when started suddenly with a spike...) and google is "fixing it"... could this be related?

Android 8 samsung admob not showing ads

I have an application with admob.
It works on all devices, but it doesn't show ads on android 8 samsung devices.
It also works samsung's other versions and other brands all versions including android 8.
I get following error.
2018-10-12 21:21:47.508 13284-31190/? E/Ads: Error waiting for future.
java.util.concurrent.ExecutionException: java.util.concurrent.TimeoutException
at com.google.android.gms.ads.internal.util.future.af.get(:com.google.android.gms#14366015#14.3.66 (040300-213742215):18)
at com.google.android.gms.ads.internal.util.future.g.a(:com.google.android.gms#14366015#14.3.66 (040300-213742215):11)
at com.google.android.gms.ads.internal.request.service.c.a(:com.google.android.gms#14366015#14.3.66 (040300-213742215):62)
at com.google.android.gms.ads.internal.request.service.c.a(:com.google.android.gms#14366015#14.3.66 (040300-213742215):169)
at com.google.android.gms.ads.internal.request.service.f.run(:com.google.android.gms#14366015#14.3.66 (040300-213742215):1)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.util.concurrent.TimeoutException
at com.google.android.gms.ads.internal.util.future.m.run(Unknown Source:2)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301
For ads, I use following version:
implementation 'com.google.android.gms:play-services-ads:17.0.0'
Manifest File
<?xml version="1.1" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.package.app">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="#mipmap/icon"
android:label="#string/app_name"
android:roundIcon="#mipmap/roundicon"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".DepartmentCoursesActivity" />
<activity android:name=".ExamDetailActivity" />
<activity android:name=".AddLessonActivity" />
<activity android:name=".LoginActivity" />
<activity android:name=".CourseExamListActivity" />
<activity android:name=".ImageZoomActivity"></activity>
<!-- Sample AdMob App ID: ca-app-pub-3940256099942544~3347511713 -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="[MY_AD_ID]"/>
</application>
</manifest>
And also there is following log, it may be related
2018-10-12 21:21:46.618 1764-1764/? E/ServiceUtils: [#MLP#] Unable to get package name: android.content.pm.PackageManager$NameNotFoundException: com.samsung.ipservice (com.samsung.ipservice)
at android.app.ApplicationPackageManager.getPackageInfoAsUser (ApplicationPackageManager.java:301)
at android.app.ApplicationPackageManager.getPackageInfo (ApplicationPackageManager.java:272)
at com.samsung.mlp.platform.utils.ServiceUtils.isPackageAvailable (ServiceUtils.java:55)
at com.samsung.mlp.platform.framework.ItemFetchTask.buildImageSelectionSchema (ItemFetchTask.java:147)
at com.samsung.mlp.platform.framework.ItemFetchTask.buildMediaSelectionSchema (ItemFetchTask.java:129)
at com.samsung.mlp.platform.framework.ItemFetchTask.<init> (ItemFetchTask.java:107)
at com.samsung.mlp.platform.framework.LPServiceController.setupExecutors (LPServiceController.java:200)
at com.samsung.mlp.platform.framework.LPServiceController.<init> (LPServiceController.java:179)
at com.samsung.mlp.platform.framework.LPServiceController.getInstance (LPServiceController.java:168)
at com.samsung.mlp.platform.LPService.onBind (LPService.java:49)
at android.app.ActivityThread.handleBindService (ActivityThread.java:3571)
at android.app.ActivityThread.-wrap2 (null:0)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1791)
at android.os.Handler.dispatchMessage (Handler.java:105)
at android.os.Looper.loop (Looper.java:164)
at android.app.ActivityThread.main (ActivityThread.java:6944)
at java.lang.reflect.Method.invoke (Method.java:-2)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:327)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1374)
Add below code in manifest file
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="#android:style/Theme.Translucent" />
Hope this will work...!

Can't set login activity before mainactivity [duplicate]

This question already has answers here:
FirebaseApp.initializeApp(Context); Android error;
(3 answers)
Closed 5 years ago.
In my android app, i used firebase to sign in with google, but can't set the login activity before main.
Here's the stack trace:
02-12 23:57:02.524 8692-8692/bf_d.binary_femaledefense E/AndroidRuntime: FATAL EXCEPTION: main
Process: bf_d.binary_femaledefense, PID: 8692
java.lang.RuntimeException: Unable to start activity ComponentInfo{bf_d.binary_femaledefense/bf_d.binary_femaledefense.login}: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process bf_d.binary_femaledefense. Make sure to call FirebaseApp.initializeApp(Context) first.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2817)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Caused by: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process bf_d.binary_femaledefense. Make sure to call FirebaseApp.initializeApp(Context) first.
at com.google.firebase.FirebaseApp.getInstance(Unknown Source:54)
at com.google.firebase.auth.FirebaseAuth.getInstance(Unknown Source:0)
at bf_d.binary_femaledefense.login.onCreate(login.java:53)
at android.app.Activity.performCreate(Activity.java:6975)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892) 
at android.app.ActivityThread.-wrap11(Unknown Source:0) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593) 
at android.os.Handler.dispatchMessage(Handler.java:105) 
at android.os.Looper.loop(Looper.java:164) 
at android.app.ActivityThread.main(ActivityThread.java:6541) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767) 
l already called the FirebaseAuth.initializeApp(this) in the onCreate method. But still showing initializing error in FirebaseApp.
Here's the library i used:
implementation 'com.google.android.gms:play-services-auth:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
And here is my AndroidManifest:
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".login"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MainActivity"/>
<activity
android:name=".ContactSetup"
android:parentActivityName=".ContextSetup" />
<activity
android:name=".EditContacts"
android:parentActivityName=".EditContacts" />
<activity
android:name=".HowTo"
android:parentActivityName=".MainActivity" />
<activity
android:name=".AboutDevs"
android:parentActivityName=".MainActivity" />
<activity
android:name=".RecordHistory"
android:parentActivityName=".MainActivity" />
<activity
android:name=".CustomText"
android:parentActivityName=".ContextSetup" />
<activity
android:name=".ContextSetup"
android:parentActivityName=".MainActivity" />
</application>
Any Suggestions would be appreciated :)
Extend Application class and call FirebaseApp.initializeApp(this) in onCreate() method of that class:
public class MyApplication extends Application {
#Override
public void onCreate() {
super.onCreate();
FirebaseApp.initializeApp(this);
}
}
And add android:name attribute to your manifest
<application
android:name=". MyApplication"
...
>

SecurityException,cannot explicitly add accounts of type: myPakcageName

While updating existing app below fatal exception is reported on Firebase,
Exception java.lang.SecurityException: uid 10123 cannot explicitly add accounts of type: com.ominfowave.android
android.os.Parcel.readException (Parcel.java:1599)
android.os.Parcel.readException (Parcel.java:1552)
android.accounts.IAccountManager$Stub$Proxy.addAccountExplicitly(IAccountManager.java:890)
android.accounts.AccountManager.addAccountExplicitly(AccountManager.java:712)
com.ominfowave.android.sync.SyncAdapter.createSyncAccountIfNeeded(SyncAdapter.java:86)
com.ominfowave.android.sync.SyncAdapter.triggerRefresh (SyncAdapter.java:110)
com.ominfowave.android.MyApplication.onConfigurationChanged (MyApplication.java:159)
android.app.ActivityThread.performConfigurationChanged (ActivityThread.java:4414)
android.app.ActivityThread.handleConfigurationChanged (ActivityThread.java:4487)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:1598)
android.os.Handler.dispatchMessage (Handler.java:111)
android.os.Looper.loop (Looper.java:207)
android.app.ActivityThread.main (ActivityThread.java:5728)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:789)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:679)
Mainfest.xml already have below code
<service android:name="your.AuthService">
<intent-filter>
<action android:name="android.accounts.AccountAuthenticator" />
</intent-filter>
<meta-data android:name="android.accounts.AccountAuthenticator"
android:resource="#xml/authenticator" />
I ran into this error, and I think it was because I cleared my app's cache and storage, and then uninstalled my app. The next time I installed and ran the app I saw the same exception from this post. A phone restart fixed the problem for me.

Categories

Resources