Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloud Messaging / build problems #1368

Open
Parth10277 opened this issue Feb 20, 2024 · 5 comments
Open

Cloud Messaging / build problems #1368

Parth10277 opened this issue Feb 20, 2024 · 5 comments
Labels
new New issue.

Comments

@Parth10277
Copy link

[READ] For Firebase Unity SDK issues, please report to Firebase Unity open-source

Once you've read this section and determined that your issue is appropriate for this repository, please delete this section.

[REQUIRED] Please fill in the following fields:

  • Unity editor version: 2022.3.20f1(LTS)
  • Firebase Unity SDK version: 11.7.0
  • Source you installed the SDK: firebase.google.com
  • Problematic Firebase Component: Cloud Messaging
  • Other Firebase Components in use: Analysis, Remote Config
  • Additional SDKs you are using: None
  • Platform you are using the Unity editor on: Windows 10
  • Platform you are targeting: Android and iOS
  • Scripting Runtime: Mono, and IL2CPP

[REQUIRED] Please describe the issue here:

While "Build and Run" the project Error will occur, for gradle build.

Console Error,

E:\Parth's Training\QWERTY\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\src\main\java\com\google\firebase\MessagingUnityPlayerActivity.java:64: error: cannot access JobIntentService
MessageForwardingService.enqueueWork(this, message);
^
class file for androidx.core.app.JobIntentService not found
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':unityLibrary:compileReleaseJavaWithJavac'.

Compilation failed; see the compiler error output for details.


Steps to reproduce:

Have you been able to reproduce this issue with just the Firebase Unity quickstarts (this GitHub project)?
What's the issue repro rate? 5/5

What happened? How can we make the problem occur? -> Just Import and build
This could be a description, log/console output, etc.

console Errors.

i)
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.20f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\32.0.0\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.20f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.20f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-31\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.20f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-32\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.20f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only

Task :launcher:preBuild UP-TO-DATE
Task :unityLibrary:preBuild UP-TO-DATE
Task :launcher:preReleaseBuild UP-TO-DATE
Task :unityLibrary:preReleaseBuild UP-TO-DATE
Task :unityLibrary:compileReleaseAidl NO-SOURCE
Task :launcher:generateReleaseBuildConfig
Task :launcher:compileReleaseAidl NO-SOURCE
Task :launcher:javaPreCompileRelease
Task :launcher:generateReleaseResValues
Task :launcher:createReleaseCompatibleScreenManifests
Task :launcher:extractDeepLinksRelease
Task :launcher:extractProguardFiles
Task :launcher:mergeReleaseJniLibFolders
Task :unityLibrary:mergeReleaseJniLibFolders
Task :unityLibrary:compileReleaseRenderscript NO-SOURCE
Task :unityLibrary:generateReleaseBuildConfig
Task :unityLibrary:generateReleaseResValues
Task :unityLibrary:generateReleaseResources
Task :unityLibrary:packageReleaseResources
Task :unityLibrary:javaPreCompileRelease
Task :unityLibrary:mergeReleaseShaders
Task :unityLibrary:compileReleaseShaders NO-SOURCE
Task :unityLibrary:generateReleaseAssets UP-TO-DATE
Task :unityLibrary:parseReleaseLocalResources
Task :unityLibrary:processReleaseManifest
Task :unityLibrary:packageReleaseAssets
Task :unityLibrary:packageReleaseRenderscript NO-SOURCE
Task :unityLibrary:prepareLintJarForPublish
Task :unityLibrary:prepareReleaseArtProfile
Task :unityLibrary:processReleaseJavaRes
Task :launcher:compileReleaseRenderscript NO-SOURCE
Task :launcher:generateReleaseResources
Task :unityLibrary:extractDeepLinksRelease
Task :unityLibrary:writeReleaseAarMetadata
Task :unityLibrary:compileReleaseLibraryResources
Task :unityLibrary:writeReleaseLintModelMetadata
Task :unityLibrary:bundleLibResRelease
Task :unityLibrary:mergeReleaseJavaResource
Task :unityLibrary:mergeReleaseNativeLibs
Task :launcher:checkReleaseAarMetadata
Task :unityLibrary:generateReleaseRFile
Task :launcher:processReleaseMainManifest
Task :launcher:processReleaseManifest
Task :launcher:checkReleaseDuplicateClasses
Task :launcher:mergeReleaseResources
Task :unityLibrary:stripReleaseDebugSymbols
Task :launcher:mergeReleaseShaders
Task :launcher:compileReleaseShaders NO-SOURCE
Task :launcher:generateReleaseAssets UP-TO-DATE
Task :launcher:mergeReleaseAssets
Task :launcher:processReleaseJavaRes NO-SOURCE
Task :unityLibrary:copyReleaseJniLibsProjectAndLocalJars
Task :unityLibrary:copyReleaseJniLibsProjectOnly
Task :launcher:collectReleaseDependencies
Task :launcher:sdkReleaseDependencyData
Task :launcher:validateSigningRelease
Task :unityLibrary:extractReleaseAnnotations
Task :launcher:mergeReleaseJavaResource
Task :launcher:writeReleaseAppMetadata
Task :launcher:writeReleaseSigningConfigVersions
Task :launcher:mergeReleaseArtProfile
Task :launcher:processReleaseManifestForPackage

