java.lang.RuntimeException: Unable to start receiver (exception showed up in Google play store internal testing) - flutter

I deployed my flutter app to Google play store internal testing and after one hour, I saw this exception in the Pre-launch report details. I am not even sure where to start debugging. Could Someone please help? I don't have a lot of knowledge of Android since I am using Flutter.
Exception java.lang.RuntimeException: Unable to start receiver
com.google.android.finsky.instantapps.PhenotypeUpdateReceiver:
java.lang.IllegalStateException: Not allowed to start service Intent {
act=com.google.android.gms.phenotype.UPDATE
cmp=com.android.vending/com.google.android.finsky.instantapps.PhenotypeUpdateService
}: app is in background uid UidRecord{2a75503 u0a192 TRNB
bg:+2m53s648ms idle change:uncached procs:4 seq(0,0,0)} at
android.app.ActivityThread.handleReceiver (ActivityThread.java:4035)
at android.app.ActivityThread.access$1400 (ActivityThread.java:237)
at android.app.ActivityThread$H.handleMessage
(ActivityThread.java:1924) at android.os.Handler.dispatchMessage
(Handler.java:106) at android.os.Looper.loop (Looper.java:223) at
android.app.ActivityThread.main (ActivityThread.java:7664) at
java.lang.reflect.Method.invoke (Method.java) 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: Not
allowed to start service Intent {
act=com.google.android.gms.phenotype.UPDATE
cmp=com.android.vending/com.google.android.finsky.instantapps.PhenotypeUpdateService
}: app is in background uid UidRecord{2a75503 u0a192 TRNB
bg:+2m53s648ms idle change:uncached procs:4 seq(0,0,0)} at
android.app.ContextImpl.startServiceCommon (ContextImpl.java:1715)
at android.app.ContextImpl.startService (ContextImpl.java:1670) at
android.content.ContextWrapper.startService (ContextWrapper.java:720)
at alj.a (alj.java:2) at alm.a (alm.java:3) at wnv.a (wnv.java:2)
at
com.google.android.finsky.instantapps.PhenotypeUpdateReceiver.onReceive
(PhenotypeUpdateReceiver.java:6) at
android.app.ActivityThread.handleReceiver (ActivityThread.java:4026)
I also managed to download the full logcat which is very large file. I am not sure how to include the file over here.

flutter downgrade to as much as possible
You have to uninstall and reinstall the app, and also have to clear the data and cache from the Settings page.
Try it.
I have solved the problem this way.

Related

audio_service crashed with error at audio_service_engine

I uploaded a Flutter app on PlayStore and some cases was reported and the log is like below:
Exception java.lang.RuntimeException:
at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3654)
at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3806)
at android.app.servertransaction.LaunchActivityItem.execute (LaunchActivityItem.java:83)
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:2267)
at android.os.Handler.dispatchMessage (Handler.java:107)
at android.os.Looper.loop (Looper.java:237)
at android.app.ActivityThread.main (ActivityThread.java:8167)
at java.lang.reflect.Method.invoke (Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:496)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1100)
Caused by java.lang.IllegalStateException: The requested cached FlutterEngine did not exist in the FlutterEngineCache: 'audio_service_engine'
at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.setupFlutterEngine (FlutterActivityAndFragmentDelegate.java)
at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onAttach (FlutterActivityAndFragmentDelegate.java)
at io.flutter.embedding.android.FlutterFragment.onAttach (FlutterFragment.java)
at androidx.fragment.app.Fragment.performAttach (Fragment.java)
at androidx.fragment.app.FragmentStateManager.attach (FragmentStateManager.java)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState (FragmentStateManager.java)
at androidx.fragment.app.FragmentStore.moveToExpectedState (FragmentStore.java)
at androidx.fragment.app.FragmentManager.moveToState (FragmentManager.java)
at androidx.fragment.app.FragmentManager.dispatchStateChange (FragmentManager.java)
at androidx.fragment.app.FragmentManager.dispatchCreate (FragmentManager.java)
at androidx.fragment.app.FragmentController.dispatchCreate (FragmentController.java)
at androidx.fragment.app.FragmentActivity.onCreate (FragmentActivity.java)
at io.flutter.embedding.android.FlutterFragmentActivity.onCreate (FlutterFragmentActivity.java)
at android.app.Activity.performCreate (Activity.java:7963)
at android.app.Activity.performCreate (Activity.java:7952)
at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1307)
at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3629)
I tried to google but it didn't give good result so I don't even know what is firstly wrong. what would be the problem?
See this bug report . If you're already using the latest version and it's not fixed, you will need to submit a new bug report to get it fixed. If you're not already using the latest version, then doing so will probably fix it.

