I am in deep trouble

android

#1

I wiped out my laptop yesterday (Windows 10), then when throught the nativescript installation process and could create a new project.

But when I cloned my project from github and tried to run tns build android it does not work and I have absolutely no idea why, important to mention here that before I wiped out my computer there was nothing wrong and my project ran perfectly.

Has anyone here stumbled upon similar difficulties and was able to solve them

When I run tns build android this part of the console log

Failed to execute aapt
com.android.ide.common.process.ProcessException: Failed to execute aapt
at com.android.builder.core.AndroidBuilder.processResources(AndroidBuild er.java:796)
at com.android.build.gradle.tasks.ProcessAndroidResources.invokeAaptForS plit(ProcessAndroidResources.java:551)
at com.android.build.gradle.tasks.ProcessAndroidResources.doFullTaskActi on(ProcessAndroidResources.java:285)
at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(In crementalTask.java:109)
at sun.reflect.GeneratedMethodAccessor631.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore $IncrementalTaskAction.doExecute(DefaultTaskClassInfoStore.java:173)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore $StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore $StandardTaskAction.execute(DefaultTaskClassInfoStore.java:121)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1. run(ExecuteActionsTaskExecuter.java:122)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBu ildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBu ildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(De faultBuildOperationExecutor.java:197)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(Defaul tBuildOperationExecutor.java:107)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.ex ecuteAction(ExecuteActionsTaskExecuter.java:111)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.ex ecuteActions(ExecuteActionsTaskExecuter.java:92)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.ex ecute(ExecuteActionsTaskExecuter.java:70)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.exec ute(SkipUpToDateTaskExecuter.java:63)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingState Executer.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execut e(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecu ter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskE xecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter .execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execut e(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter .execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.ex ecute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTa skWorker$1.run(DefaultTaskGraphExecuter.java:248)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBu ildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBu ildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(De faultBuildOperationExecutor.java:197)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(Defaul tBuildOperationExecutor.java:107)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTa skWorker.execute(DefaultTaskGraphExecuter.java:241)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTa skWorker.execute(DefaultTaskGraphExecuter.java:230)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWo rker.processTask(DefaultTaskPlanExecutor.java:124)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWo rker.access$200(DefaultTaskPlanExecutor.java:80)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWo rker$1.execute(DefaultTaskPlanExecutor.java:105)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWo rker$1.execute(DefaultTaskPlanExecutor.java:99)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(Defau ltTaskExecutionPlan.java:625)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTa sk(DefaultTaskExecutionPlan.java:580)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWo rker.run(DefaultTaskPlanExecutor.java:99)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(Defaul tTaskPlanExecutor.java:60)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(Defau ltTaskGraphExecuter.java:128)
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTask ExecutionAction.java:37)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecute r.java:37)
at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExec uter.java:23)
at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecu ter.java:43)
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildEx ecutionAction.java:46)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecute r.java:37)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecute r.java:30)
at org.gradle.initialization.DefaultGradleLauncher$ExecuteTasks.run(Defa ultGradleLauncher.java:311)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBu ildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBu ildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(De faultBuildOperationExecutor.java:197)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(Defaul tBuildOperationExecutor.java:107)
at org.gradle.initialization.DefaultGradleLauncher.runTasks(DefaultGradl eLauncher.java:202)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(Default GradleLauncher.java:132)
at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultG radleLauncher.java:107)
at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBui ldController.java:78)
at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBui ldController.java:75)
at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultW orkerLeaseService.java:152)
at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBu ildController.java:100)
at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildC ontroller.java:75)
at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(Exe cuteBuildActionRunner.java:28)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildA ctionRunner.java:35)
at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run( ValidatingBuildActionRunner.java:32)
at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$1.run(R unAsBuildOperationBuildActionRunner.java:43)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBu ildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBu ildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(De faultBuildOperationExecutor.java:197)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(Defaul tBuildOperationExecutor.java:107)
at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(Run AsBuildOperationBuildActionRunner.java:40)
at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.ru n(SubscribableBuildActionRunner.java:51)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProce ssBuildActionExecuter.java:45)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProce ssBuildActionExecuter.java:29)
at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(Bu ildTreeScopeBuildActionExecuter.java:39)
at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(Bu ildTreeScopeBuildActionExecuter.java:25)
at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.ex ecute(ContinuousBuildActionExecuter.java:71)
at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.ex ecute(ContinuousBuildActionExecuter.java:45)
at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter .execute(ServicesSetupBuildActionExecuter.java:51)
at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter .execute(ServicesSetupBuildActionExecuter.java:32)
at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter. execute(GradleThreadBuildActionExecuter.java:36)
at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter. execute(GradleThreadBuildActionExecuter.java:25)
at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildAct ionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildAct ionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecu ter.execute(StartParamsValidatingActionExecuter.java:64)
at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecu ter.execute(StartParamsValidatingActionExecuter.java:29)
at org.gradle.tooling.internal.provider.SessionFailureReportingActionExe cuter.execute(SessionFailureReportingActionExecuter.java:55)
at org.gradle.tooling.internal.provider.SessionFailureReportingActionExe cuter.execute(SessionFailureReportingActionExecuter.java:42)
at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execu te(SetupLoggingActionExecuter.java:58)
at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execu te(SetupLoggingActionExecuter.java:33)
at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBu ild.java:67)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(Build CommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed( DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute( WatchForDisconnection.java:37)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed( DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute (ResetDeprecationLogger.java:26)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed( DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon. execute(RequestStopIfSingleUsedDaemon.java:34)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed( DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(Forw ardClientInput.java:74)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(Forw ardClientInput.java:72)
at org.gradle.util.Swapper.swap(Swapper.java:38)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(For wardClientInput.java:72)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed( DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogA ndCheckHealth.java:55)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed( DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClien t.java:62)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(Build CommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed( DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBu ild(EstablishBuildEnvironment.java:82)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(Build CommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed( DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1. run(StartBuildOrRespondWithBusy.java:50)
at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(Daemon StateCoordinator.java:297)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures. onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecu torImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor. java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor .java:624)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnabl e.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.util.concurrent.ExecutionException: java.util.concurrent.Executi onException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
at com.google.common.util.concurrent.AbstractFuture.getDoneValue(Abstrac tFuture.java:503)
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.j ava:482)
at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(Ab stractFuture.java:79)
at com.android.builder.core.AndroidBuilder.processResources(AndroidBuild er.java:794)
… 121 more
Caused by: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt 2Exception: AAPT2 error: check logs for details
at com.google.common.util.concurrent.AbstractFuture.getDoneValue(Abstrac tFuture.java:503)
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.j ava:462)
at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(Ab stractFuture.java:79)
at com.android.builder.internal.aapt.v2.QueueableAapt2.lambda$makeValida tedPackage$1(QueueableAapt2.java:179)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor. java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor .java:624)
… 1 more
Caused by: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for d etails
at com.android.builder.png.AaptProcess$NotifierProcessOutput.handleOutpu t(AaptProcess.java:463)
at com.android.builder.png.AaptProcess$NotifierProcessOutput.err(AaptPro cess.java:415)
at com.android.builder.png.AaptProcess$ProcessOutputFacade.err(AaptProce ss.java:332)
at com.android.utils.GrabProcessOutput$1.run(GrabProcessOutput.java:104)

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:app:processDebugResources’.

Failed to execute aapt


#2

I discovered that the problem is in my package.json file by copying it into a newly created project, with the old package.json file the new project could build and run but with the new one it gives me the same error.

This is my package.json file, does anyone here see the problem?

{
“description”: “NativeScript Application”,
“license”: "SEE LICENSE IN ",
“readme”: “NativeScript Application”,
“repository”: “”,
“nativescript”: {
“id”: “org.nativescript.LudusApp”,
“tns-android”: {
“version”: “4.0.1”
}
},
“dependencies”: {
@angular/animations”: “~5.2.0”,
@angular/common”: “~5.2.0”,
@angular/compiler”: “~5.2.0”,
@angular/core”: “~5.2.0”,
@angular/forms”: “~5.2.0”,
@angular/http”: “~5.2.0”,
@angular/platform-browser”: “~5.2.0”,
@angular/platform-browser-dynamic”: “~5.2.0”,
@angular/router”: “~5.2.0”,
@ng-idle/core”: “^2.0.0-beta.12”,
@ng-idle/keepalive”: “^2.0.0-beta.12”,
“angular2-moment”: “^1.7.0”,
“enhanced-resolve”: “^3.3.0”,
“nativescript-angular”: “^5.2.0”,
“nativescript-awesome-loaders”: “^1.2.1”,
“nativescript-background-http”: “^3.2.2”,
“nativescript-camera”: “^4.0.0”,
“nativescript-couchbase”: “^1.0.18”,
“nativescript-directions”: “^1.2.0”,
“nativescript-drop-down”: “^3.2.4”,
“nativescript-geolocation”: “^3.0.1”,
“nativescript-google-maps-sdk”: “^2.6.0”,
“nativescript-imagecropper”: “^0.1.2”,
“nativescript-imagepicker”: “^5.0.1”,
“nativescript-local-notifications”: “^2.0.1”,
“nativescript-numeric-keyboard”: “^3.0.3”,
“nativescript-permissions”: “^1.2.3”,
“nativescript-pro-ui”: “^3.4.0”,
“nativescript-screen-orientation”: “^2.0.0”,
“nativescript-social-share”: “^1.5.0”,
“nativescript-theme-core”: “~1.0.4”,
“nativescript-toast”: “^1.4.6”,
“nativescript-ui-chart”: “^3.5.0”,
“nativescript-unit-test-runner”: “^0.3.4”,
“nativescript-videoplayer”: “^3.1.0”,
“reflect-metadata”: “~0.1.8”,
“rxjs”: “^5.5.0”,
“tns-core-modules”: “^4.0.0”,
“zone.js”: “^0.8.4”
},
“devDependencies”: {
@angular/compiler-cli”: “~5.2.0”,
@ngtools/webpack”: “~1.9.4”,
@types/mocha”: “^2.2.48”,
“babel-traverse”: “6.4.5”,
“babel-types”: “6.4.5”,
“babylon”: “6.4.5”,
“chai”: “^4.1.2”,
“copy-webpack-plugin”: “~4.3.0”,
“css-loader”: “~0.28.7”,
“extract-text-webpack-plugin”: “~3.0.2”,
“karma”: “^2.0.0”,
“karma-chai”: “^0.1.0”,
“karma-mocha”: “^1.3.0”,
“karma-nativescript-launcher”: “^0.4.0”,
“lazy”: “1.0.11”,
“mocha”: “^4.1.0”,
“nativescript-dev-android-snapshot”: “^0..”,
“nativescript-dev-typescript”: “^0.6.0”,
“nativescript-dev-webpack”: “^0.9.2”,
“nativescript-worker-loader”: “~0.8.1”,
“raw-loader”: “~0.5.1”,
“resolve-url-loader”: “~2.2.1”,
“typescript”: “~2.6.2”,
“uglifyjs-webpack-plugin”: “~1.1.6”,
“webpack”: “3.10.0”,
“webpack-bundle-analyzer”: “^2.9.1”,
“webpack-sources”: “~1.1.0”
}
}