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

Unable to check Google Play services availablity #754

Closed
UncleJey opened this issue Aug 17, 2020 · 10 comments
Closed

Unable to check Google Play services availablity #754

UncleJey opened this issue Aug 17, 2020 · 10 comments
Labels
needs-attention Need Googler's attention type: question

Comments

@UncleJey
Copy link

UncleJey commented Aug 17, 2020

Hi everyone!
Cant initialize Firebase.
It's work in unity 2019.2.20

but broken in Unity3d 2019.4.6 IL2CPP aab build
Additional SDKs you are using (Facebook, AdMob, etc.): FaceBook, AppsFlyer, AppsLovin, Sirenix Odin, TapJoy
Platform you are using the Unity editor on (Mac, Windows, or Linux): Windows
Platform you are targeting (iOS, Android, and/or desktop): Android
Scripting Runtime (Mono, and/or IL2CPP): IL2CPP

Plugins installed with Package Manager
Firebase Core 6.15.2
Firebase 6.15.2
Crashalytics 6.15.2
Google play common 1.2.0
Google play core 1.2.0
External Dependency Manager for Unity 1.2.157
Resolver -Enabled resolution on build. Do not use daemon. Do not using Jetifier

Downgrade Firebase plugin to 6.15.1 and 6.15.0 has no any effect

Initialization

   void Awake()
    {
        if (_initialized)
        {
            return;
        }
        
        Debug.Log("Firebase Initialization Start");
        _initialized = true;
        FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(task =>
        {
            _dependencyStatus = task.Result;
            
            if (_dependencyStatus == DependencyStatus.Available)
            {
                InitializeFirebase();
            }
            else
            {
                Debug.LogError(
                    "Could not resolve all Firebase dependencies: " + _dependencyStatus);
            }
        });
    }

    // Handle initialization of the necessary firebase modules:
    static void InitializeFirebase()
    {
        Debug.Log("Firebase Initialization Phase 2");
        FirebaseAnalytics.SetAnalyticsCollectionEnabled(Foranj.SDK.Tools.NativeTools.isLegal);

        // Set the user's sign up method.
        FirebaseAnalytics.SetUserProperty(
            FirebaseAnalytics.UserPropertySignUpMethod,
            "Google");
        // Set the user ID.
//        FirebaseAnalytics.SetUserId("uber_user_510");
        // Set default session duration values.
        //FirebaseAnalytics.SetMinimumSessionDuration(new TimeSpan(0, 0, 10)); depricated
        //FirebaseAnalytics.SetSessionTimeoutDuration(new TimeSpan(0, 30, 0)); // The default value is 1800000 (30 minutes). 
    }

Having errors in runtime

