Android Volley IllegalStateException: Marker added to finished log - android-volley

Unable to get any solution for this issue:
Device: Lenovo A7000-a, OS Marshmallow(6.0)
Fatal Exception: java.lang.IllegalStateException: Marker added to finished log
at com.android.volley.VolleyLog$MarkerLog.add(SourceFile:132)
at com.android.volley.Request.finish(SourceFile:240)
at com.android.volley.ExecutorDelivery$ResponseDeliveryRunnable.run(SourceFile:109)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5769)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)

We can disable Logs.d & Logs.v using following snippets to be add in proguard. It'll be solve your crash.
-dontskipnonpubliclibraryclasses
-dontobfuscate
-forceprocessing
-optimizationpasses 5
-keep class * extends android.app.Activity
-assumenosideeffects class android.util.Log {
public static *** d(...);
public static *** v(...);
}

Related

Upgrading to the latest Google AdMob SDK causes strange errors

I tried to upgrade to the latest Google AdMob SDK in my Xamarin.Forms app. So far I got the banner ads working but the interstitial ads throwing a error I'm not sure what it wants me todo. For the new callback parameter I added the following class:
private class LocalInterstitialAdLoadCallback : InterstitialAdLoadCallback
{
public override void OnAdLoaded(Java.Lang.Object p0)
{
if (p0 is InterstitialAd interstitialAd)
{
MainThread.BeginInvokeOnMainThread(() =>
{
interstitialAd.Show(CrossCurrentActivity.Current.Activity);
});
}
}
public override void OnAdFailedToLoad(LoadAdError p0)
{
}
}
but this yields the error below and I have no idea how to fix this.
javac.exe error JAVAC0000: error: name clash: onAdLoaded(Object) in CoreService_LocalInterstitialAdLoadCallback and onAdLoaded(AdT) in AdLoadCallback have the same erasure, yet neither overrides the other
javac.exe error JAVAC0000: public void onAdLoaded (java.lang.Object p0)
javac.exe error JAVAC0000: where AdT is a type-variable:
javac.exe error JAVAC0000: AdT extends Object declared in class AdLoadCallback
What does this even mean? Is there any sample on how to implement this properly or does someone have a hint where I can look this up? I never worked with Java which is not really helpful at this point I guess.

DataMongoTest using embeddedMongo fails due to program blocked by group policy (Windows 10)

Executing a simple unit test over a Mongo Repository fails in Windows 10 due to
java.io.IOException: Cannot run program
"C:\Users\myuser\AppData\Local\Temp\extract-88ea18ed-75d4-420f-be7f-623baeeb5c70extractmongod.exe":
CreateProcess error=1260, This program is blocked by group policy. For
more information, contact your system administrator
This had worked until a few days ago, but failing now probably due to some recent Windows update.
Example of a failing test
#ExtendWith(SpringExtension.class)
#DataMongoTest
#AutoConfigureDataJpa
#AutoConfigureTestDatabase
#ExtendWith(LogbackSuppressorExtension.class)
#Import(TestConfiguration.class)
class AnnexContentRepositoryTest {
#Autowired
private MongoTemplate mongoTemplate;
#Autowired
private AnnexContentRepository annexContentRepository;
#Test
public void findAllByParentCodeAndParentType() {
AnnexContent annexContent = addAnnexContent();
Page<AnnexContent> annexContentResult = annexContentRepository
.findAllByParentCodeAndParentType(annexContent.getParentCode(), ParentType.THE_ONE,
Pageable.unpaged());
Assertions.assertEquals(1, annexContentResult.getTotalElements());
}
private AnnexContent addAnnexContent() {
AnnexContent annexContent = AnnexContentBuilder.buildDefault();
return mongoTemplate.save(annexContent);
}
}
The solution that I've found is to add two system variables that embedded mongo reads ("de.flapdoodle.embed.io.tmpdir" and "EMBEDDED_MONGO_ARTIFACTS") in test configuration (the same applies in running the application with embedded mongo, where these two system variables can be set also).
#Configuration
public class TestConfiguration {
public TestConfiguration(Environment environment) {
if (SystemUtils.IS_OS_WINDOWS) {
System.setProperty("de.flapdoodle.embed.io.tmpdir", environment.getProperty("mongo-embedded.windows.temp-dir"));
System.setProperty("EMBEDDED_MONGO_ARTIFACTS", environment.getProperty("mongo-embedded.windows.temp-dir"));
}
}
}
By changing the location from the embedded mongo default ("c:\myuser\appdata\local\temp") to, for example, "c:\temp", the problem disappears.
Pringi's solution works. Here it is, simplified with an actual Windows path in c:\temp\mongotemp
First manually create directory c:\temp\mongotemp
Add a new MongoConfig.java file:
import org.apache.commons.lang3.SystemUtils;
import org.springframework.context.annotation.Configuration;
#Configuration
public class MongoConfig {
public MongoConfig() {
if (SystemUtils.IS_OS_WINDOWS) {
System.setProperty("de.flapdoodle.embed.io.tmpdir", "c:\\temp\\mongotemp");
}
}
}
App should run now.
You can then inspect the contents of c:\temp\mongotemp , it's the executable that was previously being blocked by the system policy.

