Gradle application variant mergeAssets not working - android

I'm trying to use the gradle applicationVariants mergeAssets task to remove some unused assets files from my apk.
Even though I'm able to print the line "this line is printed", when the application variant is 'run', the variant.mergeAssets.doFirst {} does not seem to be called, as I never see the output "this line is not printed" in my gradle console. The asset I'm trying to remove does not get removed either, but it seems like the code to remove it is never executed.
Am I doing something wrong? I've tried moving the entire android.applicationVariants task outside of buildTypes, I've tried nesting it in release{}.. nothing I've tried seems to work.
buildTypes {
release {
runProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), file('proguard-project.txt')
signingConfig signingConfigs.release
}
publicBeta.initWith(buildTypes.release)
publicBeta {
runProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), file('proguard-project.txt')
}
android.applicationVariants.all { variant ->
println 'this line is printed'
variant.mergeAssets.doFirst {
println 'this line is never printed'
File fonts = file("${rootDir}/build/intermediates/exploded-aar/com.github.johnkil.android-robototextview/robototextview/2.0.1/assets/fonts")
if (fonts.exists()) {
for (File file : fonts.listFiles()) {
if (file.getName().contains("RobotoSlab")) {
println("delete " + file.getName() + " font")
file.delete()
};
}
}
}
}
}
Here's the gradle console output, for brevity:
Executing tasks: [:shuttle_paid:assembleRelease]
Configuration on demand is an incubating feature.
Relying on packaging to define the extension of the main artifact has been deprecated and is scheduled to be removed in Gradle 2.0
this line is printed
this line is printed
this line is printed
:shuttle_library:compileLint
:shuttle_library:copyReleaseLint UP-TO-DATE
:shuttle_library:preBuild
:shuttle_library:preReleaseBuild
:shuttle_library:checkReleaseManifest
:shuttle_library:preDebugBuild
:shuttle_library:preDebugTestBuild
:libraries:castcompanionlibrary-android:compileLint
:libraries:castcompanionlibrary-android:copyReleaseLint UP-TO-DATE
:libraries:castcompanionlibrary-android:preBuild
:libraries:castcompanionlibrary-android:preReleaseBuild
:libraries:castcompanionlibrary-android:checkReleaseManifest
:libraries:castcompanionlibrary-android:preDebugBuild
:libraries:castcompanionlibrary-android:preDebugTestBuild
:libraries:castcompanionlibrary-android:prepareComAndroidSupportAppcompatV72000Library UP-TO-DATE
:libraries:castcompanionlibrary-android:prepareComAndroidSupportMediarouterV72000Library UP-TO-DATE
:libraries:castcompanionlibrary-android:prepareComAndroidSupportSupportV42000Library UP-TO-DATE
:libraries:castcompanionlibrary-android:prepareComGoogleAndroidGmsPlayServices5077Library UP-TO-DATE
:libraries:castcompanionlibrary-android:prepareReleaseDependencies
:libraries:castcompanionlibrary-android:compileReleaseAidl UP-TO-DATE
:libraries:castcompanionlibrary-android:compileReleaseRenderscript UP-TO-DATE
:libraries:castcompanionlibrary-android:generateReleaseBuildConfig UP-TO-DATE
:libraries:castcompanionlibrary-android:generateReleaseAssets UP-TO-DATE
:libraries:castcompanionlibrary-android:mergeReleaseAssets UP-TO-DATE
:libraries:castcompanionlibrary-android:generateReleaseResValues UP-TO-DATE
:libraries:castcompanionlibrary-android:generateReleaseResources UP-TO-DATE
:libraries:castcompanionlibrary-android:mergeReleaseResources UP-TO-DATE
:libraries:castcompanionlibrary-android:processReleaseManifest UP-TO-DATE
:libraries:castcompanionlibrary-android:processReleaseResources UP-TO-DATE
:libraries:castcompanionlibrary-android:generateReleaseSources UP-TO-DATE
:libraries:castcompanionlibrary-android:compileReleaseJava UP-TO-DATE
:libraries:castcompanionlibrary-android:extractReleaseAnnotations UP-TO-DATE
:libraries:castcompanionlibrary-android:mergeReleaseProguardFiles UP-TO-DATE
:libraries:castcompanionlibrary-android:processReleaseJavaRes UP-TO-DATE
:libraries:castcompanionlibrary-android:packageReleaseJar UP-TO-DATE
:libraries:castcompanionlibrary-android:compileReleaseNdk UP-TO-DATE
:libraries:castcompanionlibrary-android:packageReleaseJniLibs UP-TO-DATE
:libraries:castcompanionlibrary-android:packageReleaseLocalJar UP-TO-DATE
:libraries:castcompanionlibrary-android:packageReleaseRenderscript UP-TO-DATE
:libraries:castcompanionlibrary-android:packageReleaseResources UP-TO-DATE
:libraries:castcompanionlibrary-android:bundleRelease UP-TO-DATE
:shuttle_library:prepareComAndroidSupportAppcompatV72000Library UP-TO-DATE
:shuttle_library:prepareComAndroidSupportMediarouterV72000Library UP-TO-DATE
:shuttle_library:prepareComAndroidSupportSupportV42000Library UP-TO-DATE
:shuttle_library:prepareComGithubJohnkilAndroidRobototextviewRobototextview210Library UP-TO-DATE
:shuttle_library:prepareComGoogleAndroidGmsPlayServices5077Library UP-TO-DATE
:shuttle_library:prepareComLarswerkmanHoloColorPicker14Library UP-TO-DATE
:shuttle_library:prepareShuttleLibrariesCastcompanionlibraryAndroidUnspecifiedLibrary UP-TO-DATE
:shuttle_library:prepareReleaseDependencies
:shuttle_library:compileReleaseAidl UP-TO-DATE
:shuttle_library:compileReleaseRenderscript UP-TO-DATE
:shuttle_library:generateReleaseBuildConfig UP-TO-DATE
:shuttle_library:generateReleaseAssets UP-TO-DATE
:shuttle_library:mergeReleaseAssets UP-TO-DATE
:shuttle_library:generateReleaseResValues UP-TO-DATE
:shuttle_library:generateReleaseResources UP-TO-DATE
:shuttle_library:mergeReleaseResources UP-TO-DATE
:shuttle_library:processReleaseManifest UP-TO-DATE
:shuttle_library:processReleaseResources UP-TO-DATE
:shuttle_library:generateReleaseSources UP-TO-DATE
:shuttle_library:compileReleaseJava UP-TO-DATE
:shuttle_library:extractReleaseAnnotations UP-TO-DATE
:shuttle_library:mergeReleaseProguardFiles UP-TO-DATE
:shuttle_library:processReleaseJavaRes UP-TO-DATE
:shuttle_library:packageReleaseJar UP-TO-DATE
:shuttle_library:compileReleaseNdk UP-TO-DATE
:shuttle_library:packageReleaseJniLibs UP-TO-DATE
:shuttle_library:packageReleaseLocalJar UP-TO-DATE
:shuttle_library:packageReleaseRenderscript UP-TO-DATE
:shuttle_library:packageReleaseResources UP-TO-DATE
:shuttle_library:bundleRelease UP-TO-DATE
:shuttle_paid:preBuild
:shuttle_paid:preReleaseBuild
:shuttle_paid:checkReleaseManifest
:shuttle_paid:preDebugBuild
:shuttle_paid:prePublicBetaBuild
:shuttle_paid:prepareComAndroidSupportAppcompatV72000Library UP-TO-DATE
:shuttle_paid:prepareComAndroidSupportMediarouterV72000Library UP-TO-DATE
:shuttle_paid:prepareComAndroidSupportSupportV42000Library UP-TO-DATE
:shuttle_paid:prepareComGithubJohnkilAndroidRobototextviewRobototextview210Library UP-TO-DATE
:shuttle_paid:prepareComGoogleAndroidGmsPlayServices5077Library UP-TO-DATE
:shuttle_paid:prepareComLarswerkmanHoloColorPicker14Library UP-TO-DATE
:shuttle_paid:prepareShuttleLibrariesCastcompanionlibraryAndroidUnspecifiedLibrary UP-TO-DATE
:shuttle_paid:prepareShuttleShuttle_libraryUnspecifiedLibrary UP-TO-DATE
:shuttle_paid:prepareReleaseDependencies
:shuttle_paid:compileReleaseAidl UP-TO-DATE
:shuttle_paid:compileReleaseRenderscript UP-TO-DATE
:shuttle_paid:generateReleaseBuildConfig UP-TO-DATE
:shuttle_paid:generateReleaseAssets UP-TO-DATE
:shuttle_paid:mergeReleaseAssets UP-TO-DATE
:shuttle_paid:generateReleaseResValues UP-TO-DATE
:shuttle_paid:generateReleaseResources UP-TO-DATE
:shuttle_paid:mergeReleaseResources UP-TO-DATE
:shuttle_paid:processReleaseManifest UP-TO-DATE
:shuttle_paid:processReleaseResources UP-TO-DATE
:shuttle_paid:generateReleaseSources UP-TO-DATE
:shuttle_paid:compileReleaseJava UP-TO-DATE
:shuttle_paid:lintVitalRelease
:shuttle_paid:compileReleaseNdk UP-TO-DATE
:shuttle_paid:proguardRelease UP-TO-DATE
:shuttle_paid:dexRelease UP-TO-DATE
:shuttle_paid:processReleaseJavaRes UP-TO-DATE
:shuttle_paid:validateReleaseSigning
:shuttle_paid:packageRelease UP-TO-DATE
:shuttle_paid:zipalignRelease UP-TO-DATE
:shuttle_paid:assembleRelease
BUILD SUCCESSFUL
Total time: 8.682 secs

