java.lang.IllegalStateException: Could not construct instance of helper class class - ormlite

I used **ormlite greendao** for my Android application, everything works well until my android phone upgrade to Android 6.0 (Marshmallow) these days.
The problem happens at this line in my code:
private DatabaseHelper getHelper() {
if (mHelper == null)
mHelper = OpenHelperManager.getHelper(mContext, DatabaseHelper.class);// Error raise here
return mHelper;
}
And I catch out this causes the issue:
java.lang.IllegalAccessException:
java.lang.Class is not
accessible from
java.lang.Class
I have researched on the internet but couldn't figure out.
It only happens in Android 6.
Update
Cause:
java.lang.IllegalAccessException: java.lang.Class<com.mypackage.DatabaseHelper> is not accessible from java.lang.Class<com.j256.ormlite.android.apptools.OpenHelperManager>

I solved my problem by myself
As the cause problem above I changed class access level of
com.mypackage.DatabaseHelper
into public class.

Related

Found no receiver for incoming ClientRpc on Player(Clone), the server and client should have the same NetworkBehaviour instances [netId=9]

I am using Mirror SDK to implement multiplayer
when I test locally, one instance of build and one instance in unity editor, it works fine.
but If I test by running two builds on separate machines, it gives me this error.
I searched alot, haven't found any solution yet.
any help will be appreciated.
below is my code to use Client RPC
public void CmdSpawn(Vector3 position)
{
ComponentInstance = Instantiate(prefabToSpawn ,position,Quaternion.identity);
NetworkServer.Spawn(ComponentInstance,connectionToClient);
RpcAssignRefrence(ComponentInstance);
}
[ClientRpc]
public void RpcAssignRefrence(GameObject spawnedObject)
{
m_tempObject = spawnedObject.transform;
}

The NullPointerException crash that occur in the flutter under RenderMode of rendermode.texture

Crashes occur with the latest stable version 1.17.0,the log is :
java.lang.NullPointerException: Attempt to invoke interface method 'void io.flutter.embedding.engine.renderer.RenderSurface.attachToRenderer(io.flutter.embedding.engine.renderer.FlutterRenderer)' on a null object reference.
tips:
RenderMode.surface is normal,and rendermode.texture is bad.
the code as:
FlutterFragment flutterFragment = FlutterFragment.withCachedEngine("my_engine_id")
.renderMode(FlutterView.RenderMode.texture)
.build();

Unity WebGL - Locating code that triggers Reflection.emit

I've run into the dreaded Reflection.emit issue in my webplayer build and am unable to locate what is triggering it. I'm currently commenting out code method by method and rebuilding to locate the cause and have narrowed it down to the below.
I'm not using JSON so the various JSON libraries aren't the cause, nor any of the other result suggestions returned by google.
How can i more easily go about locating the cause of this error. I have full stack trace on and well as full debugging, but all i get is the following console output.
NotSupportedException: C:\Program Files\Unity 2018.2.0b2\Editor\Data\il2cpp\libil2cpp\icalls\mscorlib\System.Reflection.Emit\AssemblyBuilder.cpp(20) : Unsupported internal call for IL2CPP:AssemblyBuilder::basic_init - System.Reflection.Emit is not supported.
Rethrow as TypeInitializationException: The type initializer for 'System.Reflection.Emit.DynamicMethod.AnonHostModuleHolder' threw an exception.
//NOTE: appM.procM is a C# .Net 4.x dynamic variable EG:
//public dynamic procM = GetProcClass(strProcName)
public void ShowProcList() {
/* Rest of method commented out*/
if(appM.procM == null){
procList.Initialize(appM.procM.lstNames, this);
}
/* Rest of method commented out*/
}
public void Initialize(List<string> lstNames, UIM um, string currProc=null) {
uiM = um;
//cleanup of the list before populating
foreach(Transform fld in Panel.transform) {
Destroy(fld.gameObject);
}
/* Rest of method commented out*/
}
Update: I narrowed down the problem line of code, but haven't closed the question as there's got to be an easier way than commenting out line by line and rebuilding.
For future searchers, the issue is the if(appM.procM == null) check. As procM is a dynamic variable reflection is used which kills AOT in webGL builds. No compiler warnings were generated to save myself from myself.
Nevermind, i am an idiot, The option Enable Exceptions under Player Settings was set to Full Without Stacktrace and not Full with Stacktrace.
The value Full With Stacktrace contains the pertinent data. Easily locatable in the browsers console. Warning that full debugging does increase build times and slow down the application.