Error XAGJS7009: System.InvalidOperationException: There can be only one type with an [Application] attribute android Xamarin

After implementing Huawei push service in my android project, I was getting crash on the occurrence of Push Notification, and error was looged
java.lang.UnsatisfiedLinkError: No implementation found for void crc6415d7e49b4cd3bc6f.MyApplication.n_onCreate()
To resolve this error, I crated MyApplication to extend the Application.
[Application]
public class MyApplication : Application
{
public MyApplication(IntPtr javaReference, JniHandleOwnership transfer) : base(javaReference, transfer)
{
}
public override void OnCreate()
{
base.OnCreate();
}
}
then I am getting
Error XAGJS7009: System.InvalidOperationException: There can be only one type with an [Application] attribute; found:,
Note
I have tried adding these lines as well
#if DEBUG
[Application(Debuggable=true)]
#else
[Application(Debuggable=false)]
#endif
but still getting the same issue
Already tried Clean and Rebuild solution
You have to delete Application file first. Open The Library project then find XPush-5.0.2.300 -> HmsPush -> Application file then delete it.
Then add below code line to your Application's OnCreate() method if you want to use feature which is relevant to it.
RegisterActivityLifecycleCallbacks(new MyLifecycleHandler());
In addition this problem will be fixed in the next version.

Java.Lang.UnsatisfiedLinkError: Native method not found: onResume with Xamarin

This class definition causes an immediate runtime crash on Xamarin for Android.
public class BaseCompatActivity : Android.Support.V7.App.AppCompatActivity
{
protected override void OnResume()
{
base.OnResume();
}
}
The error message is:
Java.Lang.UnsatisfiedLinkError: Native method not found: md5e8727ee9d36911e204981187fd2b13a2.BaseCompatActivity.n_onResume:()V
I have an inheritance chain that goes like this
MainActivity > DrawerActivity > BaseCompatActivity > AppCompatActivity
If I override OnResume in MainActivity or DrawerActivity, there is no problem. It is only if I override it in BaseCompatActivity that I get that error message.
This happens when running API level 17 in the emulator. It does not happen when running on an API level 22 device.
What could be causing this mysterious behaviour?

How can I call uiautomator-api directly without using 'am instrument'?

I am a beginner in using uiautomator.
I know that we can run uiautomator-test-case by 'adb shell am instrument ~' command.
At this time, I am trying to call uiautomator-api directly.
Here is my sample class file.
import com.android.uiautomator.core.UiObject;
import com.android.uiautomator.core.UiObjectNotFoundException;
import com.android.uiautomator.core.UiScrollable;
import com.android.uiautomator.core.UiSelector;
import com.android.uiautomator.testrunner.UiAutomatorTestCase;
public class ExecutorBase extends UiAutomatorTestCase {
public void pressHomeWrapper() throws UiObjectNotFoundException {
Log.d(TAG, "getUiDevice: " + getUiDevice());
getUiDevice().pressHome();
}
public TagResult pressHomeUA() throws UiObjectNotFoundException {
boolean isPass = false;
this.pressHomeWrapper();
return TagResult.NEW(isPass);
}
}
Whenever I try to call pressHomeUA(), I get a RuntimeException error below.
08-20 17:53:30.687: E/JavaBinder(14377): *** Uncaught remote exception! (Exceptions are not yet supported across processes.)
08-20 17:53:30.687: E/JavaBinder(14377): java.lang.RuntimeException: Stub!
08-20 17:53:30.687: E/JavaBinder(14377): at com.android.uiautomator.testrunner.UiAutomatorTestCase.<init>(UiAutomatorTestCase.java:5)
08-20 17:53:30.687: E/JavaBinder(14377): at com.lge.art.play.script.tag.ExecutorBase.<init>(ExecutorBase.java:247)
08-20 17:53:30.687: E/JavaBinder(14377): at com.lge.art.play.script.runner.ScriptRunner.<init>(ScriptRunner.java:101)
So I want to know how I can call uiautomator-api directly.
Could you let me know that it is possible?
Thanks for your support in advance.

Resources