Task :unityLibrary:compileReleaseJavaWithJavac FAILED

Task :launcher:compressReleaseAssets
Task :launcher:desugarReleaseFileDependencies
Task :launcher:processReleaseResources
50 actionable tasks: 50 executed

UnityEditor.EditorApplication:Internal_CallGlobalEventHandler ()

ii)
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
E:\Parth's Training\QWERTY\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\src\main\java\com\google\firebase\MessagingUnityPlayerActivity.java:64: error: cannot access JobIntentService
MessageForwardingService.enqueueWork(this, message);
^
class file for androidx.core.app.JobIntentService not found
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':unityLibrary:compileReleaseJavaWithJavac'.

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

BUILD FAILED in 2s

UnityEditor.EditorApplication:Internal_CallGlobalEventHandler ()

If you have a downloadable sample project that reproduces the bug you're reporting, you will
likely receive a faster response on your issue.

Relevant Code:

I haven't coded anything just import those packages from google Firebase

// TODO(you): code here to reproduce the problem
@Parth10277 Parth10277 added the new New issue. label Feb 20, 2024
@Parth10277
Copy link
Author

Screen Preview of all Assets,

image

@meding09
Copy link

It happens to me too.
Has anything been resolved?

@Pyrobeerbeer
Copy link

Pyrobeerbeer commented Mar 6, 2024

Hey,

I have the exact same problem with SDK 11.7.0. I tested it with 11.6 and the issue persists. Here's what I've tried:

  • Tested with 4 major Unity versions from 2019 to 2022 LTS.
  • Cleared project libraries.
  • Cleared Gradle cache.
  • Uninstalled Unity.
  • Changed from Mono to IL2CPP.
  • Adjusted .NET API compatibility level.
  • Changed target architecture.
  • Modified minimum and target API levels.
  • Tested on a blank projet and official Firebase unity repos

Despite all these attempts, I'm still unable to build. Any help would be greatly appreciated. Thanks.

@rishijatia
Copy link

Facing the same issue. Any ideas how to resolve?

@rishijatia
Copy link

Not sure if anyone is still facing this issue, I was able to work around it by adding

    implementation 'androidx.core:core:1.1.0'
    implementation("androidx.appcompat:appcompat:1.3.1")

to my Assets/Plugins/Android/mainTemplate.gradle file right after

// Android Resolver Dependencies end

Good luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new New issue.
Projects
None yet
Development

No branches or pull requests

4 participants