hansemannn / titanium-firebase-analytics

Use the Firebase Analytics SDK in Axway Titanium ๐Ÿš€
Other
35 stars 18 forks source link

Firebase API initialization failure when using analytics with other firebase modules. #37

Closed RavindraChherke closed 5 years ago

RavindraChherke commented 5 years ago

Hi @hansemannn ,

I am using Firebase core, cloud messaging, auth modules in project. This is working great. Thanks for all these great modules ๐Ÿ‘๐Ÿผ๐Ÿ˜€. Now I am trying to add Analytics in app. When I add my mobilesdk_app_id key in strings.xml file I start to get errors. I am using google-services.json file.

I checked by putting keys APIKey, projectID, storageBucket, applicationID,databaseURL, GCMSenderID in configuration but it is still throwing error.

Could you please help me with this.

<string name="google_app_id">mobilesdk_app_id</string>

[ERROR] :  FirebaseApp: Firebase API initialization failure.
[ERROR] :  FirebaseApp: java.lang.reflect.InvocationTargetException
[ERROR] :  FirebaseApp:     at java.lang.reflect.Method.invoke(Native Method)
[ERROR] :  FirebaseApp:     at com.google.firebase.FirebaseApp.zza(Unknown Source)
[ERROR] :  FirebaseApp:     at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
[ERROR] :  FirebaseApp:     at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
[ERROR] :  FirebaseApp:     at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
[ERROR] :  FirebaseApp:     at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
[ERROR] :  FirebaseApp:     at android.content.ContentProvider.attachInfo(ContentProvider.java:1748)
[ERROR] :  FirebaseApp:     at android.content.ContentProvider.attachInfo(ContentProvider.java:1723)
[ERROR] :  FirebaseApp:     at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
[ERROR] :  FirebaseApp:     at android.app.ActivityThread.installProvider(ActivityThread.java:5153)
[ERROR] :  FirebaseApp:     at android.app.ActivityThread.installContentProviders(ActivityThread.java:4748)
[ERROR] :  FirebaseApp:     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4688)
[ERROR] :  FirebaseApp:     at android.app.ActivityThread.-wrap1(ActivityThread.java)
[ERROR] :  FirebaseApp:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
[ERROR] :  FirebaseApp:     at android.os.Handler.dispatchMessage(Handler.java:102)
[ERROR] :  FirebaseApp:     at android.os.Looper.loop(Looper.java:148)
[ERROR] :  FirebaseApp:     at android.app.ActivityThread.main(ActivityThread.java:5417)
[ERROR] :  FirebaseApp:     at java.lang.reflect.Method.invoke(Native Method)
[ERROR] :  FirebaseApp:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
[ERROR] :  FirebaseApp:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
[ERROR] :  FirebaseApp: Caused by: java.lang.IllegalArgumentException: Given String is empty or null
[ERROR] :  FirebaseApp:     at com.google.android.gms.common.internal.zzbo.zzcF(Unknown Source)
[ERROR] :  FirebaseApp:     at com.google.android.gms.internal.kh.<init>(Unknown Source)
[ERROR] :  FirebaseApp:     at com.google.firebase.auth.FirebaseAuth.<init>(Unknown Source)
[ERROR] :  FirebaseApp:     at com.google.android.gms.internal.lr.<init>(Unknown Source)
[ERROR] :  FirebaseApp:     at com.google.firebase.auth.FirebaseAuth.zzb(Unknown Source)
[ERROR] :  FirebaseApp:     at com.google.firebase.auth.FirebaseAuth.getInstance(Unknown Source)
[ERROR] :  FirebaseApp:     ... 20 more
[ERROR] :  TiBaseActivity: (main) [49,261] Error dispatching lifecycle event: Given String is empty or null
[ERROR] :  TiBaseActivity: java.lang.IllegalArgumentException: Given String is empty or null
[ERROR] :  TiBaseActivity:  at com.google.android.gms.common.internal.zzbo.zzcF(Unknown Source)
[ERROR] :  TiBaseActivity:  at com.google.android.gms.internal.kh.<init>(Unknown Source)
[ERROR] :  TiBaseActivity:  at com.google.firebase.auth.FirebaseAuth.<init>(Unknown Source)
[ERROR] :  TiBaseActivity:  at com.google.android.gms.internal.lr.<init>(Unknown Source)
[ERROR] :  TiBaseActivity:  at com.google.firebase.auth.FirebaseAuth.zzb(Unknown Source)
[ERROR] :  TiBaseActivity:  at com.google.firebase.auth.FirebaseAuth.getInstance(Unknown Source)
[ERROR] :  TiBaseActivity:  at firebase.auth.TitaniumFirebaseAuthModule.onStart(TitaniumFirebaseAuthModule.java:75)
[ERROR] :  TiBaseActivity:  at org.appcelerator.titanium.TiLifecycle.fireLifecycleEvent(TiLifecycle.java:150)
[ERROR] :  TiBaseActivity:  at org.appcelerator.titanium.TiBaseActivity.onStart(TiBaseActivity.java:1401)
[ERROR] :  TiBaseActivity:  at org.appcelerator.titanium.TiLaunchActivity.onStart(TiLaunchActivity.java:413)
[ERROR] :  TiBaseActivity:  at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1237)
[ERROR] :  TiBaseActivity:  at android.app.Activity.performStart(Activity.java:6253)
[ERROR] :  TiBaseActivity:  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2379)
[ERROR] :  TiBaseActivity:  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
[ERROR] :  TiBaseActivity:  at android.app.ActivityThread.-wrap11(ActivityThread.java)
[ERROR] :  TiBaseActivity:  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
[ERROR] :  TiBaseActivity:  at android.os.Handler.dispatchMessage(Handler.java:102)
[ERROR] :  TiBaseActivity:  at android.os.Looper.loop(Looper.java:148)
[ERROR] :  TiBaseActivity:  at android.app.ActivityThread.main(ActivityThread.java:5417)
[ERROR] :  TiBaseActivity:  at java.lang.reflect.Method.invoke(Native Method)
[ERROR] :  TiBaseActivity:  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
[ERROR] :  TiBaseActivity:  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