Illegal access error when deleting Google Pub Sub subscription upon JVM shutdown

I'm trying to delete a Google Pub Sub subscription in a JVM shutdown hook, but I'm encountering an illegal access error with the Google Pub Sub subscription admin client when the shutdown hook runs. I've tried using both sys.addShutdownHook as well as Runtime.getRuntime().addShutdownHook, but I get the same error either way.
val deleteInstanceCacheSubscriptionThread = new Thread {
override def run: Unit = {
cacheUpdateService. deleteInstanceCacheUpdateSubscription()
}
}
sys.addShutdownHook(deleteInstanceCacheSubscriptionThread.run)
// Runtime.getRuntime().addShutdownHook(deleteInstanceCacheSubscriptionThread)
This is the stack trace:
Exception in thread "shutdownHook1" java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load [META-INF/services/com.google.auth.http.HttpTransportFactory]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading(WebappClassLoaderBase.java:1385)
at org.apache.catalina.loader.WebappClassLoaderBase.findResources(WebappClassLoaderBase.java:985)
at org.apache.catalina.loader.WebappClassLoaderBase.getResources(WebappClassLoaderBase.java:1086)
at java.util.ServiceLoader$LazyIterator.hasNextService(ServiceLoader.java:348)
at java.util.ServiceLoader$LazyIterator.hasNext(ServiceLoader.java:393)
at java.util.ServiceLoader$1.hasNext(ServiceLoader.java:474)
at com.google.common.collect.Iterators.getNext(Iterators.java:845)
at com.google.common.collect.Iterables.getFirst(Iterables.java:779)
at com.google.auth.oauth2.OAuth2Credentials.getFromServiceLoader(OAuth2Credentials.java:318)
at com.google.auth.oauth2.ServiceAccountCredentials.<init>(ServiceAccountCredentials.java:145)
at com.google.auth.oauth2.ServiceAccountCredentials.createScoped(ServiceAccountCredentials.java:505)
at com.google.api.gax.core.GoogleCredentialsProvider.getCredentials(GoogleCredentialsProvider.java:92)
at com.google.api.gax.rpc.ClientContext.create(ClientContext.java:142)
at com.google.cloud.pubsub.v1.stub.GrpcSubscriberStub.create(GrpcSubscriberStub.java:263)
at com.google.cloud.pubsub.v1.stub.SubscriberStubSettings.createStub(SubscriberStubSettings.java:242)
at com.google.cloud.pubsub.v1.SubscriptionAdminClient.<init>(SubscriptionAdminClient.java:178)
at com.google.cloud.pubsub.v1.SubscriptionAdminClient.create(SubscriptionAdminClient.java:159)
at com.google.cloud.pubsub.v1.SubscriptionAdminClient.create(SubscriptionAdminClient.java:150)
at com.company.pubsub.services.GooglePubSubService.$anonfun$deleteSubscription$2(GooglePubSubService.scala:384)
at com.company.utils.TryWithResources$.withResources(TryWithResources.scala:21)
at com.company.pubsub.services.GooglePubSubService.$anonfun$deleteSubscription$1(GooglePubSubService.scala:384)
at com.company.scalalogging.Logging.time(Logging.scala:43)
at com.company.scalalogging.Logging.time$(Logging.scala:35)
at com.company.pubsub.services.GooglePubSubService.time(GooglePubSubService.scala:30)
at com.company.pubsub.services.GooglePubSubService.deleteSubscription(GooglePubSubService.scala:382)
at com.company.cache.services.CacheUpdateService.deleteInstanceCacheUpdateSubscription(CacheUpdateService.scala:109)
at com.company.cache.services.CacheUpdateHandlerService$$anon$1.run(CacheUpdateHandlerService.scala:132)
at com.company.cache.services.CacheUpdateHandlerService$.$anonfun$addSubscriptionShutdownHook$1(CacheUpdateHandlerService.scala:135)
at scala.sys.ShutdownHookThread$$anon$1.run(ShutdownHookThread.scala:37)
It seems like by the time the shutdown hook runs the Pub Sub library has already shut down, so we can't access the subscription admin client anymore. But, I was wondering if there was anyway to delete the subscription before this happens.

