arnesson / cordova-plugin-firebase

Cordova plugin for Google Firebase
http://arnesson.github.io/cordova-plugin-firebase
MIT License
1.01k stars 1.56k forks source link

Build Error: Failed to execute aapt #1084

Open brucomis opened 5 years ago

brucomis commented 5 years ago

Hi there! I'm getting this error when I use the plugin via cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue

`cordova-android-support-gradle-release: Android platform: V7+ cordova-android-support-gradle-release: Wrote custom version '27.+' to /home/aurumque/Cordova/luiscoba/platforms/android/app/build.gradle cordova-android-support-gradle-release: Wrote custom version '27.+' to /home/aurumque/Cordova/luiscoba/platforms/android/cordova-android-support-gradle-release/luiscoba-cordova-android-support-gradle-release.gradle Android Studio project detected cordova-android-support-gradle-release: Android platform: V7+ cordova-android-support-gradle-release: Wrote custom version '27.+' to /home/aurumque/Cordova/luiscoba/platforms/android/app/build.gradle cordova-android-support-gradle-release: Wrote custom version '27.+' to /home/aurumque/Cordova/luiscoba/platforms/android/cordova-android-support-gradle-release/luiscoba-cordova-android-support-gradle-release.gradle Preparing Firebase on Android ANDROID_HOME=/opt/android-sdk/ JAVA_HOME=/usr/lib/jvm/java-8-openjdk studio Subproject Path: CordovaLib Subproject Path: app publishNonDefault is deprecated and has no effect anymore. All variants are now published. Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead. +----------------------------------------------------------------- | cordova-android-support-gradle-release: 27.+ +----------------------------------------------------------------- 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_16h44ethchy300tz3gs66tp8t.run(/home/aurumque/Cordova/luiscoba/platforms/android/app/build.gradle:151) registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection) registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection) :CordovaLib:preBuild UP-TO-DATE :CordovaLib:preReleaseBuild UP-TO-DATE :CordovaLib:compileReleaseAidl UP-TO-DATE :CordovaLib:compileReleaseRenderscript UP-TO-DATE :CordovaLib:checkReleaseManifest UP-TO-DATE :CordovaLib:generateReleaseBuildConfig UP-TO-DATE :CordovaLib:prepareLintJar UP-TO-DATE :CordovaLib:generateReleaseResValues UP-TO-DATE :CordovaLib:generateReleaseResources UP-TO-DATE :CordovaLib:packageReleaseResources UP-TO-DATE :CordovaLib:platformAttrExtractor UP-TO-DATE :CordovaLib:processReleaseManifest UP-TO-DATE :CordovaLib:processReleaseResources UP-TO-DATE :CordovaLib:generateReleaseSources UP-TO-DATE :CordovaLib:javaPreCompileRelease UP-TO-DATE :CordovaLib:compileReleaseJavaWithJavac UP-TO-DATE :CordovaLib:processReleaseJavaRes NO-SOURCE :CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForRelease UP-TO-DATE :app:preBuild UP-TO-DATE :app:preReleaseBuild UP-TO-DATE :app:compileReleaseAidl UP-TO-DATE :CordovaLib:packageReleaseRenderscript NO-SOURCE :app:compileReleaseRenderscript UP-TO-DATE :app:checkReleaseManifest UP-TO-DATE :app:generateReleaseBuildConfig UP-TO-DATE :app:prepareLintJar UP-TO-DATE :CordovaLib:mergeReleaseShaders UP-TO-DATE :CordovaLib:compileReleaseShaders UP-TO-DATE :CordovaLib:generateReleaseAssets UP-TO-DATE :CordovaLib:mergeReleaseAssets UP-TO-DATE :app:mergeReleaseShaders UP-TO-DATE :app:compileReleaseShaders UP-TO-DATE :app:generateReleaseAssets UP-TO-DATE :app:mergeReleaseAssets UP-TO-DATE :app:processReleaseGoogleServices Parsing json file: /home/aurumque/Cordova/luiscoba/platforms/android/app/google-services.json :app:createReleaseCompatibleScreenManifests UP-TO-DATE :app:processReleaseManifest UP-TO-DATE :app:fabricGenerateResourcesRelease :app:generateReleaseResValues UP-TO-DATE :app:generateReleaseResources UP-TO-DATE :app:mergeReleaseResources :app:splitsDiscoveryTaskRelease UP-TO-DATE :app:processReleaseResources/home/aurumque/.gradle/caches/transforms-1/files-1.1/customtabs-27.1.1.aar/66d15b7c1890e969f944ae6c7dea5271/res/values/values.xml: AAPT: error: resource android:attr/fontVariationSettings not found.

/home/aurumque/.gradle/caches/transforms-1/files-1.1/customtabs-27.1.1.aar/66d15b7c1890e969f944ae6c7dea5271/res/values/values.xml: AAPT: error: resource android:attr/ttcIndex not found.

/home/aurumque/Cordova/luiscoba/platforms/android/app/build/intermediates/incremental/mergeReleaseResources/merged.dir/values/values.xml:103: error: resource android:attr/fontVariationSettings not found. /home/aurumque/Cordova/luiscoba/platforms/android/app/build/intermediates/incremental/mergeReleaseResources/merged.dir/values/values.xml:103: 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 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 org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55) 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) ... 41 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) 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.

BUILD FAILED in 0s FAILED 33 actionable tasks: 4 executed, 29 up-to-date /home/aurumque/Cordova/luiscoba/platforms/android/gradlew: Command failed with exit code 1 Error output: /home/aurumque/.gradle/caches/transforms-1/files-1.1/customtabs-27.1.1.aar/66d15b7c1890e969f944ae6c7dea5271/res/values/values.xml: AAPT: error: resource android:attr/fontVariationSettings not found.

/home/aurumque/.gradle/caches/transforms-1/files-1.1/customtabs-27.1.1.aar/66d15b7c1890e969f944ae6c7dea5271/res/values/values.xml: AAPT: error: resource android:attr/ttcIndex not found.

/home/aurumque/Cordova/luiscoba/platforms/android/app/build/intermediates/incremental/mergeReleaseResources/merged.dir/values/values.xml:103: error: resource android:attr/fontVariationSettings not found. /home/aurumque/Cordova/luiscoba/platforms/android/app/build/intermediates/incremental/mergeReleaseResources/merged.dir/values/values.xml:103: 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 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 org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55) 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) ... 41 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) 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.

BUILD FAILED in 0s ` I feel lost! Glad if anyone could help. Thank you

