Android studio - custom plugins causing com.android.builder.packaging.DuplicateFileException

This is similar to the issue already posted (flurry) about a duplicate file exception, but this is with my own plugin.

I’m using build 2016.2902

I used the app template to start a new plugin.  Other than renaming it from “library” to “blank” it is just the exact code from the template.

I add this blank plugin into the libs directory another “App” project without changing anything.    

Error:Execution failed for task ‘:app:transformResourcesWithMergeJavaResForDebug’.

> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK network/LuaHelper.java.orig

  File1: /Users/bob/dev/mobile/corona_enterprise/App/android/app/libs/plugin.blank.jar

  File2: /Users/bob/dev/mobile/corona_enterprise/App/android/app/build/intermediates/exploded-aar/android/plugin/unspecified/jars/classes.jar

I filed a bug report.

I think the problem is that I’m not building the plugin (jar) correctly?  Here’s the blank plugin, that jar file doesn’t look valid - there’s no manifest for one thing, and what are those .orig files doing there?

jar tvf plugin.blank.jar 

  6306 Thu Jun 16 07:21:58 PDT 2016 network/LuaHelper.java.orig

 67363 Thu Jun 16 07:21:58 PDT 2016 network/NetworkRequest.java.orig

   558 Thu Jun 16 07:21:58 PDT 2016 plugin/blank/BuildConfig.class

   723 Thu Jun 16 07:21:58 PDT 2016 plugin/blank/LuaLoader$1$1.class

  1422 Thu Jun 16 07:21:58 PDT 2016 plugin/blank/LuaLoader$1.class

   988 Thu Jun 16 07:21:58 PDT 2016 plugin/blank/LuaLoader$InitWrapper.class

   988 Thu Jun 16 07:21:58 PDT 2016 plugin/blank/LuaLoader$ShowWrapper.class

  3041 Thu Jun 16 07:21:58 PDT 2016 plugin/blank/LuaLoader.class

Looks like these rogue “.orig” files are coming from network.jar.  Is this a bug ?

jar tvf network.jar

     0 Thu Jun 02 09:28:46 PDT 2016 META-INF/

   103 Thu Jun 02 09:28:44 PDT 2016 META-INF/MANIFEST.MF

     0 Thu Jun 02 09:28:46 PDT 2016 network/

  7306 Thu Jun 02 09:28:44 PDT 2016 network/LuaHelper.class

  3521 Thu Jun 02 09:28:44 PDT 2016 network/LuaLoader.class

  1501 Thu Jun 02 09:28:46 PDT 2016 network/NetworkCancel.class

  2230 Thu Jun 02 09:28:46 PDT 2016 network/NetworkGetConnectionStatus.class

  1124 Thu Jun 02 09:28:46 PDT 2016 network/NetworkRequest$1.class

 17119 Thu Jun 02 09:28:46 PDT 2016 network/NetworkRequest$AsyncNetworkRequestRunnable.class

  2078 Thu Jun 02 09:28:46 PDT 2016 network/NetworkRequest$CoronaFileSpec.class

  2933 Thu Jun 02 09:28:46 PDT 2016 network/NetworkRequest$LuaCallback$1.class

  4007 Thu Jun 02 09:28:46 PDT 2016 network/NetworkRequest$LuaCallback.class

 11721 Thu Jun 02 09:28:46 PDT 2016 network/NetworkRequest$NetworkRequestParameters.class

  4957 Thu Jun 02 09:28:46 PDT 2016 network/NetworkRequest$NetworkRequestState.class

  1885 Thu Jun 02 09:28:46 PDT 2016 network/NetworkRequest$ProgressDirection.class

  8977 Thu Jun 02 09:28:46 PDT 2016 network/NetworkRequest.class

  6306 Fri Feb 26 14:49:14 PST 2016 network/LuaHelper.java.orig

 67363 Wed Apr 22 15:04:02 PDT 2015 network/NetworkRequest.java.orig

Those rogue files were introduced in Corona Enterprise 2016.2890.  I’ll log a(nother) bug.

This appears to be fixed in 2016.2904.  Thanks for quick turnaround.

I think the problem is that I’m not building the plugin (jar) correctly?  Here’s the blank plugin, that jar file doesn’t look valid - there’s no manifest for one thing, and what are those .orig files doing there?

jar tvf plugin.blank.jar 

  6306 Thu Jun 16 07:21:58 PDT 2016 network/LuaHelper.java.orig

 67363 Thu Jun 16 07:21:58 PDT 2016 network/NetworkRequest.java.orig

   558 Thu Jun 16 07:21:58 PDT 2016 plugin/blank/BuildConfig.class

   723 Thu Jun 16 07:21:58 PDT 2016 plugin/blank/LuaLoader$1$1.class

  1422 Thu Jun 16 07:21:58 PDT 2016 plugin/blank/LuaLoader$1.class

   988 Thu Jun 16 07:21:58 PDT 2016 plugin/blank/LuaLoader$InitWrapper.class

   988 Thu Jun 16 07:21:58 PDT 2016 plugin/blank/LuaLoader$ShowWrapper.class

  3041 Thu Jun 16 07:21:58 PDT 2016 plugin/blank/LuaLoader.class

Looks like these rogue “.orig” files are coming from network.jar.  Is this a bug ?

jar tvf network.jar

     0 Thu Jun 02 09:28:46 PDT 2016 META-INF/

   103 Thu Jun 02 09:28:44 PDT 2016 META-INF/MANIFEST.MF

     0 Thu Jun 02 09:28:46 PDT 2016 network/

  7306 Thu Jun 02 09:28:44 PDT 2016 network/LuaHelper.class

  3521 Thu Jun 02 09:28:44 PDT 2016 network/LuaLoader.class

  1501 Thu Jun 02 09:28:46 PDT 2016 network/NetworkCancel.class

  2230 Thu Jun 02 09:28:46 PDT 2016 network/NetworkGetConnectionStatus.class

  1124 Thu Jun 02 09:28:46 PDT 2016 network/NetworkRequest$1.class

 17119 Thu Jun 02 09:28:46 PDT 2016 network/NetworkRequest$AsyncNetworkRequestRunnable.class

  2078 Thu Jun 02 09:28:46 PDT 2016 network/NetworkRequest$CoronaFileSpec.class

  2933 Thu Jun 02 09:28:46 PDT 2016 network/NetworkRequest$LuaCallback$1.class

  4007 Thu Jun 02 09:28:46 PDT 2016 network/NetworkRequest$LuaCallback.class

 11721 Thu Jun 02 09:28:46 PDT 2016 network/NetworkRequest$NetworkRequestParameters.class

  4957 Thu Jun 02 09:28:46 PDT 2016 network/NetworkRequest$NetworkRequestState.class

  1885 Thu Jun 02 09:28:46 PDT 2016 network/NetworkRequest$ProgressDirection.class

  8977 Thu Jun 02 09:28:46 PDT 2016 network/NetworkRequest.class

  6306 Fri Feb 26 14:49:14 PST 2016 network/LuaHelper.java.orig

 67363 Wed Apr 22 15:04:02 PDT 2015 network/NetworkRequest.java.orig

Those rogue files were introduced in Corona Enterprise 2016.2890.  I’ll log a(nother) bug.

This appears to be fixed in 2016.2904.  Thanks for quick turnaround.