08-17 18:33:59.231: E/Unity(20615): Unable to check Google Play services availablity as the com.google.android.gms.common.GoogleApiAvailability class is not present in this application.
08-17 18:33:59.231: E/Unity(20615): Firebase.AppUtilPINVOKE:PollCallbacks()
08-17 18:33:59.231: E/Unity(20615): Firebase.AppUtil:PollCallbacks()
08-17 18:33:59.231: E/Unity(20615): Firebase.Platform.FirebaseHandler:Update()
08-17 18:33:59.231: E/Unity(20615):  
08-17 18:33:59.231: E/Unity(20615): (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
08-17 18:33:59.235: E/Unity(20615): Unable to check Google Play services availablity as the com.google.android.gms.common.GoogleApiAvailability class is not present in this application.
08-17 18:33:59.235: E/Unity(20615): Firebase.AppUtilPINVOKE:PollCallbacks()
08-17 18:33:59.235: E/Unity(20615): Firebase.AppUtil:PollCallbacks()
08-17 18:33:59.235: E/Unity(20615): Firebase.Platform.FirebaseHandler:Update()
08-17 18:33:59.235: E/Unity(20615):  
08-17 18:33:59.235: E/Unity(20615): (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
08-17 18:33:59.236: E/Unity(20615): Unable to check Google Play services availablity as the com.google.android.gms.common.GoogleApiAvailability class is not present in this application.
08-17 18:33:59.236: E/Unity(20615): Firebase.AppUtilPINVOKE:PollCallbacks()
08-17 18:33:59.236: E/Unity(20615): Firebase.AppUtil:PollCallbacks()
08-17 18:33:59.236: E/Unity(20615): Firebase.Platform.FirebaseHandler:Update()
08-17 18:33:59.236: E/Unity(20615):  
08-17 18:33:59.236: E/Unity(20615): (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
08-17 18:33:59.237: E/Unity(20615): Unable to check Google Play services availablity as the com.google.android.gms.common.GoogleApiAvailability class is not present in this application.
08-17 18:33:59.237: E/Unity(20615): Firebase.AppUtilPINVOKE:PollCallbacks()
08-17 18:33:59.237: E/Unity(20615): Firebase.AppUtil:PollCallbacks()
08-17 18:33:59.237: E/Unity(20615): Firebase.Platform.FirebaseHandler:Update()
08-17 18:33:59.237: E/Unity(20615):  
08-17 18:33:59.237: E/Unity(20615): (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
08-17 18:33:59.256: E/Unity(20615): Could not resolve all Firebase dependencies: UnavailableOther
08-17 18:33:59.256: E/Unity(20615): <>c:<Awake>b__2_0(Task`1)
08-17 18:33:59.256: E/Unity(20615): System.Action`1:Invoke(T)
08-17 18:33:59.256: E/Unity(20615): Firebase.Extensions.<ContinueWithOnMainThread>c__AnonStorey9:<>m__0()
08-17 18:33:59.256: E/Unity(20615): System.Func`1:Invoke()
08-17 18:33:59.256: E/Unity(20615): Firebase.<RunAsync>c__AnonStorey1`1:<>m__0()
08-17 18:33:59.256: E/Unity(20615): System.Action:Invoke()
08-17 18:33:59.256: E/Unity(20615): Firebase.ExceptionAggregator:Wrap(Action)
08-17 18:33:59.256: E/Unity(20615): Firebase.Dispatcher:PollJobs()
08-17 18:33:59.256: E/Unity(20615): Firebase.Platform.FirebaseHandler:Update()

and later

08-17 18:34:02.245: E/Unity(20615): Unable to check Google Play services availablity as the com.google.android.gms.common.GoogleApiAvailability class is not present in this application.
08-17 18:34:02.245: E/Unity(20615): Firebase.AppUtilPINVOKE:FirebaseApp_CreateInternal__SWIG_0()
08-17 18:34:02.245: E/Unity(20615): Firebase.FirebaseApp:CreateInternal()
08-17 18:34:02.245: E/Unity(20615): Firebase.CreateDelegate:Invoke()
08-17 18:34:02.245: E/Unity(20615): Firebase.FirebaseApp:CreateAndTrack(CreateDelegate, FirebaseApp)
08-17 18:34:02.245: E/Unity(20615): Firebase.Analytics.FirebaseAnalytics:.cctor()
08-17 18:34:02.245: E/Unity(20615): Preloader:OnDestroy()
08-17 18:34:02.245: E/Unity(20615):  
08-17 18:34:02.245: E/Unity(20615): (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
08-17 18:34:02.253: E/Unity(20615): System.TypeInitializationException: The type initializer for 'Firebase.Analytics.FirebaseAnalytics' threw an exception. ---> Firebase.InitializationException:  Firebase app creation failed.
08-17 18:34:02.253: E/Unity(20615):   at Firebase.FirebaseApp.CreateAndTrack (Firebase.FirebaseApp+CreateDelegate createDelegate, Firebase.FirebaseApp existingProxy) [0x00000] in <00000000000000000000000000000000>:0 
08-17 18:34:02.253: E/Unity(20615):   at Firebase.Analytics.FirebaseAnalytics..cctor () [0x00000] in <00000000000000000000000000000000>:0 

Firebase Tag logs

08-18 15:35:05.165: I/FirebaseInitProvider(5325): FirebaseApp initialization successful
08-18 15:35:14.367: D/FirebaseApp(6231): com.google.firebase.auth.FirebaseAuth is not linked. Skipping initialization.
08-18 15:35:14.367: D/FirebaseApp(6231): com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
08-18 15:35:14.368: I/FirebaseInitProvider(6231): FirebaseApp initialization successful
08-18 15:35:57.296: I/FirebaseApp(6645): Device unlocked: initializing all Firebase APIs for app [DEFAULT]
08-18 15:35:57.326: I/FirebaseCrashlytics(6645): Initializing Crashlytics 17.2.1
08-18 15:35:57.345: I/FirebaseInitProvider(6645): FirebaseApp initialization successful
08-18 15:36:01.258: E/firebase(6645): Unable to check Google Play services availablity as the com.google.android.gms.common.GoogleApiAvailability class is not present in this application.
08-18 15:36:01.258: E/firebase(6645): g_initialized_count
08-18 15:36:01.272: E/firebase(6645): Unable to check Google Play services availablity as the com.google.android.gms.common.GoogleApiAvailability class is not present in this application.
08-18 15:36:01.281: E/firebase(6645): Unable to check Google Play services availablity as the com.google.android.gms.common.GoogleApiAvailability class is not present in this application.
08-18 15:36:01.410: E/firebase(6645): Unable to check Google Play services availablity as the com.google.android.gms.common.GoogleApiAvailability class is not present in this application.
08-18 15:36:01.429: E/firebase(6645): Unable to check Google Play services availablity as the com.google.android.gms.common.GoogleApiAvailability class is not present in this application.
08-18 15:36:04.673: E/firebase(6645): Unable to check Google Play services availablity as the com.google.android.gms.common.GoogleApiAvailability class is not present in this application.
08-18 15:36:12.562: E/firebase(6645): internal::IsInitialized()
08-18 15:37:09.429: I/FirebaseInitProvider(7288): FirebaseApp initialization successful
08-18 15:37:37.994: I/FirebaseCrashApiImpl(7529): FirebaseCrashApiImpl created by ClassLoader dalvik.system.DelegateLastClassLoader[DexPathList[[zip file "/data/user_de/0/com.google.android.gms/app_chimera/m/00000095/DynamiteModulesC.apk"],nativeLibraryDirectories=[/data/user_de/0/com.google.android.gms/app_chimera/m/00000095/DynamiteModulesC.apk!/lib/arm64-v8a, /system/lib64, /product/lib64]]]
08-18 15:37:38.069: I/FirebaseCrashApiImpl(7529): FirebaseCrash reporting API initialized
08-18 15:37:38.070: W/FirebaseCrashAnalytics(7529): Unable to log event, missing Google Analytics for Firebase library
08-18 15:37:43.650: I/FirebaseCrash(7529): Sending crashes
@UncleJey UncleJey added the new New issue. label Aug 17, 2020
@google-oss-bot
Copy link

This issue does not seem to follow the issue template. Make sure you provide all the required information.

@ben-gripable
Copy link

ben-gripable commented Aug 18, 2020

I've noticed the same error today using Unity 2019.4.1 on MacOS, creating IL2CPP android builds. It was working last week, with no changes to the project at all. I ran External Dependency Manager Android Resolver today and noticed some of the android and firebase plugins updated to newer versions in my project. However, it seems that these plugins:
com.google.android.gms.play-services-base-17.0.0.aar com.google.auto.value.auto-value-annotations-1.6.5.jar com.google.firebase.firebase-iid-20.1.5.aar com.google.firebase.firebase-installations-16.3.2.aar
are being removed, which might be why this error is showing:
com.google.android.gms.common.GoogleApiAvailability class is not present

@UncleJey
Copy link
Author

UncleJey commented Aug 18, 2020

partially resolved by adding dependence

<?xml version="1.0" encoding="utf-8"?>
<dependencies>
    <androidPackages>
        <androidPackage spec="com.google.android.gms:play-services-auth:17.0.0" />

but now have another error

08-18 17:45:34.542: E/Unity(19669): method_ids[i] || (method.optional == kMethodOptional)
08-18 17:45:34.542: E/Unity(19669): Firebase.Crashlytics.CrashlyticsInternalPINVOKE:FirebaseCrashlyticsInternal_GetInstance__SWIG_0(HandleRef, Int32&)
08-18 17:45:34.542: E/Unity(19669): Firebase.Crashlytics.FirebaseCrashlyticsInternal:GetInstance(FirebaseApp, InitResult&)
08-18 17:45:34.542: E/Unity(19669): Firebase.Crashlytics.AndroidImpl:.ctor()
08-18 17:45:34.542: E/Unity(19669): Firebase.Crashlytics.Impl:Make()
08-18 17:45:34.542: E/Unity(19669): Firebase.Crashlytics.PlatformAccessor:.cctor()
08-18 17:45:34.542: E/Unity(19669): Firebase.Crashlytics.Crashlytics:Initialize()
08-18 17:45:34.542: E/Unity(19669): System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
08-18 17:45:34.542: E/Unity(19669): Firebase.FirebaseApp:InitializeCrashlyticsIfPresent()
08-18 17:45:34.542: E/Unity(19669): System.Func`1:Invoke()
08-18 17:45:34.542: E/Unity(19669): Firebase.FirebaseApp:CreateAndTrack(CreateDelegate, FirebaseApp)
08-18 17:45:34.542: E/Unity(19669): Firebase.Analytics.FirebaseAnalytics:.cctor()
08-18 17:45:34.542: E/Unity(19669): FirebaseInit:InitializeFirebase()
08-18 17:45:34.542: E/Unity(19669): System.Action`1:Invoke(T)
08-18 17:45:34.542: E/Unity(19669): Firebase.Extensions.<ContinueWithOnMainThread>c__AnonStorey9:<>m__0()
08-18 17:45:34.542: E/Unity(19669): System.Func`1:Invoke()
08-18 17:45:34.542: E/Unity(19669): Firebase.<RunAsync>c__AnonStorey1`1:<>m__0()
08-18 17:45:34.542: E/Unity(19669): System.Action:Invoke()
08-18 17:45:34.542: E/Unity(19669): Firebase.ExceptionAggregator:Wrap(Action)
08-18 17:45:34.542: E/Unity(19669): Firebase.Dispatcher:PollJobs()
08-18 17:45:34.542: E/Unity(19669): Firebase.Platform.FirebaseHan

And Firebase

08-18 17:29:21.616: W/FirebaseAuth(3195): [PhoneNumberAuthPostProcessor] postProcess starts
08-18 17:29:21.616: W/FirebaseAuth(3195): [PhoneNumberAuthPostProcessor] postProcess ends
08-18 17:29:22.259: D/FirebaseAuth(17782): Notifying id token listeners about user ( o_0 ).
08-18 17:35:04.429: I/FirebaseInitProvider(18644): FirebaseApp initialization successful
08-18 17:37:28.282: D/FirebaseApp(18711): com.google.firebase.auth.FirebaseAuth is not linked. Skipping initialization.
08-18 17:37:28.283: D/FirebaseApp(18711): com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
08-18 17:37:28.283: D/FirebaseApp(18711): com.google.android.gms.measurement.AppMeasurement is not linked. Skipping initialization.
08-18 17:37:28.283: I/FirebaseInitProvider(18711): FirebaseApp initialization successful
08-18 17:37:28.951: E/FirebaseInstanceId(21248): binding to the service failed
08-18 17:42:41.364: I/FirebaseCrashApiImpl(18987): FirebaseCrashApiImpl created by ClassLoader dalvik.system.DelegateLastClassLoader[DexPathList[[zip file "/data/user_de/0/com.google.android.gms/app_chimera/m/00000095/DynamiteModulesC.apk"],nativeLibraryDirectories=[/data/user_de/0/com.google.android.gms/app_chimera/m/00000095/DynamiteModulesC.apk!/lib/arm64-v8a, /system/lib64, /product/lib64]]]
08-18 17:42:41.439: I/FirebaseCrashApiImpl(18987): FirebaseCrash reporting API initialized
08-18 17:42:41.439: W/FirebaseCrashAnalytics(18987): Unable to log event, missing Google Analytics for Firebase library
08-18 17:42:56.080: I/FirebaseCrash(18987): Sending crashes
08-18 17:45:27.855: I/FirebaseApp(19669): Device unlocked: initializing all Firebase APIs for app [DEFAULT]
08-18 17:45:27.948: I/FirebaseCrashlytics(19669): Initializing Crashlytics 17.2.1
08-18 17:45:28.049: I/FirebaseInitProvider(19669): FirebaseApp initialization successful
08-18 17:45:34.461: I/firebase(19669): Firebase Analytics API Initializing
08-18 17:45:34.463: I/firebase(19669): analytics API Initialized
08-18 17:45:34.529: I/firebase(19669): Firebase Analytics API Initializing
08-18 17:45:34.532: I/firebase(19669): analytics API Initialized
08-18 17:45:34.540: E/firebase(19669): method_ids[i] || (method.optional == kMethodOptional)
08-18 17:45:34.542: E/firebase(19669): Unable to find Method com/google/firebase/crashlytics/internal/common/DataCollectionArbiter.setCrashlyticsDataCollectionEnabled (signature '(Z)V', instance).  Please verify the AAR which contains the com/google/firebase/crashlytics/internal/common/DataCollectionArbiter class is included in your app.

Update to 18.1.0 does not solve this

@ben-gripable
Copy link

How have you added a dependence? I can't seem to get the resolver to pick up the specified libraries. I've made a dependencies.xml file inside an editor folder, but none of the entries get added.

@UncleJey
Copy link
Author

UncleJey commented Aug 20, 2020

Embed the firebase library and modify CrashlyticsDependencies.xml

@cynthiajoan
Copy link
Contributor

Hi, can you try the approach mentioned here to see if that can unblock you? In the meantime we are investigating the resolve conflicts.

@cynthiajoan cynthiajoan added needs-info Need information for the developer type: question and removed new New issue. labels Aug 24, 2020
@UncleJey
Copy link
Author

Hi, can you try the approach mentioned here to see if that can unblock you? In the meantime we are investigating the resolve conflicts.

looks like its a same problem

@google-oss-bot google-oss-bot added needs-attention Need Googler's attention and removed needs-info Need information for the developer labels Aug 25, 2020
@UncleJey
Copy link
Author

Firebase guys all offline? No chance to fix it?

@Olszewskim
Copy link

Same problem here, android build from mac doesn't work. Update of Firebase or install package from Package Manager didn't help. Build from Windows works normally.

@chkuang-g
Copy link
Contributor

chkuang-g commented Sep 3, 2020

Duplicate of #758

I'll make comment on #758 (comment)

@firebase firebase locked and limited conversation to collaborators Oct 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs-attention Need Googler's attention type: question
Projects
None yet
Development

No branches or pull requests

6 participants