BuddyLReno commented 5 years ago

In the same boat. We've been trying to fix this for 6 hours now.

satoshionoda commented 5 years ago

Firebase team made braking changes again on June 17 update https://firebase.google.com/support/release-notes/android#update_-_june_17_2019

Presumably this caused the problem..

mavericardo commented 5 years ago

Same problem

nsksaisaravana commented 5 years ago

I am also having the same issue, last minute I couldn't build my android application, I lost my whole day to find this Cordova firebase plugin is raising the issue.

inti25 commented 5 years ago

I tried add com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true to build.gradle but new issue occur :(

error: resource android:attr/fontVariationSettings not found.

error: resource android:attr/ttcIndex not found.

aajain16 commented 5 years ago

I tried add com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true to build.gradle but new issue occur :(

error: resource android:attr/fontVariationSettings not found.

error: resource android:attr/ttcIndex not found.

getting same issue spend whole day to resolve this problem but not got any solution.

kaw7224169 commented 5 years ago

@https://github.com/arnesson/cordova-plugin-firebase/issues/1083#issuecomment-503224816

this work for me!

Jonathan-Eid commented 5 years ago

ionic cordova plugin remove cordova-plugin-firebase
ionic cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue ionic cordova plugin add cordova-plugin-android-adapter ionic cordova plugin add cordova-plugin-androidx-adapter

ionic cordova platform rm android ionic cordova platform add android@8.0.0

This has solved my issues for today, most likely because it uses an older version of the firebase plugin

tamsel12 commented 5 years ago

UnhandledPromiseRejectionWarning: Error [ERR_UNHANDLED_ERROR]: Unhandled error. (The platform “android” does not appear to be a valid cordova platform. It is missing API.js. android not supported.)

I am getting above error while running build for cordova android 8.

ChronouSphere commented 5 years ago

UnhandledPromiseRejectionWarning: Error [ERR_UNHANDLED_ERROR]: Unhandled error. (The platform “android” does not appear to be a valid cordova platform. It is missing API.js. android not supported.)

I am getting above error while running build for cordova android 8.

just run build command again

tamsel12 commented 5 years ago

No , the same error only i am getting

Unable to load PlatformApi from platform. Error: Cannot find module 'properties-parser' (node:30131) UnhandledPromiseRejectionWarning: Error [ERR_UNHANDLED_ERROR]: Unhandled error. (The platform "android" does not appear to be a valid cordova platform. It is missing API.js. android not supported.)

ChronouSphere commented 5 years ago

rsi

Works for me, thanks! but "ionic cordova plugin add cordova-plugin-android-adapter" doesn't exists this is what i've done

  1. ionic cordova platform rm android
  2. ionic cordova plugin rm cordova-plugin-firebase
  3. ionic cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue
  4. ionic cordova plugin add cordova-plugin-androidx
  5. ionic cordova plugin add cordova-plugin-androidx-adapter
  6. ionic cordova platform add android Anyway, thanks!
sagrawal31 commented 5 years ago

Give this a try https://github.com/wizpanda/cordova-plugin-firebase-lib/releases

mavericardo commented 5 years ago

I can not add the April version:

ionic cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue

ERROR: (node:1549) UnhandledPromiseRejectionWarning: CordovaError: Failed to fetch plugin https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue via registry. Probably this is either a connection problem, or plugin spec is incorrect. Check your connection and plugin name/version/URL.

mavericardo commented 5 years ago

ionic cordova plugin remove cordova-plugin-firebase ionic cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue ionic cordova plugin add cordova-plugin-android-adapter ionic cordova plugin add cordova-plugin-androidx-adapter

ionic cordova platform rm android ionic cordova platform add android@8.0.0

This has solved my issues for today, most likely because it uses an older version of the firebase plugin

Did not work with me :(

Sampath-Lokuge commented 5 years ago

@ChronouSphere Thanks a lot. It works great!

https://stackoverflow.com/a/56668983/1077309

Sampath-Lokuge commented 5 years ago

@marcosricardo Please see this: https://stackoverflow.com/a/56668983/1077309

ruisilva450 commented 5 years ago

ionic cordova plugin remove cordova-plugin-firebase ionic cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue ionic cordova plugin add cordova-plugin-android-adapter ionic cordova plugin add cordova-plugin-androidx-adapter

ionic cordova platform rm android ionic cordova platform add android@8.0.0

This has solved my issues for today, most likely because it uses an older version of the firebase plugin

Thank you! I tried @ChronouSphere steps first but I was still on android@7.1.4 and when I installed android@8 the build completed successfully 😄

herduin commented 5 years ago

ionic cordova plugin remove cordova-plugin-firebase ionic cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue ionic cordova plugin add cordova-plugin-android-adapter ionic cordova plugin add cordova-plugin-androidx-adapter ionic cordova platform rm android ionic cordova platform add android@8.0.0 This has solved my issues for today, most likely because it uses an older version of the firebase plugin

Thank you! I tried @ChronouSphere steps first but I was still on android@7.1.4 and when I installed android@8 the build completed successfully 😄

Did not work for me :(, another idea?

sagrawal31 commented 5 years ago

@herduin give this a try https://github.com/wizpanda/cordova-plugin-firebase-lib/releases

sagrawal31 commented 5 years ago

We are maintaining a fork and we have fixed this issue for both cordova-android 7.x & 8.x.

fortunatogreco commented 5 years ago

I resolved with this commands:

ionic cordova platform rm android ionic cordova plugin rm cordova-plugin-firebase npm install cordova@9 ionic cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue ionic cordova plugin add cordova-plugin-androidx ionic cordova plugin add cordova-plugin-androidx-adapter ionic cordova platform add android@8

herduin commented 5 years ago

Hi! I am trying to solve this on any way but, every intent result in a error.

BUILD FAILED in 38s

> Task :app:compileReleaseJavaWithJavac FAILED
33 actionable tasks: 33 executed
/Volumes/Datos/GIT/CCASApp/platforms/android/gradlew: Command failed with exit code 1 Error output:
Note: /Volumes/Datos/GIT/CCASApp/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemCookieManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePlugin.java:9: error: cannot find symbol
import android.support.v4.app.NotificationManagerCompat;
                             ^
  symbol:   class NotificationManagerCompat
  location: package android.support.v4.app
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePluginMessagingService.java:11: error: cannot find symbol
import android.support.v4.app.NotificationCompat;
                             ^
  symbol:   class NotificationCompat
  location: package android.support.v4.app
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/de/sitewaerts/cordova/documentviewer/FileProvider.java:3: error: package android.support.v4.content does not exist
public class FileProvider extends android.support.v4.content.FileProvider {
                                                            ^
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/de/sitewaerts/cordova/documentviewer/DocumentViewerPlugin.java:34: error: package android.support.v4.content does not exist
import android.support.v4.content.FileProvider;
                                 ^
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/com/ionicframework/cordova/webview/IonicWebViewEngine.java:11: error: package android.support.annotation does not exist
import android.support.annotation.RequiresApi;
                                 ^
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/com/ionicframework/cordova/webview/IonicWebViewEngine.java:121: error: cannot find symbol
    @RequiresApi(Build.VERSION_CODES.LOLLIPOP)
     ^
  symbol:   class RequiresApi
  location: class IonicWebViewEngine.ServerClient
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePlugin.java:358: error: cannot find symbol
                    NotificationManagerCompat notificationManagerCompat = NotificationManagerCompat.from(context);
                    ^
  symbol: class NotificationManagerCompat
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePlugin.java:358: error: cannot find symbol
                    NotificationManagerCompat notificationManagerCompat = NotificationManagerCompat.from(context);
                                                                          ^
  symbol: variable NotificationManagerCompat
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePluginMessagingService.java:144: error: package NotificationCompat does not exist
            NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this, channelId);
                              ^
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePluginMessagingService.java:144: error: package NotificationCompat does not exist
            NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this, channelId);
                                                                                   ^
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePluginMessagingService.java:153: error: cannot find symbol
                    .setPriority(NotificationCompat.PRIORITY_MAX);
                                 ^
  symbol:   variable NotificationCompat
  location: class FirebasePluginMessagingService
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePluginMessagingService.java:149: error: package NotificationCompat does not exist
                    .setStyle(new NotificationCompat.BigTextStyle().bigText(messageBody))
                                                    ^
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePluginMessagingService.java:148: error: cannot find symbol
                    .setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
                                   ^
  symbol:   variable NotificationCompat
  location: class FirebasePluginMessagingService
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/de/sitewaerts/cordova/documentviewer/DocumentViewerPlugin.java:500: error: cannot find symbol
                    Uri contentUri = FileProvider.getUriForFile(
                                                 ^
  symbol:   method getUriForFile(Context,String,File)
  location: class FileProvider
Note: Some input files use or override 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.
14 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

I resolved with this commands:

ionic cordova platform rm android ionic cordova plugin rm cordova-plugin-firebase npm install cordova@9 ionic cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue ionic cordova plugin add cordova-plugin-androidx ionic cordova plugin add cordova-plugin-androidx-adapter ionic cordova platform add android@8

tecmovilapp commented 5 years ago

The marked answer is what worked for me:

https://stackoverflow.com/questions/56654226/ionic-cordova-app-stopped-compiling-after-googles-june-17th-firebase-sdk-update

cordova-plugin-firebase-lib@3.3.0 for cordova-android < 8.0.0 cordova-plugin-firebase-lib@4.0.0 for cordova-android > 8.0.0

tom-hartz commented 5 years ago

So here is the reason it broke: https://github.com/arnesson/cordova-plugin-firebase/blob/5a3c08d4e2e9d372894d778ca8c8c3d7c3d72d0d/src/android/build.gradle#L20

Google Firebase Update - June 17, 2019 https://firebase.google.com/support/release-notes/android#version_1621

The following libraries are updated with this release:

Authentication version 18.0.0

We found a way to resolve this, and remain on target SDK version 27.

  1. hard clean: delete platforms/android

  2. ionic cordova build android (fails)

  3. update platforms/android/project.properties:

cordova.system.library.3=com.google.android.gms:play-services-tagmanager:16.0.8
cordova.system.library.4=com.google.firebase:firebase-core:16.0.8
cordova.system.library.5=com.google.firebase:firebase-messaging:17.5.0
cordova.system.library.6=com.google.firebase:firebase-config:16.4.1
cordova.system.library.7=com.google.firebase:firebase-perf:16.2.4
  1. update platforms/android/app/build.gradle (dependencies ~ln 266)
    compile "com.google.android.gms:play-services-tagmanager:16.0.8"
    compile "com.google.firebase:firebase-core:16.0.8"
    compile "com.google.firebase:firebase-messaging:17.5.0"
    compile "com.google.firebase:firebase-config:16.4.1"
    compile "com.google.firebase:firebase-perf:16.2.4"
  1. update platforms/android/cordova-plugin-firebase/cloud-build.gradle (in dependencies)
    compile 'com.google.firebase:firebase-auth:16.2.1'
  1. ionic cordova build android OR cd platforms/android ./gradlew build
junryl commented 5 years ago

So here is the reason it broke: https://github.com/arnesson/cordova-plugin-firebase/blob/5a3c08d4e2e9d372894d778ca8c8c3d7c3d72d0d/src/android/build.gradle#L20

Google Firebase Update - June 17, 2019 https://firebase.google.com/support/release-notes/android#version_1621

The following libraries are updated with this release: Authentication version 18.0.0

We found a way to resolve this, and remain on target SDK version 27.

  1. hard clean: delete platforms/android
  2. ionic cordova build android (fails)
  3. update platforms/android/project.properties:
cordova.system.library.3=com.google.android.gms:play-services-tagmanager:16.0.8
cordova.system.library.4=com.google.firebase:firebase-core:16.0.8
cordova.system.library.5=com.google.firebase:firebase-messaging:17.5.0
cordova.system.library.6=com.google.firebase:firebase-config:16.4.1
cordova.system.library.7=com.google.firebase:firebase-perf:16.2.4
  1. update platforms/android/app/build.gradle (dependencies ~ln 266)
    compile "com.google.android.gms:play-services-tagmanager:16.0.8"
    compile "com.google.firebase:firebase-core:16.0.8"
    compile "com.google.firebase:firebase-messaging:17.5.0"
    compile "com.google.firebase:firebase-config:16.4.1"
    compile "com.google.firebase:firebase-perf:16.2.4"
  1. update platforms/android/cordova-plugin-firebase/cloud-build.gradle (in dependencies)
    compile 'com.google.firebase:firebase-auth:16.2.1'
  1. ionic cordova build android OR cd platforms/android ./gradlew build

Just changing "compile 'com.google.firebase:firebase-auth:+'" to "compile 'com.google.firebase:firebase-auth:16.2.1'" works fine too. Thanks.

accerpcom commented 5 years ago

Guys thanks for working fast on this one. The build is succeeded but no APK is generated. Any ideas pls ?

accerpcom commented 5 years ago

Actually got an error

A problem occurred evaluating project ':app'.

Could not read script '/platforms/android/cordova-plugin-firebase/starter-build.gradle ' as it does not exist.

Anybody else has same error ?

accerpcom commented 5 years ago

I checked, the file actually exists , not sure why it cannot read it

shreyasgombi commented 5 years ago

Something needs to be worked on the attr/fontVariationSettings and attr/ttcIndex in values.xml. Is this related to compileSDK 28? Looks like we can't update to SDK 28 which puts other errors, but keeping 27 will search for the values in values.xml which is not there!

`Command failed with exit code 1 Error output:

/.gradle/caches/transforms-1/files-1.1/customtabs-27.1.1.aar/3dce91a2380bf657ee372a601e1fa4bb/res/values/values.xml:7:5-71: AAPT: error: resource android:attr/fontVariationSettings not found.` `/.gradle/caches/transforms-1/files-1.1/customtabs-27.1.1.aar/3dce91a2380bf657ee372a601e1fa4bb/res/values/values.xml:7:5-71: AAPT: error: resource android:attr/ttcIndex not found.` `/platforms/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:157: error: resource android:attr/fontVariationSettings not found.` `/platforms/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:157: error: resource android:attr/ttcIndex not found. error: failed linking references.`
accerpcom commented 5 years ago

My bad. I had cordova 8. Upgrading to Cordova CLI : 9.0.0 (cordova-lib@9.0.1) fixed however something is changed the way firebase is being called I think

I am doing import { Firebase } from '@ionic-native/firebase' or even import { Firebase } from 'firebase'

but it is giving error like Property 'initializeApp' does not exist on type 'typeof' firebase.initializeApp(config);

Any ideas ?

sagrawal31 commented 5 years ago

@accerpcom when you are writing import { Firebase } from 'firebase', 'firebase' is actually the official JS library of Google Firebase.

While @ionic-native/firebase is the Typescript wrapper over the JS code of this cordova plugin. So you are mixing up two things.

thameurr commented 5 years ago

So here is the reason it broke:

https://github.com/arnesson/cordova-plugin-firebase/blob/5a3c08d4e2e9d372894d778ca8c8c3d7c3d72d0d/src/android/build.gradle#L20

Google Firebase Update - June 17, 2019 https://firebase.google.com/support/release-notes/android#version_1621

The following libraries are updated with this release: Authentication version 18.0.0

We found a way to resolve this, and remain on target SDK version 27.

  1. hard clean: delete platforms/android
  2. ionic cordova build android (fails)
  3. update platforms/android/project.properties:
cordova.system.library.3=com.google.android.gms:play-services-tagmanager:16.0.8
cordova.system.library.4=com.google.firebase:firebase-core:16.0.8
cordova.system.library.5=com.google.firebase:firebase-messaging:17.5.0
cordova.system.library.6=com.google.firebase:firebase-config:16.4.1
cordova.system.library.7=com.google.firebase:firebase-perf:16.2.4
  1. update platforms/android/app/build.gradle (dependencies ~ln 266)
    compile "com.google.android.gms:play-services-tagmanager:16.0.8"
    compile "com.google.firebase:firebase-core:16.0.8"
    compile "com.google.firebase:firebase-messaging:17.5.0"
    compile "com.google.firebase:firebase-config:16.4.1"
    compile "com.google.firebase:firebase-perf:16.2.4"
  1. update platforms/android/cordova-plugin-firebase/cloud-build.gradle (in dependencies)
    compile 'com.google.firebase:firebase-auth:16.2.1'
  1. ionic cordova build android OR cd platforms/android ./gradlew build

Thank you very much bro you save my health 2 days not sleepig...

thameurr commented 5 years ago

Generating signed bundle requires you to update the android gradle plugin to version 3.2.0 or higher Problems again !!!

giumarzo commented 5 years ago

So here is the reason it broke: https://github.com/arnesson/cordova-plugin-firebase/blob/5a3c08d4e2e9d372894d778ca8c8c3d7c3d72d0d/src/android/build.gradle#L20

Google Firebase Update - June 17, 2019 https://firebase.google.com/support/release-notes/android#version_1621

The following libraries are updated with this release: Authentication version 18.0.0

We found a way to resolve this, and remain on target SDK version 27.

  1. hard clean: delete platforms/android
  2. ionic cordova build android (fails)
  3. update platforms/android/project.properties:
cordova.system.library.3=com.google.android.gms:play-services-tagmanager:16.0.8
cordova.system.library.4=com.google.firebase:firebase-core:16.0.8
cordova.system.library.5=com.google.firebase:firebase-messaging:17.5.0
cordova.system.library.6=com.google.firebase:firebase-config:16.4.1
cordova.system.library.7=com.google.firebase:firebase-perf:16.2.4
  1. update platforms/android/app/build.gradle (dependencies ~ln 266)
    compile "com.google.android.gms:play-services-tagmanager:16.0.8"
    compile "com.google.firebase:firebase-core:16.0.8"
    compile "com.google.firebase:firebase-messaging:17.5.0"
    compile "com.google.firebase:firebase-config:16.4.1"
    compile "com.google.firebase:firebase-perf:16.2.4"
  1. update platforms/android/cordova-plugin-firebase/cloud-build.gradle (in dependencies)
    compile 'com.google.firebase:firebase-auth:16.2.1'
  1. ionic cordova build android OR cd platforms/android ./gradlew build

Thank you very much !!! You saved me!

viniciusbarbosa commented 5 years ago

Give this a try https://github.com/wizpanda/cordova-plugin-firebase-lib/releases

Tks, man! work for me!

hyunggi commented 5 years ago

I have same problem....

JoseManueIbnzLora commented 5 years ago

https://github.com/arnesson/cordova-plugin-firebase/issues/1084#issuecomment-503726618 Thanks. You saved me

shreyasgombi commented 5 years ago

Hi! I am trying to solve this on any way but, every intent result in a error.

BUILD FAILED in 38s

> Task :app:compileReleaseJavaWithJavac FAILED
33 actionable tasks: 33 executed
/Volumes/Datos/GIT/CCASApp/platforms/android/gradlew: Command failed with exit code 1 Error output:
Note: /Volumes/Datos/GIT/CCASApp/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemCookieManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePlugin.java:9: error: cannot find symbol
import android.support.v4.app.NotificationManagerCompat;
                             ^
  symbol:   class NotificationManagerCompat
  location: package android.support.v4.app
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePluginMessagingService.java:11: error: cannot find symbol
import android.support.v4.app.NotificationCompat;
                             ^
  symbol:   class NotificationCompat
  location: package android.support.v4.app
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/de/sitewaerts/cordova/documentviewer/FileProvider.java:3: error: package android.support.v4.content does not exist
public class FileProvider extends android.support.v4.content.FileProvider {
                                                            ^
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/de/sitewaerts/cordova/documentviewer/DocumentViewerPlugin.java:34: error: package android.support.v4.content does not exist
import android.support.v4.content.FileProvider;
                                 ^
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/com/ionicframework/cordova/webview/IonicWebViewEngine.java:11: error: package android.support.annotation does not exist
import android.support.annotation.RequiresApi;
                                 ^
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/com/ionicframework/cordova/webview/IonicWebViewEngine.java:121: error: cannot find symbol
    @RequiresApi(Build.VERSION_CODES.LOLLIPOP)
     ^
  symbol:   class RequiresApi
  location: class IonicWebViewEngine.ServerClient
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePlugin.java:358: error: cannot find symbol
                    NotificationManagerCompat notificationManagerCompat = NotificationManagerCompat.from(context);
                    ^
  symbol: class NotificationManagerCompat
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePlugin.java:358: error: cannot find symbol
                    NotificationManagerCompat notificationManagerCompat = NotificationManagerCompat.from(context);
                                                                          ^
  symbol: variable NotificationManagerCompat
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePluginMessagingService.java:144: error: package NotificationCompat does not exist
            NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this, channelId);
                              ^
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePluginMessagingService.java:144: error: package NotificationCompat does not exist
            NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this, channelId);
                                                                                   ^
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePluginMessagingService.java:153: error: cannot find symbol
                    .setPriority(NotificationCompat.PRIORITY_MAX);
                                 ^
  symbol:   variable NotificationCompat
  location: class FirebasePluginMessagingService
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePluginMessagingService.java:149: error: package NotificationCompat does not exist
                    .setStyle(new NotificationCompat.BigTextStyle().bigText(messageBody))
                                                    ^
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePluginMessagingService.java:148: error: cannot find symbol
                    .setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
                                   ^
  symbol:   variable NotificationCompat
  location: class FirebasePluginMessagingService
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/de/sitewaerts/cordova/documentviewer/DocumentViewerPlugin.java:500: error: cannot find symbol
                    Uri contentUri = FileProvider.getUriForFile(
                                                 ^
  symbol:   method getUriForFile(Context,String,File)
  location: class FileProvider
Note: Some input files use or override 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.
14 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

I resolved with this commands: ionic cordova platform rm android ionic cordova plugin rm cordova-plugin-firebase npm install cordova@9 ionic cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue ionic cordova plugin add cordova-plugin-androidx ionic cordova plugin add cordova-plugin-androidx-adapter ionic cordova platform add android@8

Were you able to get it fixed? I'm getting the same error despite trying all other suggested options.

fortunatogreco commented 5 years ago

Hi! I am trying to solve this on any way but, every intent result in a error.

BUILD FAILED in 38s

> Task :app:compileReleaseJavaWithJavac FAILED
33 actionable tasks: 33 executed
/Volumes/Datos/GIT/CCASApp/platforms/android/gradlew: Command failed with exit code 1 Error output:
Note: /Volumes/Datos/GIT/CCASApp/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemCookieManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePlugin.java:9: error: cannot find symbol
import android.support.v4.app.NotificationManagerCompat;
                             ^
  symbol:   class NotificationManagerCompat
  location: package android.support.v4.app
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePluginMessagingService.java:11: error: cannot find symbol
import android.support.v4.app.NotificationCompat;
                             ^
  symbol:   class NotificationCompat
  location: package android.support.v4.app
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/de/sitewaerts/cordova/documentviewer/FileProvider.java:3: error: package android.support.v4.content does not exist
public class FileProvider extends android.support.v4.content.FileProvider {
                                                            ^
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/de/sitewaerts/cordova/documentviewer/DocumentViewerPlugin.java:34: error: package android.support.v4.content does not exist
import android.support.v4.content.FileProvider;
                                 ^
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/com/ionicframework/cordova/webview/IonicWebViewEngine.java:11: error: package android.support.annotation does not exist
import android.support.annotation.RequiresApi;
                                 ^
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/com/ionicframework/cordova/webview/IonicWebViewEngine.java:121: error: cannot find symbol
    @RequiresApi(Build.VERSION_CODES.LOLLIPOP)
     ^
  symbol:   class RequiresApi
  location: class IonicWebViewEngine.ServerClient
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePlugin.java:358: error: cannot find symbol
                    NotificationManagerCompat notificationManagerCompat = NotificationManagerCompat.from(context);
                    ^
  symbol: class NotificationManagerCompat
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePlugin.java:358: error: cannot find symbol
                    NotificationManagerCompat notificationManagerCompat = NotificationManagerCompat.from(context);
                                                                          ^
  symbol: variable NotificationManagerCompat
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePluginMessagingService.java:144: error: package NotificationCompat does not exist
            NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this, channelId);
                              ^
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePluginMessagingService.java:144: error: package NotificationCompat does not exist
            NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this, channelId);
                                                                                   ^
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePluginMessagingService.java:153: error: cannot find symbol
                    .setPriority(NotificationCompat.PRIORITY_MAX);
                                 ^
  symbol:   variable NotificationCompat
  location: class FirebasePluginMessagingService
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePluginMessagingService.java:149: error: package NotificationCompat does not exist
                    .setStyle(new NotificationCompat.BigTextStyle().bigText(messageBody))
                                                    ^
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePluginMessagingService.java:148: error: cannot find symbol
                    .setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
                                   ^
  symbol:   variable NotificationCompat
  location: class FirebasePluginMessagingService
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/de/sitewaerts/cordova/documentviewer/DocumentViewerPlugin.java:500: error: cannot find symbol
                    Uri contentUri = FileProvider.getUriForFile(
                                                 ^
  symbol:   method getUriForFile(Context,String,File)
  location: class FileProvider
Note: Some input files use or override 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.
14 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

I resolved with this commands: ionic cordova platform rm android ionic cordova plugin rm cordova-plugin-firebase npm install cordova@9 ionic cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue ionic cordova plugin add cordova-plugin-androidx ionic cordova plugin add cordova-plugin-androidx-adapter ionic cordova platform add android@8

Were you able to get it fixed? I'm getting the same error despite trying all other suggested options.

Yes, it is important update to Cordova 9 (npm install cordova@9) and android 8 (ionic cordova platform add android@8) in your project root folder.

viniciusbarbosa commented 5 years ago

Hi! I am trying to solve this on any way but, every intent result in a error.

BUILD FAILED in 38s

> Task :app:compileReleaseJavaWithJavac FAILED
33 actionable tasks: 33 executed
/Volumes/Datos/GIT/CCASApp/platforms/android/gradlew: Command failed with exit code 1 Error output:
Note: /Volumes/Datos/GIT/CCASApp/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemCookieManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePlugin.java:9: error: cannot find symbol
import android.support.v4.app.NotificationManagerCompat;
                             ^
  symbol:   class NotificationManagerCompat
  location: package android.support.v4.app
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePluginMessagingService.java:11: error: cannot find symbol
import android.support.v4.app.NotificationCompat;
                             ^
  symbol:   class NotificationCompat
  location: package android.support.v4.app
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/de/sitewaerts/cordova/documentviewer/FileProvider.java:3: error: package android.support.v4.content does not exist
public class FileProvider extends android.support.v4.content.FileProvider {
                                                            ^
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/de/sitewaerts/cordova/documentviewer/DocumentViewerPlugin.java:34: error: package android.support.v4.content does not exist
import android.support.v4.content.FileProvider;
                                 ^
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/com/ionicframework/cordova/webview/IonicWebViewEngine.java:11: error: package android.support.annotation does not exist
import android.support.annotation.RequiresApi;
                                 ^
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/com/ionicframework/cordova/webview/IonicWebViewEngine.java:121: error: cannot find symbol
    @RequiresApi(Build.VERSION_CODES.LOLLIPOP)
     ^
  symbol:   class RequiresApi
  location: class IonicWebViewEngine.ServerClient
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePlugin.java:358: error: cannot find symbol
                    NotificationManagerCompat notificationManagerCompat = NotificationManagerCompat.from(context);
                    ^
  symbol: class NotificationManagerCompat
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePlugin.java:358: error: cannot find symbol
                    NotificationManagerCompat notificationManagerCompat = NotificationManagerCompat.from(context);
                                                                          ^
  symbol: variable NotificationManagerCompat
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePluginMessagingService.java:144: error: package NotificationCompat does not exist
            NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this, channelId);
                              ^
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePluginMessagingService.java:144: error: package NotificationCompat does not exist
            NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this, channelId);
                                                                                   ^
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePluginMessagingService.java:153: error: cannot find symbol
                    .setPriority(NotificationCompat.PRIORITY_MAX);
                                 ^
  symbol:   variable NotificationCompat
  location: class FirebasePluginMessagingService
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePluginMessagingService.java:149: error: package NotificationCompat does not exist
                    .setStyle(new NotificationCompat.BigTextStyle().bigText(messageBody))
                                                    ^
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePluginMessagingService.java:148: error: cannot find symbol
                    .setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
                                   ^
  symbol:   variable NotificationCompat
  location: class FirebasePluginMessagingService
/Volumes/Datos/GIT/CCASApp/platforms/android/app/src/main/java/de/sitewaerts/cordova/documentviewer/DocumentViewerPlugin.java:500: error: cannot find symbol
                    Uri contentUri = FileProvider.getUriForFile(
                                                 ^
  symbol:   method getUriForFile(Context,String,File)
  location: class FileProvider
Note: Some input files use or override 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.
14 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

I resolved with this commands: ionic cordova platform rm android ionic cordova plugin rm cordova-plugin-firebase npm install cordova@9 ionic cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue ionic cordova plugin add cordova-plugin-androidx ionic cordova plugin add cordova-plugin-androidx-adapter ionic cordova platform add android@8

Were you able to get it fixed? I'm getting the same error despite trying all other suggested options.

Hi! I solved the error with the following steps:

cordova: 8.0.0
node: 8.11.0
ionic: 3.20.0
android: 8.0.0
targetBuild: 28

FIRST

ionic cordova platform rm android
ionic cordova plugin rm cordova-plugin-firebase

remove folder node_modules

IN SEQUENCE

npm i
cordova plugin add cordova-plugin-firebase-lib
cordova plugin add cordova-plugin-androidx
cordova plugin add cordova-plugin-androidx-adapter
ionic cordova platform add android@8

Resolved 100% for me. I was there 2 days ago with this problem and this was the solution. APP build successful 100%. APK running successfully as well.

Hope this helps

Abs

JeetuChoudhary commented 5 years ago

rsi

Works for me, thanks! but "ionic cordova plugin add cordova-plugin-android-adapter" doesn't exists this is what i've done

  1. ionic cordova platform rm android
  2. ionic cordova plugin rm cordova-plugin-firebase
  3. ionic cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue
  4. ionic cordova plugin add cordova-plugin-androidx
  5. ionic cordova plugin add cordova-plugin-androidx-adapter
  6. ionic cordova platform add android Anyway, thanks!

I followed all these steps and still, I am not able to get the build to create/run. Build Fails with Following Error: Task :app:compileDebugJavaWithJavac FAILED app\platforms\android\app\src\main\java\com\ionicframework\cordova\webview\IonicWebViewEngine.java:11: error: package android.support.annotation does not exist import android.support.annotation.RequiresApi; ^ app\platforms\android\app\src\main\java\org\apache\cordova\firebase\FirebasePlugin.java:9: error: cannot find symbol import android.support.v4.app.NotificationManagerCompat;

I have cordova 9 with android@8.
I am stuck at it from last few days and need to fix this. Any Suggestions.

JeetuChoudhary commented 5 years ago

Hi! I solved the error with the following steps:

cordova: 8.0.0
node: 8.11.0
ionic: 3.20.0
android: 8.0.0
targetBuild: 28

FIRST

ionic cordova platform rm android
ionic cordova plugin rm cordova-plugin-firebase

remove folder node_modules

IN SEQUENCE

npm i
cordova plugin add cordova-plugin-firebase-lib
cordova plugin add cordova-plugin-androidx
cordova plugin add cordova-plugin-androidx-adapter
ionic cordova platform add android@8

Resolved 100% for me. I was there 2 days ago with this problem and this was the solution. APP build successful 100%. APK running successfully as well.

Hope this helps

Abs

Hey @viniciusbarbosa, by using your solution and a tweaking little bit in Intercom plugin configuration Which has the following under platform/android/cordova-plugin-intercom/app-intercom.gradle. ` dependencies {

    // classpath 'com.android.tools.build:gradle:2.3.+'

    if (pushType == 'fcm') {

        // classpath 'com.google.gms:google-services:3.2.0'

    }
}

` After commenting them out I am able to create build successfully. but When I run it in device, app crash before starting without any error. Any Idea what is happening?

viniciusbarbosa commented 5 years ago

Hi, @JeetuChoudhary!

When you ran: ionic cordova platform add android @ 8, have all the plugins been installed successfully?

The androidx-adapter plugin should solve all compatibility problems and internal dependency of other plugins.

To test, remove the cordova-plugin-intercom plugin from package.json, repeat all the steps and see if the build succeeds.

I took a look at the cordova-plugin-intercom and it cites to be compatible with ionic 1 and 2, what version of its ionic? And what version of the plugin are you using?

Abs

JoseManueIbnzLora commented 5 years ago

This work for me. cordova-plugin-firebase -save
We found a way to resolve this, and remain on target SDK version 27.

cordova platform remove android update platforms/android/project.properties: cordova.system.library.3=com.google.android.gms:play-services-tagmanager:16.0.8 cordova.system.library.4=com.google.firebase:firebase-core:16.0.8 cordova.system.library.5=com.google.firebase:firebase-messaging:17.5.0 cordova.system.library.6=com.google.firebase:firebase-config:16.4.1 cordova.system.library.7=com.google.firebase:firebase-perf:16.2.4

update platforms/android/app/build.gradle (dependencies ~ln 266)

compile "com.google.android.gms:play-services-tagmanager:16.0.8" compile "com.google.firebase:firebase-core:16.0.8" compile "com.google.firebase:firebase-messaging:17.5.0" compile "com.google.firebase:firebase-config:16.4.1" compile "com.google.firebase:firebase-perf:16.2.4

update platforms/android/cordova-plugin-firebase/cloud-build.gradle (in dependencies) compile 'com.google.firebase:firebase-auth:16.2.1'

cordova plugin add cordova-plugin-intercom

Update cordova/platforms/android/cordova-plugin-intercom/movilidapp-intercom.gradle (~ln 66): apply plugin: 'com.google.gms.google-services'

Hi! I solved the error with the following steps:

cordova: 8.0.0
node: 8.11.0
ionic: 3.20.0
android: 8.0.0
targetBuild: 28

FIRST

ionic cordova platform rm android
ionic cordova plugin rm cordova-plugin-firebase

remove folder node_modules IN SEQUENCE

npm i
cordova plugin add cordova-plugin-firebase-lib
cordova plugin add cordova-plugin-androidx
cordova plugin add cordova-plugin-androidx-adapter
ionic cordova platform add android@8

Resolved 100% for me. I was there 2 days ago with this problem and this was the solution. APP build successful 100%. APK running successfully as well. Hope this helps

Abs

Hey @viniciusbarbosa, by using your solution and a tweaking little bit in Intercom plugin configuration Which has the following under platform/android/cordova-plugin-intercom/app-intercom.gradle. ` dependencies {

    // classpath 'com.android.tools.build:gradle:2.3.+'

    if (pushType == 'fcm') {

        // classpath 'com.google.gms:google-services:3.2.0'

    }
}

` After commenting them out I am able to create build successfully. but When I run it in device, app crash before starting without any error. Any Idea what is happening?

Firebase+Intercom This work for me!! cordova: 8.0.0 node: 10.15.1 android: 7.1.4 targetBuild: 27

cordova-plugin-firebase -save

We found a way to resolve this, and remain on target SDK version 27. cordova platform remove android

update platforms/android/project.properties: cordova.system.library.3=com.google.android.gms:play-services-tagmanager:16.0.8 cordova.system.library.4=com.google.firebase:firebase-core:16.0.8 cordova.system.library.5=com.google.firebase:firebase-messaging:17.5.0 cordova.system.library.6=com.google.firebase:firebase-config:16.4.1 cordova.system.library.7=com.google.firebase:firebase-perf:16.2.4

update platforms/android/app/build.gradle (dependencies ~ln 266) compile "com.google.android.gms:play-services-tagmanager:16.0.8" compile "com.google.firebase:firebase-core:16.0.8" compile "com.google.firebase:firebase-messaging:17.5.0" compile "com.google.firebase:firebase-config:16.4.1" compile "com.google.firebase:firebase-perf:16.2.4

update platforms/android/cordova-plugin-firebase/cloud-build.gradle (in dependencies) compile 'com.google.firebase:firebase-auth:16.2.1'

cordova plugin add cordova-plugin-intercom

update cordova/platforms/android/cordova-plugin-intercom/movilidapp-intercom.gradle (~ln 66): apply plugin: 'com.google.gms.google-services'

APP build successful 100%. APK running successfully as well.

JeetuChoudhary commented 5 years ago

@viniciusbarbosa I have ionic@3.20.0 and cordova9. yes, all the plugins are installed successfully and then I removed platform, plugin, node_module, and package-lock.json. Then repeated the steps you provided.

I have "cordova-plugin-intercom": "7.0.0", with "@ionic-native/intercom": "^5.8.0". IOS requires the latest version of intercom to create the build otherwise it causes the problem and it works well in IOS with Ionic 3. It also works in android with ionic 3 if you have android version >=@7.1.0 with Ionic 3. I have it in one of other project but that doesn't have firebase plugin so it works fine.

I will also test after removing the cordova-plugin-intercom plugin from package.json,

This firebase plugin is breaking my Two projects and making it hard for me. In one of my another project by using your steps, it still doesn't create the build. And that project doesn't have intercom but have analytics. In that project, it gives the following error while building.

`BUILD FAILED in 8s /platforms/android/gradlew: Command failed with exit code 1 Error output:

Note: /platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemCookieManager.java uses or overrides a deprecated API.

Note: Recompile with -Xlint:deprecation for details. /platforms/android/app/src/main/AndroidManifest.xml:36:5-74 Error: uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:CordovaLib]

/platforms/android/CordovaLib/build/intermediates/library_manifest/debug/AndroidManifest.xml as the library might be using APIs not available in 16 Suggestion: use a compatible library with a minSdk of at most 16, or increase this project's minSdk version to at least 19, or use tools:overrideLibrary="org.apache.cordova" to force usage (may lead to runtime failures)` and I have added the minSdk version to android/app/build.gradle. but no luck

Thanks for your time and help

viniciusbarbosa commented 5 years ago

Try again the described steps, however note, if your android version is 7.1.4, then you should use: cordova plugin add cordova-plugin-firebase-lib@3.3.0

See more details here: https://github.com/wizpanda/cordova-plugin-firebase-lib

Try and tell me what happens

nsksaisaravana commented 5 years ago

@viniciusbarbosa Build is successfull but Android SDK is failing with the below message

move minsdkversion to build files and sync project

JeetuChoudhary commented 5 years ago

@nsksaisaravana When you run it from the android studio it asks to do that. Run through command line it will work

toFreshMilk commented 5 years ago

hello....

BUILD FAILED in 14s Error: appfolder/platforms/android/gradlew: Command failed with exit code 1 Error output: Note: /appfolder/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemCookieManager.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

system info below..

im using ionic1 framework,

had tried things cordova platform add android@8.0.0 cordova plugin fam cordova plugin firebase cordova plugin firebasex cordova plugin firebasex-lib cordova plugin androidx cordova plugin androidx-adapter

..

i had tried solution in github almost but i failed.

please help