Error in setting up Google play services in unity

Following the instruction on google play games plugin for unity, I have not been able to set it up correctly. My application crashes on signing in, with the following log output (with no more details). I've got no luck in finding a probable cause and searches seems to be out of any useful tip.
The actual error is displayed as:
Application ID () must be a numeric value. Please verify that your manifest refers to the correct project ID
The complete log output:
10-08 19:43:49.581 25688-25734/? E/linker: readlink('/proc/self/fd/49') failed: Permission denied [fd=49]
10-08 19:43:49.581 25688-25734/? E/linker: warning: unable to get realpath for the library "/data/data/com.testcompany.testapp/app_.gpg.classloader/d75c8e1bbeab9e1ddffb9d332585db71.dex". Will use given name.
10-08 19:43:49.667 25688-25734/? W/PopupManager: You have not specified a View to use as content view for popups. Falling back to the Activity content view. Note that this may not work as expected in multi-screen environments
10-08 19:43:49.675 25688-26526/? I/GamesNativeSDK: Auth operation started: SIGN IN
10-08 19:43:49.675 25688-26526/? I/GamesNativeSDK: Connecting to Google Play...
10-08 19:43:49.802 10946-10956/? W/GamesServiceBroker: Client connected with SDK 9683000, Services 9683438, and Games 37240038
10-08 19:43:49.837 10946-26540/? E/ValidateServiceOp: Application ID () must be a numeric value. Please verify that your manifest refers to the correct project ID.
10-08 19:43:49.842 25688-25688/? D/AndroidRuntime: Shutting down VM
10-08 19:43:49.846 25688-25688/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.testcompany.testapp, PID: 25688
java.lang.Error: FATAL EXCEPTION [main]
Unity version : 5.4.0f3
Device model : LGE Nexus 5
Device fingerprint: google/hammerhead/hammerhead:6.0/MRA58K/2256973:user/release-keys
Caused by: java.lang.IllegalStateException: A fatal developer error has occurred. Check the logs for further information.
at com.google.android.gms.common.internal.zze$zza.zzc(Unknown Source)
at com.google.android.gms.common.internal.zze$zza.zzv(Unknown Source)
at com.google.android.gms.common.internal.zze$zze.zzauc(Unknown Source)
at com.google.android.gms.common.internal.zze$zzd.handleMessage(Unknown Source)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
I've taken the steps needed to generate OAuth2 client ID and I've successfully applied that to GooglePlayGame plugin in unity. What could be the reason of the error message?
If we refer to the actual error as shown in your log output, the problem is caused by the application ID declared in your Manifest which is actually one of the top setup mistakes committed by developers as shown in this video.
To troubleshoot this kind of error, please check the following:
For Android:
please verify that the value of the #string/app_id resource matches your application's numeric ID. The value of this resource should only contain digits. For example:
<string name="app_id">123456789012</string>
Warning: Do not use the full client ID (1233456789012.apps.googleusercontent.com) as your app ID. This will result in errors.
For iOS:
The application_ID is the number that Google Play Developer Console assigns to your project. Please note that is not the same as your Apple application_ID.
Then, after checking the application ID, please also check the certificate fingerprint. Please be noted that:
If you are debugging your game using your debug certificate but have configured games services using your release certificate, you should add a second linked app using the same package name and your debug certificate's SHA1 fingerprint. This will allow you to sign in to the application whether it's signed with the debug or release certificates.
For additional tips, refer to these related resources:
Top 7 Google Play games services setup mistakes - Video that describes common Google Play games services setup pitfalls and scenarios.
Android troubleshooting guide - Developer documentation that describes how to troubleshoot issues while developing Android games.
Lastly, this Q&A thread might also help wherein this GitHub post was suggested.
The problem was caused by multiple application configurations in Google play services. Although the game services panel was showing only one application with my package name, there were several instances of the same application configured in google cloud services previously for google cloud messaging and other services. The problem was only solved when I shut down all services, deleted the applications and patiently created one unified application configuration in Google play services.
I got this problem too. Here's My solution:
Delete old version of GooglePlayService and Admob plugins and import the new ones.
Open Android SDK Manager(In Unity, Window -> Google Play Games -> Downloads -> Google Play Gamse SDK(Android)), update the following ones:
Then try to set up Goole Play Service.
Additional, current verion of GooglPlayServices and Admob both import PlayServicesResolver/Editor/Google.JarResolverLib.dll(JarResolverLib.dll), just delete Google.JarResolerLib.dll.
Hope this can help you!

