I did a plugin for UE4.26 that works ok. Now I am working on UE4.27 and I try to use the same plugin but it fails when I try to launch de game on the device.
It claims I have a duplicated class. Is there a way to disable it?
Why U4.26 goes ok and 4.27 fails with that error?
Any help?
FAILURE: Build failed with an exception.
LogPlayLevel: * What went wrong:
LogPlayLevel: Execution failed for task ':app:checkDebugDuplicateClasses'.
LogPlayLevel: > 1 exception was raised by workers:
LogPlayLevel: java.lang.RuntimeException: Duplicate class androidx.localbroadcastmanager.content.LocalBroadcastManager found in modules jetified-classes.jar (classes.jar) and localbroadcastmanager-1.0.0-runtime.jar (androidx.localbroadcastmanager:localbroadcastmanager:1.0.0)
LogPlayLevel: Duplicate class androidx.localbroadcastmanager.content.LocalBroadcastManager$1 found in modules jetified-classes.jar (classes.jar) and localbroadcastmanager-1.0.0-runtime.jar (androidx.localbroadcastmanager:localbroadcastmanager:1.0.0)
LogPlayLevel: Duplicate class androidx.localbroadcastmanager.content.LocalBroadcastManager$BroadcastRecord found in modules jetified-classes.jar (classes.jar) and localbroadcastmanager-1.0.0-runtime.jar (androidx.localbroadcastmanager:localbroadcastmanager:1.0.0)
LogPlayLevel: Duplicate class androidx.localbroadcastmanager.content.LocalBroadcastManager$ReceiverRecord found in modules jetified-classes.jar (classes.jar) and localbroadcastmanager-1.0.0-runtime.jar (androidx.localbroadcastmanager:localbroadcastmanager:1.0.0)
Note: everything builds ok when I package the plugin and then I compile in Rider:
In my case I had a folder inside a .jar that UE4.27 didnt liked (found as duplicated classes).
I fixed it just extracting the .jar contents (its a zip), removing that folder and compressing again as .jar. I could not find the other ‘duplicated’ files in my project but that fixed my problem.
It’s strange UE4.26 don’t give that error and compiles ok.
just in case this androidx folder with those 4 files was the source of the problems:
Yesterday I thought I had solved it but no What I did solved the LAUNCH
issue where it failed stating a duplicated class was there.
Now I want to make a distribution APK and I get this error
I dont have this issues on 4.26,this happens on 4.27 only.
UATHelper: Packaging (Android (ETC2)): > Task :app:minifyReleaseWithR8 FAILED
UATHelper: Packaging (Android (ETC2)): C:\Users\eldan\.gradle\caches\transforms-2\files-2.1\9447db4656f1da834de603aa9f9ca870\jetified-play-services-base-11.8.0\proguard.txt:3:89-97: R8: The field name "<fields>" is used in a field rule. The characters in this field name are legal for the JVM, but unlikely to originate from a source language. Maybe this is no
t the rule you are looking for.
UATHelper: Packaging (Android (ETC2)): C:\Users\eldan\.gradle\caches\transforms-2\files-2.1\14e9686d257f7e42209d8cba951687d6\jetified-r-classes.jar: R8: Type androidx.localbroadcastmanager.R is defined multiple times: C:\Users\eldan\.gradle\caches\transforms-2\files-2.1\14e9686d257f7e42209d8cba951687d6\jetified-r-classes.jar:androidx/localbroadcastmanager/R.
class, Z:\app\build\intermediates\compile_and_runtime_not_namespaced_r_class_jar\release\R.jar:androidx/localbroadcastmanager/R.class
UATHelper: Packaging (Android (ETC2)): > Task :app:mergeReleaseNativeLibs
UATHelper: Packaging (Android (ETC2)): FAILURE: Build failed with an exception.
UATHelper: Packaging (Android (ETC2)): * What went wrong:
UATHelper: Packaging (Android (ETC2)): Execution failed for task ':app:minifyReleaseWithR8'.
UATHelper: Packaging (Android (ETC2)): > com.android.tools.r8.CompilationFailedException: Compilation failed to complete
UATHelper: Packaging (Android (ETC2)): * Try:
UATHelper: Packaging (Android (ETC2)): Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
UATHelper: Packaging (Android (ETC2)): * Get more help at https://help.gradle.org
UATHelper: Packaging (Android (ETC2)): 61 actionable tasks: 61 executed
UATHelper: Packaging (Android (ETC2)): BUILD FAILED in 59s
UATHelper: Packaging (Android (ETC2)): ERROR: cmd.exe failed with args /c "F:\00 ULTRATON\TGRacer\Intermediate\Android\armv7\gradle\rungradle.bat" :app:assembleRelease
UATHelper: Packaging (Android (ETC2)): (see C:\Users\eldan\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+UE_4.27Chaos\Log.txt for full exception trace)
UATHelper: Packaging (Android (ETC2)): AutomationTool exiting with ExitCode=1 (Error_Unknown)
UATHelper: Packaging (Android (ETC2)): BUILD FAILED
PackagingResults: Error: Unknown Error