Closed PeterStaev closed 8 years ago
Hi @PeterStaev Try updating the build-tools from the Android SDK Manager.
Hi @Plamen5kov , already tried that: tried both 23.0.2 and 23.0.3 but on both the same error pops up.
Do a tns prepare android
and go to platforms/android
folder and run gradlew buildapk --info
and post the output here.
Hi @PeterStaev, I couldn't reproduce the problem on either platform, but what I can see from the log, your problem seems to reside in:
/Users/peter/Documents/Projects/nativescript-azure-mobile-apps/sample/platforms/android/build...
Try deleting the build
folder and try to build again.
Hi @Plamen5kov Sadly no go. And moreover now i see this happening on Windows as well :( Here are the details from the windows machine:
Executing task ':processF0F1DebugResources' (up-to-date check took 0.364 secs) due to:
No history is available.
All input files are considered out-of-date for incremental task ':processF0F1DebugResources'.
Starting process 'command 'C:\Program Files (x86)\Android\android-sdk\build-tools\23.0.1\aapt.exe''. Working directory: T:\_MISC\nativescript-azure-mobile-apps\sample\platforms\android Command: C:\Program Files (x86)\Android\android-sdk\build-tools\23.0.1\aapt.exe package -f --no-crunch -I C:\Program Files (x86)\Android\android-sdk\platforms\android-23\android.jar -M T:\_MISC\nativescript-azure-mobile-apps\sample\platforms\android\build\intermediates\manifests\full\F0F1\debug\AndroidManifest.xml -S T:\_MISC\nativescript-azure-mobile-apps\sample\platforms\android\build\intermediates\res\merged\F0F1\debug -A T:\_MISC\nativescript-azure-mobile-apps\sample\platforms\android\build\intermediates\assets\F0F1\debug -m -J T:\_MISC\nativescript-azure-mobile-apps\sample\platforms\android\build\generated\source\r\F0F1\debug -F T:\_MISC\nativescript-azure-mobile-apps\sample\platforms\android\build\intermediates\res\resources-F0-F1-debug.ap_ --debug-mode --custom-package inc.tangra.azuremobileservicessample -0 apk --no-version-vectors --output-text-symbols T:\_MISC\nativescript-azure-mobile-apps\sample\platforms\android\build\intermediates\symbols\F0F1\debug
Successfully started process 'command 'C:\Program Files (x86)\Android\android-sdk\build-tools\23.0.1\aapt.exe''
Unknown source file : Unable to add 'T:\_MISC\nativescript-azure-mobile-apps\sample\platforms\android\build\intermediates\assets\F0F1\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 'T:\_MISC\nativescript-azure-mobile-apps\sample\platforms\android\build\intermediates\res\resources-F0-F1-debug.ap_'
:processF0F1DebugResources FAILED
:processF0F1DebugResources (Thread[main,5,main]) completed. Took 2.278 secs.
From what I see the problem is that there are .gz
files included in the assets. For Mac I'm not sure from where that tar-pack
dependency comes, but on Windows I see that the karma@0.13.22
module has reference to log4js@0.6.36
which has refrence to semver@4.3.6
and in the semver
module there are two files: semver.min.js.gz
and semver.browser.js.gz
and for some reason those get copied over on prepare to the android/src/main/assets/app/tns_modules
as modules which does not seem right.
So seems this issue relates more to the CLI than to the android runtime?
Seems there is already an opened issue on the CLI repo: https://github.com/NativeScript/nativescript-cli/issues/1740. Using hdeshev's workaround to use tns install
instead of npm install
for the project fixes the issue.
Hi @PeterStaev,
The server.min.js
and server.browser.js.gz
come from the karma module, which is declared as a dev dependency and should not be packed with the final .apk
, but CLI still copies it into the platforms/android
folder, which causes the problems. You are right to think it's a CLI problem.
When I tried reproducing the problem, I was using CLI 2.0.0, so you try to update CLI and try again.
I am using CLI 2.0 as well.
Steps to reproduce:
npm install
andgrunt build
in the root foldertns build android
in thesample
directory.On Mac I get the following output (runs fine on Windows 10 and Travis linux distros):