cordova-plugin-firebase: Can't build on android anymore

I was developing my application normally. I was able to build it 10 times today successfully. However, I was compile again and now I can no longer run when the firebase plugin is in the project.

If I remove the plugin the project run.

Im using android@7.1.4 (can’t update to 8.0.0)

The following build error occurs:

:app:processDebugResources/home/sandro/.gradle/caches/transforms-1/files-1.1/appcompat-v7-26.1.0.aar/c9104c96e21bf9c9613f4661f4e5d49e/res/values/values.xml:246:5-69: AAPT: error: resource android:attr/fontVariationSettings not found.
    
/home/sandro/.gradle/caches/transforms-1/files-1.1/appcompat-v7-26.1.0.aar/c9104c96e21bf9c9613f4661f4e5d49e/res/values/values.xml:246:5-69: AAPT: error: resource android:attr/ttcIndex not found.
    
/home/user/my_cordova_project/platforms/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:244: error: resource android:attr/fontVariationSettings not found.
/home/user/my_cordova_project/platforms/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:244: error: resource android:attr/ttcIndex not found.
error: failed linking references.

Failed to execute aapt
com.android.ide.common.process.ProcessException: Failed to execute aapt
	at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:796)
	at com.android.build.gradle.tasks.ProcessAndroidResources.invokeAaptForSplit(ProcessAndroidResources.java:551)
	at com.android.build.gradle.tasks.ProcessAndroidResources.doFullTaskAction(ProcessAndroidResources.java:285)
	at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:109)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.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$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:111)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
	at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:63)
	at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
	at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
	at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
	at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
	at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
	at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
	at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
	at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:124)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:80)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:105)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:99)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:625)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:580)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:99)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.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$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
	at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:503)
	at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:482)
	at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(AbstractFuture.java:79)
	at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:794)
	... 48 more
Caused by: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
	at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:503)
	at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:462)
	at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(AbstractFuture.java:79)
	at com.android.builder.internal.aapt.v2.QueueableAapt2.lambda$makeValidatedPackage$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 details
	at com.android.builder.png.AaptProcess$NotifierProcessOutput.handleOutput(AaptProcess.java:463)
	at com.android.builder.png.AaptProcess$NotifierProcessOutput.err(AaptProcess.java:415)
	at com.android.builder.png.AaptProcess$ProcessOutputFacade.err(AaptProcess.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'.

Anyone else having the same problem? Thanks.

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 23
  • Comments: 59 (1 by maintainers)

Commits related to this issue

Most upvoted comments

Solution I’ve taken from this comment https://github.com/arnesson/cordova-plugin-firebase/issues/1081#issuecomment-503041641

  1. put build-extras.gradle in your project root
def dependencyMap = [
        "com.google.firebase:firebase-core": "16.0.8",
        "com.google.firebase:firebase-iid": "17.1.1",
        "com.google.firebase:firebase-messaging": "17.5.0",
        "com.google.firebase:firebase-config": "16.4.0",
        "com.google.firebase:firebase-perf": "16.2.4",
        "com.google.android.gms:play-services-tagmanager": "16.0.8",
        "com.google.firebase:firebase-auth": "16.2.0"
]

allprojects {
    repositories {
            google()
            jcenter()
            mavenLocal()
    }

    configurations.all {

        resolutionStrategy {

            eachDependency { DependencyResolveDetails details ->
                def group = details.requested.group
                def name = details.requested.name
                def fullName =  group + ":" + name
                print fullName
                if (dependencyMap.containsKey(fullName)) {
                    details.useVersion dependencyMap[fullName]
                }
            }
        }
    }

}
  1. put this hook code in your scripts/copy_build_extra.js
#!/usr/bin/env node

const fs = require('fs')
fs.copyFileSync("./build-extras.gradle", "./platforms/android/build-extras.gradle");
  1. configure hook in config.xml inside android platform
<platform name="android">
  <hook src="scripts/copy_build_extra.js" type="after_prepare" />
</platform>
  1. reinstall platform to activate the hook
cordova platform rm android
cordova platform add android

worked for me, hope will do for you too

I have fixed these issue using two plugins

ionic cordova plugin add cordova-plugin-androidx
ionic cordova plugin add cordova-plugin-androidx-adapter

have been fighting the same issue for three days already

it works good with :

ionic cordova plugin add cordova-plugin-androidx ionic cordova plugin add cordova-plugin-androidx-adapter

cordova-plugin-firebase -> src -> android - > build.gradle change line no 20 com.google.firebase:firebase-auth:+ to com.google.firebase:firebase-auth:16.2.1

This morning I’m already sweating as I saw the gradle downloading new maven files and to my expectations it all went boom!

@SandroMoretti True is that @igorkurochka fixed the issue but this is more of a workaround and not a solution. The versions of the plugin’s dependencies should be defined by the plugin and not the cordova app. This fix may become unreliable, should the dependencies of the plugin change.

I suggest reopening this issue.

Same problem here. I’ve tried to update all dependencies with requirements at https://firebase.google.com/support/release-notes/android#20180523, and cordova android to 8.0.0, but with no success. When I remove cordova-plugin-firebase, it works. Here the error I get:

Dependency failing: com.google.android.gms:play-services-tagmanager-api:15.0.2 -> com.google.android.gms:play-services-m
  easurement-base@[15.0.2], but play-services-measurement-base version was 15.0.4.

  The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art
  ifact with the issue.
  -- Project 'app' depends onto com.google.android.gms:play-services-tagmanager@15.0.2
  -- Project 'app' depends onto com.google.firebase:firebase-analytics-impl@15.0.2
  -- Project 'app' depends onto com.google.android.gms:play-services-analytics-impl@15.0.2
  -- Project 'app' depends onto com.google.android.gms:play-services-tagmanager@17.0.0
  -- Project 'app' depends onto com.google.android.gms:play-services-measurement-base@15.0.4
  -- Project 'app' depends onto com.google.android.gms:play-services-tagmanager-api@15.0.2

So can’t build with firebase.

@SandroMoretti did you find any solution? I’m facing this issue firebase/FirebasePluginMessagingService.java:11: error: cannot find symbol import android.support.v4.app.NotificationCompat;

about the size, idk what was the size before, but it seems to work.

cocoapod must be for “swift” it has been installed in my linux too, will investigate why

Thank you @igorkurochka , really work again.

PS: I’m using cordova 6.5 and Android 7.1.4, so don’t need to update to android 8 like dann told.

this is the best solution, with less “hacks” to do: https://github.com/arnesson/cordova-plugin-firebase/issues/1081#issuecomment-503135862 (requires cordova-android@8)

Same here. I think It’s because the plugin depends on com.google.firebase:firebase-auth:+ which just updated:

https://developers.google.com/android/guides/releases

Dropped support for API <28