My configuration

  Name                        = Mac OS X
  Version                     = 10.14.3
  Architecture                = 64bit
  # CPUs                      = 8
  Memory                      = 16.0GB

Node.js
  Node.js Version             = 8.9.1
  npm Version                 = 5.5.1

Titanium CLI
  CLI Version                 = 5.1.1
  node-appc Version           = 0.2.44

Titanium SDKs
  7.4.1.GA
    Version                   = 7.4.1
    Install Location          = /Users/ravindra/Library/Application Support/Titanium/mobilesdk/osx/7.4.1.GA
    Platforms                 = iphone, android
    git Hash                  = f47cf79a83
    git Timestamp             = 10/8/2018 17:44
    node-appc Version         = 0.2.45

Mac OS X
  Command Line Tools          = installed

Intelยฎ Hardware Accelerated Execution Manager (HAXM)
  Not installed

Java Development Kit
  Version                     = 1.8.0_162
  Java Home                   = /Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home

Genymotion
  Path                        = not found
  Genymotion Executable       = not found
  Genymotion Player           = not found
  Home                        = not found

VirtualBox
  Executable                  = not found
  Version                     = unknown

Android SDK
  Android Executable          = not found
  ADB Executable              = /Users/ravindra/Library/Android/sdk/platform-tools/adb
  SDK Path                    = /Users/ravindra/Library/Android/sdk

Android NDK
  NDK Path                    = /Users/ravindra/Library/Android/android-ndk-r12b
  NDK Version                 = 12.1.2977051

Android Platforms
  1) android-26
    Name                      = Android 8.0.0
    API Level                 = 26
    Revision                  = 1
    Skins                     = HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800, WVGA854, WXGA720, WXGA800, WXGA800-7in
    ABIs                      = 
    Path                      = /Users/ravindra/Library/Android/sdk/platforms/android-26
  2) android-27
    Name                      = Android 8.1.0
    API Level                 = 27
    Revision                  = 1
    Skins                     = HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800, WVGA854, WXGA720, WXGA800, WXGA800-7in
    ABIs                      = 
    Path                      = /Users/ravindra/Library/Android/sdk/platforms/android-27
  3) android-28
    Name                      = Android 9 (not supported by Titanium SDK 7.4.1.GA, but may work)
    API Level                 = 28
    Revision                  = 1
    Skins                     = HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800, WVGA854, WXGA720, WXGA800, WXGA800-7in
    ABIs                      = 
    Path                      = /Users/ravindra/Library/Android/sdk/platforms/android-28

Android Add-Ons
  4) Google Inc.:Google APIs:21
    Name                      = Google APIs (unknown) **Not supported by Titanium SDK 7.4.1.GA**
    Vendor                    = n/a
    Revision                  = 1
    Description               = n/a
    Skins                     = none
    ABIs                      = none
    Path                      = /Users/ravindra/Library/Android/sdk/add-ons/addon-google_apis-google-21
    Libraries                 = none
  5) Google Inc.:Google APIs:23
    Name                      = Google APIs (unknown) **Not supported by Titanium SDK 7.4.1.GA**
    Vendor                    = n/a
    Revision                  = 1
    Description               = n/a
    Skins                     = none
    ABIs                      = none
    Path                      = /Users/ravindra/Library/Android/sdk/add-ons/addon-google_apis-google-23
    Libraries                 = none

Android Emulators
  Nexus 5X API 27
    ID                        = Nexus_5X_API_27
    SDK Version               = not installed
    ABI                       = x86
    Skin                      = nexus_5x
    Path                      = /Users/ravindra/.android/avd/Nexus_5X_API_27.avd
    SD Card                   = /Users/ravindra/.android/avd/Nexus_5X_API_27.avd/sdcard.img
    Google APIs               = no

Genymotion Emulators
  None

Connected Android Devices
  None

Thanks!!

Wingee commented 5 years ago

I'm getting this error too. Did you manage to solve it @RavindraChherke ?

hansemannn commented 5 years ago

Which module versions do you use? And which Ti.PlayServices? @fahad86 is our new Firebase pro in regards to latest Play Services!

Wingee commented 5 years ago

I've just updated the core to 4.0.0 @hansemannn and that sorted the app crashing. I just noticed your PR 35 on this module. I'm guessing that should solve this problem...

hansemannn commented 5 years ago

Fixed with latest versions.