JavaMail crashes after build/deploy on Glassfish 4

My current project includes using of a JavaMail for confirming an user email. The problem I have is that, using eclipse, every time I build & deploy my web application on the local Glassfish server the JavaMail crashes with the following exception:
Severe: java.lang.SecurityException: Access to default session denied
at javax.mail.Session.getDefaultInstance(Session.java:333)
at utils.MailService.sendEmailSSL(MailService.java:58)
And here the code snipped where I'm obtaining the session and which is throwing the above exception:
Session session = Session.getDefaultInstance(
props,
new javax.mail.Authenticator(){
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(usr, pwd);
}
});
The workaround I've found so far is restarting Glassfish and after that JavaMail functions properly again. The problem is it is very annoying and time consuming doing a restart even after the smallest change in my code.
My question: Is there a possibility to reset only the JavaMail service and bind this with the build event?
Off course any other suggestions are welcome too :)
If you can avoid using Session.getDefaultInstance. Use Session.getInstance and fix some of the common mistakes.

Android mobile first app stopped working after Bluemix moved to cflinuxfs2 stack

I have an android app based on the bluelist app for bluemix BMS service. it stopped working yesterday when the stack is moved to cflinuxfs2.
Today I checked my ios app on the same bluemix service, it is working. so I looked into the exception on Android, it is from MFPush, looks like a context is null. see the attached image for the line of code where the NPE is thrown.
The stacktrace is: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Intent android.content.Context.registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter)' on a null object reference
12-10 16:00:31.240 14482-14482/com.ibm.bluelist E/AndroidRuntime: at com.ibm.mobilefirstplatform.clientsdk.android.push.api.MFPPush.listen(MFPPush.java:232)
12-10 16:00:31.240 14482-14482/com.ibm.bluelist E/AndroidRuntime: at com.ibm.bluelist.GroupsActivity.onResume(GroupsActivity.java:250)
12-10 16:00:31.240 14482-14482/com.ibm.bluelist E/AndroidRuntime: at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1257)
12-10 16:00:31.240 14482-14482/com.ibm.bluelist E/AndroidRuntime: at android.app.Activity.performResume(Activity.java:6119)
Chances are the MFPPush SDK has not been initialized when you are attempting to call:
push.listen(notificationListener)
I suggest saving the push value:
push = MFPPush.getInstance()
Immediately after initialization or registration (whatever you feel is more appropriate) in the class.
That way you will have the appropriate initialized push instance when attempting to listen to a notification listener.