org.eclipse.swt.SWTException: Invalid thread access from HandledContributionItem

I know there are lots of such questions here and most of them are answered. But the answers just won't solve my case.
I'm working on an eclipse plugin project, have a customized project type which can be either run or debugged. I have implemented the run and debug function and everything I expected are displayed on the screen, except the console shows an exception:
!ENTRY org.eclipse.e4.ui.workbench 4 0 2015-04-28 23:31:17.410
!MESSAGE Internal error during tool item enablement updating, this is only logged once per tool item.
!STACK 0
org.eclipse.swt.SWTException: Invalid thread access
at org.eclipse.swt.SWT.error(SWT.java:4441)
at org.eclipse.swt.SWT.error(SWT.java:4356)
at org.eclipse.swt.SWT.error(SWT.java:4327)
at org.eclipse.swt.widgets.Widget.error(Widget.java:783)
at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:574)
at org.eclipse.swt.widgets.Widget.getData(Widget.java:874)
at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.updateIcons(HandledContributionItem.java:546)
at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.update(HandledContributionItem.java:440)
at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.update(HandledContributionItem.java:430)
at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem$3.run(HandledContributionItem.java:168)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.updateItemEnablement(HandledContributionItem.java:196)
at org.eclipse.e4.ui.workbench.renderers.swt.ToolItemUpdater.updateContributionItems(ToolItemUpdater.java:39)
at org.eclipse.e4.ui.workbench.renderers.swt.ToolBarManagerRenderer$8.changed(ToolBarManagerRenderer.java:367)
at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:110)
at org.eclipse.e4.core.internal.contexts.EclipseContext.processScheduled(EclipseContext.java:338)
at org.eclipse.e4.core.internal.contexts.EclipseContext.set(EclipseContext.java:352)
at org.eclipse.ui.internal.services.EvaluationService.contextEvaluate(EvaluationService.java:139)
at org.eclipse.ui.internal.services.EvaluationService.addSourceProvider(EvaluationService.java:180)
at org.eclipse.debug.internal.ui.contexts.DebugContextSourceProvider.<init>(DebugContextSourceProvider.java:51)
at org.eclipse.debug.internal.ui.contexts.DebugWindowContextService.<init>(DebugWindowContextService.java:62)
at org.eclipse.debug.internal.ui.contexts.DebugContextManager.createService(DebugContextManager.java:163)
at org.eclipse.debug.internal.ui.contexts.DebugContextManager.getContextService(DebugContextManager.java:221)
at org.eclipse.debug.internal.ui.views.ViewContextService.<init>(ViewContextService.java:620)
at org.eclipse.debug.internal.ui.views.ViewContextManager.windowOpened(ViewContextManager.java:93)
at org.eclipse.debug.internal.ui.views.ViewContextManager.<init>(ViewContextManager.java:55)
at org.eclipse.debug.internal.ui.views.ViewContextManager.getDefault(ViewContextManager.java:44)
at org.eclipse.debug.internal.ui.contexts.DebugContextManager.getDefault(DebugContextManager.java:150)
at org.eclipse.debug.ui.DebugUITools.getDebugContextManager(DebugUITools.java:1068)
at org.eclipse.debug.internal.ui.sourcelookup.SourceLookupService.<init>(SourceLookupService.java:40)
at org.eclipse.debug.internal.ui.sourcelookup.SourceLookupManager.windowOpened(SourceLookupManager.java:91)
at org.eclipse.debug.internal.ui.sourcelookup.SourceLookupManager.<init>(SourceLookupManager.java:41)
at org.eclipse.debug.internal.ui.sourcelookup.SourceLookupManager.getDefault(SourceLookupManager.java:53)
at org.eclipse.debug.internal.ui.DebugUIPlugin.initializeLaunchListeners(DebugUIPlugin.java:935)
at org.eclipse.debug.internal.ui.DebugUIPlugin.launchAdded(DebugUIPlugin.java:920)
at org.eclipse.debug.internal.core.LaunchManager$LaunchNotifier.run(LaunchManager.java:451)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.debug.internal.core.LaunchManager$LaunchNotifier.notify(LaunchManager.java:438)
at org.eclipse.debug.internal.core.LaunchManager.fireUpdate(LaunchManager.java:1044)
at org.eclipse.debug.internal.core.LaunchManager.addLaunch(LaunchManager.java:708)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:834)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:739)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1039)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1256)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
My codes are as following: In LaunchShortCut.java I have
Display.getDefault().syncExec(new Runnable() {
#Override
public void run() {
Shell activeShell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
if(DebugUITools.openLaunchConfigurationDialog(activeShell, config, group, null) == Window.CANCEL){
return;
}
}
});
This trigger the LaunchConfigurationWindow, and does not show any exception in console. When I hit the "run" in this window, the process stops at the first line in the following code where I have a breakpoint, and shows the exception in the console.
Display.getDefault().syncExec(new Runnable() {
#Override
public void run() {
//clear old output
HTMLOutput htmloutput = (HTMLOutput) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView("my.view.id");
}
}
From the stack trace of the exception I don't see anything related to my code. If I let the program go on running, everything is fine, I don't see any trouble this exception causes, but I just can't figure what's it about and can't even stop it from showing up. Please help me on this issue.
It seems that you've hit a bug in Eclipse. The same stacktrace is described in Bug 445560. Chances are that the workaround described in this bug report (see comment 4) also helps in your case:
As current local workaround for this issue I've added in our rcp code an early call to DebugUITools.getDebugContextManager() from the UI thread.
Ugly, and should not be needed, but it avoids the failures seen when launching for the first time.

Windows Phone 8.1 app error calling Windows Phone Silverlight 8.1 new Socket exception

Environment: Windows 10 eval copy; VS 2013 Express Update3.
I created a Blank WP 8.1 app and a Windows Phone Silverlight Class Library. I added a class to the class library and in the constructor attempt to new a Socket. The Blank WP 8.1 app creates an instance of the class in its OnNavigatedTo event. That's the only change I made to the WP 8.1 app.
The call in the Class1 constructor generates the exception given below. This occurs in the Emulator 8.1 WVGA 4 inch 512MB. Can anyone tell me what I'm doing wrong?
MainPage.xml.cs:
protected override void OnNavigatedTo(NavigationEventArgs e)
{
Class1 class1 = new Class1();
...
namespace SockLib
{
public class Class1
{
public Class1()
{
try
{
// The next line generates the exception.
Socket sock = new Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp);
}
catch (Exception e)
{
System.Diagnostics.Debug.WriteLine(e.ToString());
}
}
}
}
A first chance exception of type 'System.NullReferenceException' occurred in System.Net.ni.DLL
System.NullReferenceException: Object reference not set to an instance of an object.
at System.Net.Sockets.SocketNotificationManager..ctor()
at System.Net.Sockets.Socket.get_SocketManager()
at System.Net.Sockets.Socket..ctor(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType)
at SockLib.Class1..ctor()
Will,
I suspect you cannot use OnNavigatedTo, because the UI is not built yet (and maybe something else, that have to do with the App capabilities on the phone). Would you try to use a button Click event handler to initialize your socket?
I have a very similar problem. I am trying to create a pure console application for WP8.1, and my Socket constructor fails the same way.