The line that is printed will always be printed because it gets executed in the configuration phase. ( see Gradle User Guide )
Your gradle console output shows all the merge*Resources tasks being skipped as UP-TO-DATE. This means that the inputs and the outputs have not changed since last time the tasks were executed, so gradle does not execute them again. Unfortunately, Gradle is not yet smart enough to know that you have changed the task implementation and that it should not skip the task.
Try running a clean to force the task to run

Related

Jenkins-pipeline fail : No such DSL method 'androidLint' found among steps

I get a failure for the stage 'Static analysis' during my jenkins-pipeline.
Here is my Jenkinsfile :
pipeline {
agent any
stages {
stage('Compile') {
steps {
// Compile the app and its dependencies
sh './gradlew compileDebugSources'
}
}
stage('Unit test') {
steps {
// Compile and run the unit tests for the app and its dependencies
sh './gradlew testDebugUnitTest testDebugUnitTest'
// Analyse the test results and update the build result as appropriate
junit '**/TEST-*.xml'
}
}
stage('Build APK') {
steps {
// Finish building and packaging the APK
sh './gradlew assembleDebug'
// Archive the APKs so that they can be downloaded from Jenkins
archiveArtifacts '**/*.apk'
}
}
stage('Static analysis') {
steps {
// Run Lint and analyse the results
sh './gradlew lintDebug'
androidLint pattern: '**/lint-results-*.xml'
}
}
stage('Deploy') {
steps {
// Build the app in release mode, and sign the APK using the environment variables
sh './gradlew assembleRelease'
// Archive the APKs so that they can be downloaded from Jenkins
archiveArtifacts '**/*.apk'
}
}
}
}
Here is the Console Output :
[Pipeline] stage
[Pipeline] { (Static analysis)
[Pipeline] sh
+ ./gradlew lintDebug
> Task :app:preBuild UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :app:generateDebugBuildConfig UP-TO-DATE
> Task :app:compileDebugAidl NO-SOURCE
> Task :app:compileDebugRenderscript NO-SOURCE
> Task :app:checkDebugAarMetadata UP-TO-DATE
> Task :app:generateDebugResValues UP-TO-DATE
> Task :app:generateDebugResources UP-TO-DATE
> Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
> Task :app:extractDeepLinksDebug UP-TO-DATE
> Task :app:javaPreCompileDebug UP-TO-DATE
> Task :app:mergeDebugResources UP-TO-DATE
> Task :app:processDebugMainManifest UP-TO-DATE
> Task :app:processDebugManifest UP-TO-DATE
> Task :app:processDebugManifestForPackage UP-TO-DATE
> Task :app:processDebugResources UP-TO-DATE
> Task :app:compileDebugKotlin UP-TO-DATE
> Task :app:compileDebugJavaWithJavac UP-TO-DATE
> Task :app:lintDebug
Wrote HTML report to file:///var/jenkins_home/workspace/Pushr_master/app/build/reports/lint-results-debug.html
Wrote XML report to file:///var/jenkins_home/workspace/Pushr_master/app/build/reports/lint-results-debug.xml
BUILD SUCCESSFUL in 23s
14 actionable tasks: 1 executed, 13 up-to-date
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Deploy)
Stage "Deploy" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
GitHub has been notified of this commit’s build result
java.lang.NoSuchMethodError: No such DSL method 'androidLint' found among steps [archive, bat, build, catchError, checkout, compareVersions, deleteDir, dir, dockerFingerprintFrom, dockerFingerprintRun, echo, emailext, emailextrecipients, envVarsForTool, error, fileExists, findBuildScans, findFiles, getContext, git, input, isUnix, jiraComment, jiraIssueSelector, jiraSearch, junit, library, libraryResource, load, lock, mail, milestone, node, nodesByLabel, parallel, powershell, properties, publishChecks, publishHTML, publishIssues, pwd, pwsh, readCSV, readFile, readJSON, readManifest, readMavenPom, readProperties, readTrusted, readYaml, recordIssues, resolveScm, retry, scanForIssues, script, sh, sha1, sleep, stage, stash, step, tee, timeout, timestamps, tm, tool, touch, unarchive, unstable, unstash, unzip, validateDeclarativePipeline, waitUntil, warnError, withContext, withCredentials, withDockerContainer, withDockerRegistry, withDockerServer, withEnv, withGradle, wrap, writeCSV, writeFile, writeJSON, writeMavenPom, writeYaml, ws, zip] or symbols [PVSStudio, acuCobol, ajc, all, allBranchesSame, allOf, always, androidLintParser, ansibleLint, ant, antFromApache, antOutcome, antTarget, any, anyOf, apiToken, architecture, archiveArtifacts, armCc, artifactManager, authorizationMatrix, axivion, axivionSuite, batchFile, bitbucket, bitbucketBranchDiscovery, bitbucketForkDiscovery, bitbucketPublicRepoPullRequestFilter, bitbucketPullRequestDiscovery, bitbucketSshCheckout, bitbucketTagDiscovery, bitbucketTrustEveryone, bitbucketTrustNobody, bitbucketTrustProject, bitbucketTrustTeam, bitbucketWebhookConfiguration, bitbucketWebhookRegistration, booleanParam, branch, brokenBuildSuspects, brokenTestsSuspects, buckminster, buildButton, buildDiscarder, buildDiscarders, buildRetention, buildUser, buildingTag, cadence, cargo, caseInsensitive, caseSensitive, ccm, certificate, changeRequest, changelog, changeset, checkStyle, checkoutToSubdirectory, choice, choiceParam, clair, clang, clangAnalyzer, clangTidy, cleanWs, clock, cmake, codeAnalysis, codeNarc, command, coolflux, cpd, cppCheck, cppLint, credentials, cron, crumb, cssLint, culprits, defaultFolderConfiguration, defaultView, demand, detekt, developers, diabC, disableConcurrentBuilds, disableResume, docFx, docker, dockerCert, dockerLint, dockerServer, dockerTool, dockerfile, downstream, doxygen, drMemory, dscanner, dumb, dupFinder, durabilityHint, eclipse, email-ext, envVars, envVarsFilter, environment, equals, erlc, errorProne, esLint, excludeCategory, excludeFile, excludeMessage, excludeModule, excludeNamespace, excludePackage, excludeType, expression, file, fileParam, filePath, findBugs, fingerprint, fingerprints, flake8, flawfinder, flexSdk, frameOptions, freeStyle, freeStyleJob, fromDocker, fromScm, fromSource, fxcop, gcc, gcc3, gcc4, gendarme, ghsMulti, git, gitBranchDiscovery, gitHubBranchDiscovery, gitHubBranchHeadAuthority, gitHubExcludeArchivedRepositories, gitHubExcludePublicRepositories, gitHubForkDiscovery, gitHubPullRequestDiscovery, gitHubSshCheckout, gitHubTagDiscovery, gitHubTopicsFilter, gitHubTrustContributors, gitHubTrustEveryone, gitHubTrustNobody, gitHubTrustPermissions, gitTagDiscovery, github, githubPush, gnat, gnuFortran, goLint, goVet, gradle, groovyScript, hadoLint, headRegexFilter, headWildcardFilter, hyperlink, hyperlinkToModels, iar, iarCstat, ibLinter, ideaInspection, includeCategory, includeFile, includeMessage, includeModule, includeNamespace, includePackage, includeType, infer, inheriting, inheritingGlobal, installSource, intel, invalids, isRestartedRun, issues, java, javaDoc, javadoc, jcReport, jdk, jdkInstaller, jgit, jgitapache, jnlp, jobBuildDiscarder, jobName, jsHint, jsLint, junitParser, junitTestResultStorage, klocWork, kotlin, ktLint, label, lastDuration, lastFailure, lastGrantedAuthorities, lastStable, lastSuccess, legacy, legacySCM, list, local, location, logRotator, loggedInUsersCanDoAnything, mailer, masterBuild, maven, maven3Mojos, mavenConsole, mavenErrors, mavenMojos, mavenWarnings, metrowerksCodeWarrior, mineRepository, modelsim, modernSCM, msBuild, myPy, myView, nagFortran, namedBranchesDifferent, newContainerPerStage, node, nodeProperties, nonInheriting, none, not, overrideIndexTriggers, paneStatus, parallelsAlwaysFailFast, parameters, password, pattern, pcLint, pep8, perforce, perlCritic, permanent, php, phpCodeSniffer, phpStan, pipeline-model, pipeline-model-docker, pipelineTriggers, pit, plainText, plugin, pmdParser, pollSCM, prefast, preserveStashes, projectNamingStrategy, protoLint, proxy, pruneTags, puppetLint, pyDocStyle, pyLint, qacSourceCodeAnalyser, queueItemAuthenticator, quietPeriod, rateLimit, rateLimitBuilds, recipients, recordIssues, requestor, resharperInspectCode, resourceRoot, retainOnlyVariables, rfLint, robocopy, ruboCop, run, runParam, sSHLauncher, scala, schedule, scmRetryCount, scriptApproval, scriptApprovalLink, search, security, shell, simian, simpleBuildDiscarder, skipDefaultCheckout, skipStagesAfterUnstable, slave, sonarQube, sourceRegexFilter, sourceWildcardFilter, sphinxBuild, spotBugs, ssh, sshPublicKey, sshUserPrivateKey, standard, status, string, stringParam, styleCop, sunC, suppressAutomaticTriggering, swapSpace, swiftLint, tag, tagList, taskScanner, taskingVx, teamSlugFilter, text, textParam, tiCss, timestamper, timestamperConfig, timezone, tmpSpace, tnsdl, toolLocation, triggeredBy, tsLint, unsecured, untrusted, upstream, upstreamDevelopers, userSeed, usernameColonPassword, usernamePassword, viewsTabBar, warningsParsers, warningsPlugin, weather, withAnt, x509ClientCert, xlc, xmlLint, yamlLint, yuiCompressor, zfs, zip, zptLint] or globals [currentBuild, docker, env, params, pipeline, scm]
at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:216)
at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:122)
at sun.reflect.GeneratedMethodAccessor475.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:163)
at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:23)
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:157)
at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:161)
at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:165)
at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:135)
at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17)
at WorkflowScript.run(WorkflowScript:32)
at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.delegateAndExecute(ModelInterpreter.groovy:137)
at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.executeSingleStage(ModelInterpreter.groovy:661)
at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.catchRequiredContextForNode(ModelInterpreter.groovy:395)
at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.catchRequiredContextForNode(ModelInterpreter.groovy:393)
at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.executeSingleStage(ModelInterpreter.groovy:660)
at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(ModelInterpreter.groovy:288)
at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.toolsBlock(ModelInterpreter.groovy:544)
at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.toolsBlock(ModelInterpreter.groovy:543)
at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(ModelInterpreter.groovy:276)
at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.withEnvBlock(ModelInterpreter.groovy:443)
at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.withEnvBlock(ModelInterpreter.groovy:442)
at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(ModelInterpreter.groovy:275)
at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.withCredentialsBlock(ModelInterpreter.groovy:481)
at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.withCredentialsBlock(ModelInterpreter.groovy:480)
at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(ModelInterpreter.groovy:274)
at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.inDeclarativeAgent(ModelInterpreter.groovy:586)
at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.inDeclarativeAgent(ModelInterpreter.groovy:585)
at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(ModelInterpreter.groovy:272)
at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.stageInput(ModelInterpreter.groovy:356)
at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.stageInput(ModelInterpreter.groovy:355)
at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(ModelInterpreter.groovy:261)
at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.inWrappers(ModelInterpreter.groovy:613)
at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.inWrappers(ModelInterpreter.groovy:612)
at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(ModelInterpreter.groovy:259)
at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.withEnvBlock(ModelInterpreter.groovy:443)
at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.withEnvBlock(ModelInterpreter.groovy:442)
at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(ModelInterpreter.groovy:254)
at ___cps.transform___(Native Method)
at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:86)
at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:113)
at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:83)
at sun.reflect.GeneratedMethodAccessor178.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.dispatch(CollectionLiteralBlock.java:55)
at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.item(CollectionLiteralBlock.java:45)
at sun.reflect.GeneratedMethodAccessor190.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
at com.cloudbees.groovy.cps.Next.step(Next.java:83)
at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174)
at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)
at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:129)
at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:268)
at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:51)
at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:185)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:400)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$400(CpsThreadGroup.java:96)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:312)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:276)
at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:67)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:136)
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Finished: FAILURE
I am not sure why I get "No such DSL method 'androidLint' found among steps".
I thought it's a jenkins-plugin problem, since Android Lint Plugin seems deprecated, I can't access to the link : https://plugins.jenkins.io/android-lint/
I installed the plugin : Warnings Next Generation => https://plugins.jenkins.io/warnings-ng/
that seems to contain Android Lint Plugin, and yet, I still get the error : No such DSL method 'androidLint'...
Does someone have any idea why the stage('Static analysis') fail ? Is it a missing plugin ?
Thank you.
After investigation, it seems "androidLint" is not supported by "Warnings Next Generation Plugin", and has been replaced by "androidLintParser"
the correct step with Warning Next Generation plugin is :
stage('Static analysis') {
steps {
// Run Lint and analyse the results
sh './gradlew lintDebug'
androidLintParser pattern: '**/lint-results-*.xml'
}
}

