Skip to content

semver.browser.js.gz file already in archive in sample-Groceries app #1122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kyrisu opened this issue Oct 30, 2015 · 11 comments
Closed

semver.browser.js.gz file already in archive in sample-Groceries app #1122

kyrisu opened this issue Oct 30, 2015 · 11 comments

Comments

@kyrisu
Copy link

kyrisu commented Oct 30, 2015

My problem is similar to issue #601 but based on the notes there it should be fixed in version 1.1.2

I'm on version 1.4.3

$ tns --version
1.4.3

Unfortunately when I try to run sample-Groceries app from the tutorial I have the following error:

$ tns run android
Project successfully prepared
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel
execute: copyAarDependencies, addAarDependencies before configuration
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:preReleaseBuild UP-TO-DATE
:prepareChart201531016DevReleaseLibrary UP-TO-DATE
:prepareComAndroidSupportAppcompatV72221Library UP-TO-DATE
:prepareComAndroidSupportSupportV42221Library UP-TO-DATE
:prepareCommon201531016DevReleaseLibrary UP-TO-DATE
:prepareData201531016DevReleaseLibrary UP-TO-DATE
:prepareList201531016DevReleaseLibrary UP-TO-DATE
:preparePrimitives201531016DevReleaseLibrary UP-TO-DATE
:prepareDebugDependencies
:compileDebugAidl UP-TO-DATE
:compileDebugRenderscript UP-TO-DATE
:generateDebugBuildConfig UP-TO-DATE
:deleteJavaDir UP-TO-DATE
:cleanLocalAarFiles
:collectAllJars UP-TO-DATE
:ensureMetadataOutDir UP-TO-DATE
:buildMetadata UP-TO-DATE
:copyMetadata UP-TO-DATE
:generateDebugAssets UP-TO-DATE
:mergeDebugAssets UP-TO-DATE
:generateDebugResValues UP-TO-DATE
:generateDebugResources UP-TO-DATE
:mergeDebugResources UP-TO-DATE
:processDebugManifest UP-TO-DATE
:processDebugResourcesUnknown source file :       Unable to add '/home/kyrisu/dev_temp/sample-Groceries/platforms/android/build/intermediates/assets/debug/app/tns_modules/semver/semver.browser.js.gz': file already in archive (try '-u'?)
Unknown source file : ERROR: unable to process assets while packaging '/home/kyrisu/dev_temp/sample-Groceries/platforms/android/build/intermediates/res/resources-debug.ap_'

 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/home/kyrisu/bin/android-sdk-linux/build-tools/22.0.1/aapt'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 9.09 secs
Command gradle failed with exit code 1
@charalamposc
Copy link

I got the same error after the upgrade to 1.4.1.
I got android sdk installed and tools, platform-tools are in the PATH.
The parameters --stacktrace, --info, --debug wont work.

@charalamposc
Copy link

I must correct myself. I use also version 1.4.3.
With the fresh created project there is no problem. When I try to emulate on android an upgraded project (from 1.3) then I get this error.

@charalamposc
Copy link

I deleted all dependencies in the package.json removed, except tns-android and tns-core-modules and it worked just fine. So, I think some dependency creates the problem.

@brendannoble
Copy link

This is a major issue, with any devDependencies I am unable to build the project which means I cannot use Gulp or many other node_modules. This needs to be fixed.

@darrencruse
Copy link

Hit the same this morning btw.

It's weird I went through part of the groceries tutorial yesterday and things were working but when I went back to it today I got the exact error that kyrisu shows above.

I don't know why - I hadn't done anything to explain it that I know of... (well not entirely true - I had decided to try genymotion this morning but I couldn't get it to work - so I first saw the above error when I was trying to use genymotion, it was only when I gave up and switched back to the stock android emulator that I realized I was getting the same error under it as well).

Wasted a bunch of time trying to figure it out but finally I thought to try the iOS emulator and I'm back in business using that for now...

Really frustrating though (partly because these builds are slow as molasses on my machine I'm not sure it's typical I haven't timed them but each attempt at "tns run android --emulator" was taking multiple minutes to get through that was really adding to my frustration).

Does anybody know if there's a workaround for this problem btw? Since it seems to not happen when you first start the tutorial but only shows up later, I wondered shouldn't there be a "clean build" or something to re-jigger it back? Or what if we just blew everything under node_modules away would that cause it to re-do the "npm install" and get back to the working state again (as it had yesterdat after the first "npm install"?)

@khaliddpdev
Copy link

Not sure if this will work for everyone, but I was having the same issue. Installing a local semver package via npm worked for me: npm install semver. It seems the issue stems from using an older version of semver.

@KallynGowdy
Copy link

@khaliddpdev +1, installing the latest version of semver fixed the issue for me.

@ligaz
Copy link

ligaz commented Feb 29, 2016

Hey guys,

The issue is that an older versions of semver npm package did include gzipped files in its content. I guess those were there because this package was deployed on Amazon's CloudFlare which does not support edge node gzipping thus yielding that the compression should happen before hand. The naming convention for such operation is to append .gz to the filename for the archived resources.

On other hand Android asset packing tool (aapt) does not play nicely when you have gzipped files that have names equal to none compressed files minus the file extension (semver.browser.js.gz and semver.browser.js). A "secret" feature of the aapt tool is to not archive files that are already archived and to bundle them using their name. This is absolutely fine however it collides with the naming convention used for packaging assets for Amazon's CDN.

Good news is that newer versions of the semver library does not include those gzipped assets.

@ligaz ligaz closed this as completed Feb 29, 2016
@georgeonofrei
Copy link

Hit this issue again today.
applied @khaliddpdev solutions: npm install semver and it worked again.

@losttime
Copy link
Contributor

losttime commented Dec 5, 2016

Ran into this today also.

If the log4js dependency gets updated to 1.0.1 (latest), this shouldn't be a problem anymore. log4js updated their semver dependency in 1.0.1 to a newer version that doesn't include semver.browser.js.gz

@rLoka
Copy link

rLoka commented Dec 14, 2016

If anyone still has this issue and updating samver does not help, try to update tns-core-modules and tns-android to @next version (2.5.0 development version in my case) ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants