I am building my CodenameOne app on their server. It is the Android build.
I already fixed some build issues.
Now I am facing an issue that seems to depend on my source code:
I have a 'R' class with a 'string' class inside. It is to get string constants for localization utiity methods with key/value pairs:
String translatedString=StringRes.getStringByKey(R.string.string_key);
it is the usage, the gist of translation is hidden in the method, and leverages CodenameOne way of doing it. I know mine is different from their approach but it works very well for me, and it is similar and fairly compatible with the Android version of my app.
The class is something like:
public class R {
public static Command myCommand=new Command(StringRes.getStringByKey(string.myCommand));
...
...
public static class string
{
...
...
...
In the build I get errors regarding it:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':transformDexArchiveWithDexMergerForDebug'.
java.lang.RuntimeException: com.android.build.api.transform.TransformException: com.android.dex.DexException: Multiple dex files define Lcom/myapp/app/R$string;
com.android.build.api.transform.TransformException: com.android.dex.DexException:: Multiple dex files define Lcom/myapp/app/R$string;
com.android.dex.DexException: Multiple dex files define Lcom/myapp/app/R$string;
What is this?
And how to fix it?
question from:
https://stackoverflow.com/questions/65916687/codenameone-inner-class-causes-dex-build-errors 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…