error while running `detox build -c android.emu.debug` Task :app:compileDebugJavaWithJavac FAILED in react native

While following the Detox [installation tutorial for android][1], I had the following error running the detox build -c android.emu.debug
❯ detox build -c android.emu.debug detox[23052] INFO: [build.js] cd android && ./gradlew assembleDebug assembleAndroidTest
-DtestBuildType=debug && cd ..
Task :app:generatePackageList
Task :app:preBuild
Task :react-native-gesture-handler:preBuild UP-TO-DATE
Task :react-native-gesture-handler:preDebugBuild UP-TO-DATE
Task :react-native-gesture-handler:checkDebugManifest UP-TO-DATE
Task :react-native-gesture-handler:processDebugManifest UP-TO-DATE
Task :react-native-reanimated:preBuild UP-TO-DATE
Task :react-native-reanimated:preDebugBuild UP-TO-DATE
Task :react-native-reanimated:checkDebugManifest UP-TO-DATE
Task :react-native-reanimated:processDebugManifest UP-TO-DATE
Task :react-native-screens:preBuild UP-TO-DATE
Task :react-native-screens:preDebugBuild UP-TO-DATE
Task :react-native-screens:checkDebugManifest UP-TO-DATE
Task :react-native-screens:processDebugManifest UP-TO-DATE
Task :react-native-vector-icons:preBuild UP-TO-DATE
Task :react-native-vector-icons:preDebugBuild UP-TO-DATE
Task :react-native-vector-icons:checkDebugManifest UP-TO-DATE
Task :react-native-vector-icons:processDebugManifest UP-TO-DATE
Task :react-native-webview:preBuild UP-TO-DATE
Task :react-native-webview:preDebugBuild UP-TO-DATE
Task :react-native-webview:checkDebugManifest UP-TO-DATE
Task :react-native-webview:processDebugManifest UP-TO-DATE
Task :app:preDebugBuild UP-TO-DATE
Task :react-native-screens:compileDebugAidl NO-SOURCE
Task :react-native-vector-icons:compileDebugAidl NO-SOURCE
Task :react-native-gesture-handler:compileDebugAidl NO-SOURCE
Task :react-native-reanimated:compileDebugAidl NO-SOURCE
Task :react-native-webview:compileDebugAidl NO-SOURCE
Task :app:compileDebugAidl NO-SOURCE
Task :react-native-gesture-handler:packageDebugRenderscript NO-SOURCE
Task :react-native-reanimated:packageDebugRenderscript NO-SOURCE
Task :react-native-screens:packageDebugRenderscript NO-SOURCE
Task :react-native-vector-icons:packageDebugRenderscript NO-SOURCE
Task :react-native-webview:packageDebugRenderscript NO-SOURCE
Task :app:compileDebugRenderscript NO-SOURCE
Task :app:checkDebugManifest UP-TO-DATE
Task :app:generateDebugBuildConfig UP-TO-DATE
Task :app:bundleDebugJsAndAssets SKIPPED
Task :app:prepareLintJar UP-TO-DATE
Task :app:generateDebugSources UP-TO-DATE
Task :react-native-gesture-handler:generateDebugBuildConfig UP-TO-DATE
Task :react-native-gesture-handler:compileDebugRenderscript NO-SOURCE
Task :react-native-gesture-handler:generateDebugResValues UP-TO-DATE
Task :react-native-gesture-handler:generateDebugResources UP-TO-DATE
Task :react-native-gesture-handler:prepareLintJar UP-TO-DATE
Task :react-native-gesture-handler:generateDebugSources UP-TO-DATE
Task :react-native-gesture-handler:javaPreCompileDebug UP-TO-DATE
Task :react-native-gesture-handler:packageDebugResources UP-TO-DATE
Task :react-native-gesture-handler:generateDebugRFile UP-TO-DATE
> Task :react-native-gesture-handler:compileDebugJavaWithJavac FAILED
/home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootViewManager.java:4:
error: package com.facebook.react.module.annotations does not exist
import com.facebook.react.module.annotations.ReactModule;
^ /home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootViewManager.java:17:
error: cannot find symbol #ReactModule(name =
RNGestureHandlerRootViewManager.REACT_CLASS) ^ symbol: class
ReactModule
/home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:16:
error: package com.facebook.react.module.annotations does not exist
import com.facebook.react.module.annotations.ReactModule;
^ /home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:19:
error: cannot find symbol import com.facebook.react.uimanager.UIBlock;
^ symbol: class UIBlock location: package com.facebook.react.uimanager
/home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:40:
error: cannot find symbol
#ReactModule(name=RNGestureHandlerModule.MODULE_NAME) ^ symbol:
class ReactModule
/home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.java:218:
error: cannot find symbol #ReactProp(name = ViewProps.BORDER_RADIUS)
^ symbol: variable BORDER_RADIUS location: class ViewProps
/home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.java:41:
error: method init in class Event cannot be applied to given types;
super.init(handler.getView().getId());
^ required: int,long found: int reason: actual and formal argument lists differ in length where T is a type-variable:
T extends Event declared in class Event /home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNViewConfigurationHelper.java:45:
error: cannot find symbol
return parent.getChildAt(((ReactViewGroup) parent).getZIndexMappedChildIndex(index));
^ symbol: method getZIndexMappedChildIndex(int) location: class ReactViewGroup
/home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNViewConfigurationHelper.java:54:
error: cannot find symbol
String overflow = ((ReactViewGroup) view).getOverflow();
^ symbol: method getOverflow() location: class ReactViewGroup
/home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:574:
error: cannot find symbol
final int rootViewTag = uiManager.resolveRootTagFromReactTag(ancestorViewTag);
^ symbol: method resolveRootTagFromReactTag(int) location: variable uiManager of type
UIManagerModule
/home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:582:
error: cannot find symbol
if (root.getRootView().getRootViewTag() == rootViewTag) {
^ symbol: method getRootViewTag() location: class ReactRootView
/home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:598:
error: cannot find symbol
uiManager.addUIBlock(new UIBlock() {
^ symbol: class UIBlock location: class RNGestureHandlerModule
/home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:634:
error: cannot find symbol
int rootViewTag = uiManager.resolveRootTagFromReactTag(viewTag);
^ symbol: method resolveRootTagFromReactTag(int) location: variable uiManager of type
UIManagerModule
/home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:641:
error: cannot find symbol
if (root.getRootView().getRootViewTag() == rootViewTag) {
^ symbol: method getRootViewTag() location: class ReactRootView
/home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerPackage.java:18:
error: RNGestureHandlerPackage is not abstract and does not override
abstract method createJSModules() in ReactPackage public class
RNGestureHandlerPackage implements ReactPackage {
^ /home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.java:45:
error: method init in class Event cannot be applied to given types;
super.init(handler.getView().getId());
^ required: int,long found: int reason: actual and formal argument lists differ in length where T is a type-variable:
T extends Event declared in class Event Note: /home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.java
uses or overrides a deprecated API. Note: Recompile with
-Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for
details. 16 errors
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':react-native-gesture-handler:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
Try: 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.
Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it
incompatible with Gradle 6.0. Use '--warning-mode all' to show the
individual deprecation warnings. See
https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 5s 22 actionable tasks: 2 executed, 20 up-to-date
detox[23052] ERROR: [cli.js] Error: Command failed: cd android &&
./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug &&
cd ..
"react": "16.8.6",
"react-native": "0.60.5",
"detox": "^14.3.2",
"mocha": "^6.2.0",
Does anyone know how to solve ?
I solved it by changing the order of the maven repositories in android/build.gradle. My allprojects looks like this:
allprojects {
repositories {
mavenLocal()
google()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
maven {
// All of Detox' artifacts are provided via the npm module
url "$rootDir/../node_modules/detox/Detox-android"
}
maven { url 'https://www.jitpack.io' }
}
}
Thanks to gypsicoder
https://github.com/software-mansion/react-native-gesture-handler/issues/1002

cant compile app on phone gap - new error with depriciation

I get the below errors in phonegap build. this is even when building an old version of the app that used to work. not understanding the error, any help??
Build Date: 2018-05-25 16:11:42 +0000
PLUGIN OUTPUT
Fetching plugin "cordova-plugin-inappbrowser" via npm
Installing "cordova-plugin-inappbrowser" at "3.0.0" for android
Fetching plugin "onesignal-cordova-plugin#^2.3.1" via npm
Installing "onesignal-cordova-plugin" at "2.4.1" for android
Subproject Path: CordovaLib
Fetching plugin "cordova-plugin-whitelist" via npm
Installing "cordova-plugin-whitelist" at "1.3.3" for android
This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do not need this plugin since the whitelist will be built in.
Fetching plugin "cordova-plugin-geolocation#^2.4.1" via npm
Installing "cordova-plugin-geolocation" at "2.4.3" for android
Fetching plugin "cordova-plugin-compat#^1.0.0" via npm
Installing "cordova-plugin-compat" at "1.2.0" for android
COMPILE OUTPUT
:wrapper
BUILD SUCCESSFUL in 2s
1 actionable task: 1 executed
Subproject Path: CordovaLib
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_3icce6xsgr7rsvstratajpe9b.run(/project/build.gradle:138)
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
Incremental java compilation is an incubating feature.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
:preBuild UP-TO-DATE
:preReleaseBuild UP-TO-DATE
:checkReleaseManifest
:preDebugBuild UP-TO-DATE
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:compileLint
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugShaders
:CordovaLib:compileDebugShaders
:CordovaLib:generateDebugAssets
:CordovaLib:mergeDebugAssets
:CordovaLib:mergeDebugProguardFiles
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:compileDebugRenderscript
:CordovaLib:generateDebugResValues
:CordovaLib:generateDebugResources
:CordovaLib:packageDebugResources
:CordovaLib:processDebugManifest
:CordovaLib:generateDebugBuildConfig
:CordovaLib:processDebugResources
:CordovaLib:generateDebugSources
:CordovaLib:incrementalDebugJavaCompilationSafeguard
:CordovaLib:compileDebugJavaWithJavac
:CordovaLib:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForDebug
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug
:CordovaLib:mergeDebugJniLibFolders
:CordovaLib:transformNative_libsWithMergeJniLibsForDebug
:CordovaLib:transformNative_libsWithSyncJniLibsForDebug
:CordovaLib:bundleDebug
:CordovaLib:preReleaseBuild UP-TO-DATE
:CordovaLib:checkReleaseManifest
:CordovaLib:prepareReleaseDependencies
:CordovaLib:compileReleaseAidl
:CordovaLib:compileReleaseNdk UP-TO-DATE
:CordovaLib:copyReleaseLint UP-TO-DATE
:CordovaLib:mergeReleaseShaders
:CordovaLib:compileReleaseShaders
:CordovaLib:generateReleaseAssets
:CordovaLib:mergeReleaseAssets
:CordovaLib:mergeReleaseProguardFiles
:CordovaLib:packageReleaseRenderscript UP-TO-DATE
:CordovaLib:compileReleaseRenderscript
:CordovaLib:generateReleaseResValues
:CordovaLib:generateReleaseResources
:CordovaLib:packageReleaseResources
:CordovaLib:processReleaseManifest
:CordovaLib:generateReleaseBuildConfig
:CordovaLib:processReleaseResources
:CordovaLib:generateReleaseSources
:CordovaLib:incrementalReleaseJavaCompilationSafeguard
:CordovaLib:compileReleaseJavaWithJavac
:CordovaLib:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:CordovaLib:processReleaseJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForRelease
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForRelease
:CordovaLib:mergeReleaseJniLibFolders
:CordovaLib:transformNative_libsWithMergeJniLibsForRelease
:CordovaLib:transformNative_libsWithSyncJniLibsForRelease
:CordovaLib:bundleRelease
:prepareAndroidArchCoreRuntime110Library
:prepareAndroidArchLifecycleLivedataCore110Library
:prepareAndroidArchLifecycleRuntime110Library
:prepareAndroidArchLifecycleViewmodel110Library
:prepareComAndroidSupportCustomtabs2711Library
:prepareComAndroidSupportSupportCompat2711Library
:prepareComAndroidSupportSupportCoreUi2711Library
:prepareComAndroidSupportSupportCoreUtils2711Library
:prepareComAndroidSupportSupportFragment2711Library
:prepareComAndroidSupportSupportMediaCompat2711Library
:prepareComAndroidSupportSupportV42711Library
:prepareComGoogleAndroidGmsPlayServicesBase1201Library
:prepareComGoogleAndroidGmsPlayServicesBaseLicense1201Library
:prepareComGoogleAndroidGmsPlayServicesBasement1201Library
:prepareComGoogleAndroidGmsPlayServicesBasementLicense1201Library
:prepareComGoogleAndroidGmsPlayServicesLocation1201Library
:prepareComGoogleAndroidGmsPlayServicesLocationLicense1201Library
:prepareComGoogleAndroidGmsPlayServicesTasks1201Library
:prepareComGoogleAndroidGmsPlayServicesTasksLicense1201Library
:prepareComGoogleFirebaseFirebaseCommon1201Library
:prepareComGoogleFirebaseFirebaseCommonLicense1201Library
:prepareComGoogleFirebaseFirebaseIid1201Library
:prepareComGoogleFirebaseFirebaseIidLicense1201Library
:prepareComGoogleFirebaseFirebaseMessaging1201Library
:prepareComGoogleFirebaseFirebaseMessagingLicense1201Library
:prepareComOnesignalOneSignal391Library
:prepareOrgApacheCordovaCordovaLib623ReleaseLibrary
:prepareReleaseDependencies
:compileReleaseAidl
:compileReleaseRenderscript
:generateReleaseBuildConfig
:generateReleaseResValues
:generateReleaseResources
:mergeReleaseResources
:processReleaseManifest
:processReleaseResourcesERROR: In FontFamilyFont, unable to find attribute android:font
ERROR: In FontFamilyFont, unable to find attribute android:fontStyle
ERROR: In FontFamilyFont, unable to find attribute android:fontWeight
FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':processReleaseResources'.
com.android.ide.common.process.ProcessException: Failed to execute aapt
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: 2.249 secs
Error: /project/gradlew: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
ERROR: In FontFamilyFont, unable to find attribute android:font
ERROR: In FontFamilyFont, unable to find attribute android:fontStyle
ERROR: In FontFamilyFont, unable to find attribute android:fontWeight
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':processReleaseResources'.
com.android.ide.common.process.ProcessException: Failed to execute aapt
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
at ChildProcess.whenDone (/project/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
In your platforms/android folder that contains the build.gradle file, create another file called build-extras.gradle and put the following inside of it:
configurations.all {
resolutionStrategy {
force 'com.android.support:support-v4:27.1.0'
}
}
I had the same issue and this fixed it for me. I also had to update AndroidManifest.xml to point to the correct icon folder because it changed that config variable to the mipmap folders instead of the drawable folders.
Set your compileSdkVersion to 23 in your module's build.gradle file and see

Build failed with message “processF0F1DebugResources FAILED”

I'm trying to build this template for android, which I haven't modified yet. But the build fails with this message:
Searching for devices...
Executing before-liveSync hook from C:\repos\rolagroup-frontend\hooks\before-liveSync\nativescript-angular-sync.js
Skipping prepare.
Building project...
> Configuring > 0/3 projects > root project
:config phase: createDefaultIncludeFiles
+found plugins: nativescript-social-login
+found plugins: tns-core-modules-widgets
:config phase: createPluginsConfigFile
Creating product flavors include.gradle file in C:\repos\rolagroup-frontend\platforms\android/configurations folder...
:config phase: pluginExtend
+applying configuration from: C:\repos\rolagroup-frontend\platforms\android\configurations\include.gradle
+applying configuration from: C:\repos\rolagroup-frontend\platforms\android\configurations\nativescript-social-login\include.gradle
+applying configuration from: C:\repos\rolagroup-frontend\platforms\android\configurations\tns-core-modules-widgets\include.gradle
> Configuring > 0/3 projects > root project
:config phase: addAarDependencies
+adding dependency: C:\repos\rolagroup-frontend\platforms\android\libs\aar\widgets-release.aar
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
Incremental java compilation is an incubating feature.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_cogdyo42bssvgewop3zivk6w6.run(C:\repos\rolagroup-frontend\platforms\android\build-tools\android-static-binding-generator\build.gradle:126)
:preBuild UP-TO-DATE
:preF0F1DebugBuild UP-TO-DATE
:checkF0F1DebugManifest
:preF0F1ReleaseBuild UP-TO-DATE
:prepareComAndroidSupportAnimatedVectorDrawable2531Library UP-TO-DATE
:prepareComAndroidSupportAppcompatV72531Library UP-TO-DATE
:prepareComAndroidSupportDesign2531Library UP-TO-DATE
:prepareComAndroidSupportRecyclerviewV72531Library UP-TO-DATE
:prepareComAndroidSupportSupportCompat2531Library UP-TO-DATE
:prepareComAndroidSupportSupportCoreUi2531Library UP-TO-DATE
:prepareComAndroidSupportSupportCoreUtils2531Library UP-TO-DATE
:prepareComAndroidSupportSupportFragment2531Library UP-TO-DATE
:prepareComAndroidSupportSupportMediaCompat2531Library UP-TO-DATE
:prepareComAndroidSupportSupportV42531Library UP-TO-DATE
:prepareComAndroidSupportSupportVectorDrawable2531Library UP-TO-DATE
:prepareComAndroidSupportTransition2531Library UP-TO-DATE
:prepareComDigitsSdkAndroidDigits1103Library UP-TO-DATE
:prepareComFacebookAndroidFacebookAndroidSdk460Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesAuth840Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesBase840Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesBasement840Library UP-TO-DATE
:prepareComTwitterSdkAndroidTweetComposer104Library UP-TO-DATE
:prepareComTwitterSdkAndroidTweetUi1102Library UP-TO-DATE
:prepareComTwitterSdkAndroidTwitter1132Library UP-TO-DATE
:prepareComTwitterSdkAndroidTwitterCore167Library UP-TO-DATE
:prepareIoFabricSdkAndroidFabric1311Library UP-TO-DATE
:prepareRolagroupfrontendRuntimeUnspecifiedLibrary UP-TO-DATE
:prepareWidgetsReleaseLibrary UP-TO-DATE
:prepareF0F1DebugDependencies
:compileF0F1DebugAidl UP-TO-DATE
:compileF0F1DebugRenderscript UP-TO-DATE
:generateF0F1DebugBuildConfig UP-TO-DATE
:cleanLocalAarFiles
:ensureMetadataOutDir
:collectAllJars
:setProperties
:generateTypescriptDefinitions SKIPPED
:copyTypings SKIPPED
:asbg:generateInterfaceNamesList
:asbg:traverseJsFiles
:asbg:runAstParser
Running full build
finished with reading lines with js files
:asbg:generateBindings
:generateF0F1DebugResValues UP-TO-DATE
:generateF0F1DebugResources UP-TO-DATE
:mergeF0F1DebugResources UP-TO-DATE
:processF0F1DebugManifest UP-TO-DATE
:processF0F1DebugResources
C:\repos\rolagroup-frontend\platforms\android\build\intermediates\manifests\full\F0F1\debug\AndroidManifest.xml:17:24-47: AAPT: No resource found that matches the given name (at 'value' with value '#string/facebook_app_id').
C:\repos\rolagroup-frontend\platforms\android\build\intermediates\manifests\full\F0F1\debug\AndroidManifest.xml:22:24-40: AAPT: No resource found that matches the given name (at 'label' with value '#string/app_name').
C:\repos\rolagroup-frontend\platforms\android\build\intermediates\manifests\full\F0F1\debug\AndroidManifest.xml:42:24-40: AAPT: No resource found that matches the given name (at 'label' with value '#string/app_name').
C:\repos\rolagroup-frontend\platforms\android\build\intermediates\manifests\full\F0F1\debug\AndroidManifest.xml:47:28-57: AAPT: No resource found that matches the given name (at 'label' with value '#string/title_activity_kimera').
C:\repos\rolagroup-frontend\platforms\android\build\intermediates\manifests\full\F0F1\debug\AndroidManifest.xml:15: error: Error: No resource found that matches the given name (at 'value' with value '#string/facebook_app_id').
C:\repos\rolagroup-frontend\platforms\android\build\intermediates\manifests\full\F0F1\debug\AndroidManifest.xml:19: error: Error: No resource found that matches the given name (at 'label' with value '#string/app_name').
C:\repos\rolagroup-frontend\platforms\android\build\intermediates\manifests\full\F0F1\debug\AndroidManifest.xml:38: error: Error: No resource found that matches the given name (at 'label' with value '#string/app_name').
C:\repos\rolagroup-frontend\platforms\android\build\intermediates\manifests\full\F0F1\debug\AndroidManifest.xml:44: error: Error: No resource found that matches the given name (at 'label' with value '#string/title_activity_kimera').
:processF0F1DebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processF0F1DebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
* 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: 15.17 secs
Unable to apply changes on device: 192.168.1.5:5555. Error is: Command gradlew.bat failed with exit code 1.
Executing after-watch hook from C:\repos\rolagroup-frontend\hooks\after-watch\nativescript-dev-typescript.js
This is my packages.json:
{
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"readme": "NativeScript Application",
"repository": "<fill-your-repository-here>",
"nativescript": {
"id": "org.nativescript.rolagroupfrontend",
"tns-android": {
"version": "3.1.1"
}
},
"scripts": {
"lint": "tslint \"app/**/*.ts\""
},
"dependencies": {
"#angular/animations": "4.2.5",
"#angular/common": "4.2.5",
"#angular/compiler": "4.2.5",
"#angular/core": "4.2.5",
"#angular/forms": "4.2.5",
"#angular/http": "4.2.5",
"#angular/platform-browser": "4.2.5",
"#angular/router": "4.2.5",
"nativescript-angular": "4.2.0",
"nativescript-gradient": "^2.0.1",
"nativescript-localize": "^2.0.1",
"nativescript-social-login": "^1.6.0",
"nativescript-theme-core": "1.0.4",
"reflect-metadata": "0.1.10",
"rxjs": "5.4.3",
"tns-core-modules": "3.1.1",
"validator": "^8.1.0",
"zone.js": "0.8.16"
},
"devDependencies": {
"babel-traverse": "6.4.5",
"babel-types": "6.4.5",
"babylon": "6.4.5",
"codelyzer": "3.1.2",
"lazy": "1.0.11",
"nativescript-dev-sass": "1.3.0",
"nativescript-dev-typescript": "0.5.0",
"node-sass": "4.5.3",
"tslint": "5.6.0",
"typescript": "2.4.2"
}
}
Tried removing and then adding again tns platform android, also reinstalling the npm packages; but no luck.
I have SDK Build Tools and SDK Platform 23 and 25 installed. I'm running NativeScript 3.1.3, tns-core-modules 3.1.1 and tns-android 3.1.1 on Windows 10 x64. Any ideas?
UPDATE: Also tried adding those values manually to strings.xml, but that file just gets regenerated in every tns run.
Solved the app_id and title_activity_kimera by addind app.name to the NativeScript-localize json (yes, I should really read the docs).
Had to remove the social login plugin since it requires the facebook_app_id string added manually to strings.xml and this file its generated by the localization plugin.

dexDebugTest fails with DexException "Cannot merge new index" for test

I'm building an android project with gradle that leverages Google Espresso (much thanks to Jake Wharton's double espresso). With my build.gradle configuration I can successfully build debug and release versions using proguard to optimize my method counts (to get below the 65k limit), but when I run connectedAndroidTest my build fails with:
...
:src:MyApp:proguardDebug UP-TO-DATE
:src:MyApp:proguardDebugTest UP-TO-DATE
:src:MyApp:dexDebugTest UP-TO-DATE
:src:MyAppLibrary:prepareDebugTestDependencies
:src:MyAppLibrary:compileDebugTestAidl UP-TO-DATE
:src:MyAppLibrary:copyDebugLint UP-TO-DATE
:src:MyAppLibrary:mergeDebugProguardFiles UP-TO-DATE
:src:MyAppLibrary:checkDebugManifest
:src:MyAppLibrary:prepareDebugDependencies
:src:MyAppLibrary:compileDebugAidl UP-TO-DATE
:src:MyAppLibrary:compileDebugRenderscript UP-TO-DATE
:src:MyAppLibrary:generateDebugBuildConfig UP-TO-DATE
:src:MyAppLibrary:generateDebugAssets UP-TO-DATE
:src:MyAppLibrary:mergeDebugAssets UP-TO-DATE
:src:MyAppLibrary:generateDebugResValues UP-TO-DATE
:src:MyAppLibrary:generateDebugResources UP-TO-DATE
:src:MyAppLibrary:mergeDebugResources UP-TO-DATE
:src:MyAppLibrary:processDebugManifest UP-TO-DATE
:src:MyAppLibrary:processDebugResources UP-TO-DATE
:src:MyAppLibrary:generateDebugSources UP-TO-DATE
:src:MyAppLibrary:compileDebugJava UP-TO-DATE
:src:MyAppLibrary:processDebugJavaRes UP-TO-DATE
:src:MyAppLibrary:packageDebugJar UP-TO-DATE
:src:MyAppLibrary:compileDebugNdk UP-TO-DATE
:src:MyAppLibrary:packageDebugJniLibs UP-TO-DATE
:src:MyAppLibrary:packageDebugLocalJar UP-TO-DATE
:src:MyAppLibrary:packageDebugRenderscript UP-TO-DATE
:src:MyAppLibrary:packageDebugResources UP-TO-DATE
:src:MyAppLibrary:bundleDebug
:src:MyAppLibrary:assembleDebug
:src:MyAppLibrary:processDebugTestManifest UP-TO-DATE
:src:MyAppLibrary:compileDebugTestRenderscript UP-TO-DATE
:src:MyAppLibrary:generateDebugTestBuildConfig UP-TO-DATE
:src:MyAppLibrary:generateDebugTestAssets UP-TO-DATE
:src:MyAppLibrary:mergeDebugTestAssets UP-TO-DATE
:src:MyAppLibrary:generateDebugTestResValues UP-TO-DATE
:src:MyAppLibrary:generateDebugTestResources UP-TO-DATE
:src:MyAppLibrary:mergeDebugTestResources UP-TO-DATE
:src:MyAppLibrary:processDebugTestResources UP-TO-DATE
:src:MyAppLibrary:generateDebugTestSources UP-TO-DATE
:src:MyAppLibrary:compileDebugTestJava UP-TO-DATE
:src:MyAppLibrary:preDexDebugTest UP-TO-DATE
:src:MyAppLibrary:dexDebugTest
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Cannot merge new index 65623 into a non-jumbo instruction!
at com.android.dx.merge.InstructionTransformer.jumboCheck(InstructionTransformer.java:108)
at com.android.dx.merge.InstructionTransformer.access$800(InstructionTransformer.java:25)
at com.android.dx.merge.InstructionTransformer$StringVisitor.visit(InstructionTransformer.java:71)
at com.android.dx.io.CodeReader.callVisit(CodeReader.java:114)
at com.android.dx.io.CodeReader.visitAll(CodeReader.java:89)
at com.android.dx.merge.InstructionTransformer.transform(InstructionTransformer.java:48)
at com.android.dx.merge.DexMerger.transformCode(DexMerger.java:840)
at com.android.dx.merge.DexMerger.transformMethods(DexMerger.java:811)
at com.android.dx.merge.DexMerger.transformClassData(DexMerger.java:784)
at com.android.dx.merge.DexMerger.transformClassDef(DexMerger.java:680)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:540)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:170)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:439)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:287)
at com.android.dx.command.dexer.Main.run(Main.java:230)
at com.android.dx.command.dexer.Main.main(Main.java:199)
at com.android.dx.command.Main.main(Main.java:103)
:src:MyAppLibrary:dexDebugTest FAILED
My app is called MyApp and it has a dependency project called MyAppLibrary. Before switching to espresso I didn't hit the 65k limit when running connectedAndroidTest. I used robotium before and I've since removed those dependencies. Also, I don't hit the limit when I just build a debug or release build. Is there a way to optimize my test build like I am optimizing my debug build?
The odd thing to me is that I only have tests in MyApp, I don't have any test classes in MyAppLibrary. In fact, when I run connectedAndroidTest, I can actually see my tests running on my device and passing before it gets to MyAppLibrary:dexDebugTest. So any idea why it would fail there after running my tests?
Alternatively, would it be possible to somehow bypass calling the connectedAndroidTest dependency chain for MyAppLibrary?
Thanks!
In the build.gradle You need to specify:
android {
dexOptions {
jumboMode true
}
}

Categories

Resources