Skip to content

Commit c7bbabb

Browse files
committed
use the class of the existing child when calling base classes that are not present in the current version of the android framework.
1 parent f0162fd commit c7bbabb

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/jni/NativeScriptRuntime.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,16 @@ void NativeScriptRuntime::CallJavaMethod(const Handle<Object>& caller, const str
203203
entry->clazz = env.FindClass(className);
204204
if (entry->clazz == nullptr)
205205
{
206-
DEBUG_WRITE("Cannot resolve class=%s while calling method %s", className.c_str(), methodName.c_str());
206+
MetadataNode* callerNode = MetadataNode::GetNodeFromHandle(caller);
207+
const string callerClassName = callerNode->GetName();
208+
209+
DEBUG_WRITE("Cannot resolve class: %s while calling method: %s callerNode: %s", className.c_str(), methodName.c_str(), callerNode->GetName().c_str());
210+
entry->clazz = env.FindClass(callerClassName);
211+
if (entry->clazz == nullptr)
212+
{
213+
ASSERT_FAIL("Cannot resolve caller's class name: %s", callerClassName.c_str());
214+
APP_FAIL("Cannot resolve caller's class name");
215+
}
207216
}
208217

209218
entry->memberId = isStatic

0 commit comments

Comments
 (0)