I am creating and Android plugin and I’m trying to use the Log
method instead of the log xml element in an _APL.xml
or _UPL.xml file
, but I get an error that it cannot find the symbol.
UATHelper: Packaging (Android (ASTC)): Z:\app\src\main\java\com\epicgames\ue4\GameActivity.java:3263: error: cannot find symbol
UATHelper: Packaging (Android (ASTC)): Log.i(TAG, "GameActivity::OnResume()");
UATHelper: Packaging (Android (ASTC)): ^
UATHelper: Packaging (Android (ASTC)): symbol: method i(String,String)
UATHelper: Packaging (Android (ASTC)): location: variable Log of type Logger
PackagingResults: Error: cannot find symbol
My code:
<gameActivityImportAdditions>
<insert>
import android.util.Log;
</insert>
</gameActivityImportAdditions>
<gameActivityOnResumeAdditions>
<insert>
<![CDATA[
final String TAG = "UNREAL";
Log.i(TAG, "GameActivity::OnResume()");
]]>
</insert>
</gameActivityOnResumeAdditions>
Owl_Snowy
(Owl_Snowy)
October 31, 2020, 9:20am
2
pokeum
(pokeum)
June 2, 2024, 3:06am
3
if you are using like below code
<gameActivityImportAdditions>
<insert>
...
import android.util.Log;
</insert>
</gameActivityImportAdditions>
<gameActivityClassAdditions>
<insert>
...
public void logVerbose(String tag, String msg) { Log.v(tag, msg); }
public void logDebug(String tag, String msg) { Log.d(tag, msg); }
public void logInfo(String tag, String msg) { Log.i(tag, msg); }
public void logWarn(String tag, String msg) { Log.w(tag, msg); }
public void logError(String tag, String msg) { Log.e(tag, msg); }
public void logAssert(String tag, String msg) { Log.wtf(tag, msg); }
convert code like below
<gameActivityClassAdditions>
<insert>
...
public void logVerbose(String tag, String msg) { android.util.Log.v(tag, msg); }
public void logDebug(String tag, String msg) { android.util.Log.d(tag, msg); }
public void logInfo(String tag, String msg) { android.util.Log.i(tag, msg); }
public void logWarn(String tag, String msg) { android.util.Log.w(tag, msg); }
public void logError(String tag, String msg) { android.util.Log.e(tag, msg); }
public void logAssert(String tag, String msg) { android.util.Log.wtf(tag, msg); }
this will solve the problem
because i think there is other class Name Log according to error log from ue
UATHelper: Packaging (Android (ASTC)): location: variable Log of type Logger