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

Android: FirebaseCore.configure() error #19

Closed
Astrovic opened this issue Jun 7, 2018 · 4 comments
Closed

Android: FirebaseCore.configure() error #19

Astrovic opened this issue Jun 7, 2018 · 4 comments

Comments

@Astrovic
Copy link
Contributor

Astrovic commented Jun 7, 2018

On android I'm using:

  • TiSDK 7.1.1.GA
  • firebase.core 2.2.0
  • firebase.analytics 2.1.0
  • ti.playservices 11.8.0
  • hyperloop 3.0.5
  • Alloy project

this is my android manifest:

<android xmlns:android="http://schemas.android.com/apk/res/android">
  <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="it.testApps.aaaa" android:versionCode="1" android:versionName="1.1">
    <application>
      <!-- Firebase required -->
      <service android:name="com.google.android.gms.measurement.AppMeasurementService" android:enabled="true" android:exported="false"/>
      <service android:name="com.google.android.gms.measurement.AppMeasurementJobService" android:permission="android.permission.BIND_JOB_SERVICE" android:enabled="true" android:exported="false"/>
      <service android:name="it.testApps.aaaa.gcm.RegistrationIntentService" android:exported="false"/>
      <receiver android:name="com.google.android.gms.measurement.AppMeasurementReceiver" android:enabled="true">
        <intent-filter>
          <action android:name="com.google.android.gms.measurement.UPLOAD"/>
        </intent-filter>
      </receiver>
      <service android:name="it.testApps.aaaa.gcm.GcmIntentService" android:exported="false">
        <intent-filter>
          <action android:name="com.google.android.c2dm.intent.RECEIVE"/>
        </intent-filter>
      </service>
      <service android:name="it.testApps.aaaa.gcm.GcmIntentService" android:exported="false">
        <intent-filter>
          <action android:name="com.google.android.c2dm.intent.SEND"/>
        </intent-filter>
      </service>
      <service android:name="it.testApps.aaaa.gcm.GcmIDListenerService" android:exported="false">
        <intent-filter>
          <action android:name="com.google.android.gms.iid.InstanceID"/>
        </intent-filter>
      </service>
    </application>
  </manifest>
</androi

and I added <string name="google_app_id">"xxxxxxxxxxx"</string> to the \platform\android\res\values\string.xml file.

In my controller, on the open window event listener, I've this:

var FirebaseCore = require('firebase.core');
FirebaseCore.configure({
  //file: "google-services.json",
  APIKey: "AIzaSyxxxxxxxxx",
  projectID: "api-project-.....",
  storageBucket: "api-project-xxxxxxxxxxx.appspot.com",
  applicationID: "1:xxxxxxxxxxx:android:xxxxxxxxxxx",
});
var FirebaseAnalytics = require('firebase.analytics');
FirebaseAnalytics.log('test_event', {});

I tested also using only FirebaseCore.configure({file: "google-services.json}). The file is on /app/assets/android

But the app crash with this error:

[WARN]  W/System.err: java.lang.NoSuchMethodError: No static method zzh(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String; in class Lcom/google/android/gms/common/internal/zzbo; or its super classes (declaration of 'com.google.android.gms.common.internal.zzbo' appears in /data/app/it.testApps.aaaa-1/base.apk)
[WARN]  W/System.err: 	at com.google.firebase.FirebaseOptions$Builder.setApiKey(Unknown Source)
[WARN]  W/System.err: 	at firebase.core.TitaniumFirebaseCoreModule.configure(TitaniumFirebaseCoreModule.java:108)
[WARN]  W/System.err: 	at org.appcelerator.kroll.runtime.v8.V8Function.nativeInvoke(Native Method)
[WARN]  W/System.err: 	at org.appcelerator.kroll.runtime.v8.V8Function.callSync(V8Function.java:55)
[WARN]  W/System.err: 	at org.appcelerator.kroll.runtime.v8.V8Function.call(V8Function.java:41)
[WARN]  W/System.err: 	at ti.modules.titanium.TitaniumModule$Timer.run(TitaniumModule.java:166)
[WARN]  W/System.err: 	at android.os.Handler.handleCallback(Handler.java:751)
[WARN]  W/System.err: 	at android.os.Handler.dispatchMessage(Handler.java:95)
[WARN]  W/System.err: 	at android.os.Looper.loop(Looper.java:154)
[WARN]  W/System.err: 	at android.app.ActivityThread.main(ActivityThread.java:6119)
[WARN]  W/System.err: 	at java.lang.reflect.Method.invoke(Native Method)
[WARN]  W/System.err: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
[WARN]  W/System.err: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
[ERROR] TiExceptionHandler: (main) [285,5281] ----- Titanium Javascript Runtime Error -----
[ERROR] TiExceptionHandler: (main) [0,5281] - In /alloy/controllers/index.js:129,17
[ERROR] TiExceptionHandler: (main) [0,5281] - Message: Uncaught No static method zzh(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String; in class Lcom/google/android/gms/common/internal/zzbo; or its super classes (declaration of 'com.google.android.gms.common.internal.zzbo' appears in /data/app/it.testApps.aaaa-1/base.apk)
[ERROR] TiExceptionHandler: (main) [0,5281] - Source: 			FirebaseCore.configure({
[ERROR] V8Exception: Exception occurred at /alloy/controllers/index.js:129: Uncaught No static method zzh(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String; in class Lcom/google/android/gms/common/internal/zzbo; or its super classes (declaration of 'com.google.android.gms.common.internal.zzbo' appears in /data/app/it.testApps.aaaa-1/base.apk)
[ERROR] V8Exception: No static method zzh(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String; in class Lcom/google/android/gms/common/internal/zzbo; or its super classes (declaration of 'com.google.android.gms.common.internal.zzbo' appears in /data/app/it.testApps.aaaa-1/base.apk)
@Astrovic
Copy link
Contributor Author

Astrovic commented Jun 7, 2018

I did several tests. The problem is probably in the latest release of the firebase.analytics module.
If I use the android version firebase.analytics 2.0.1 and the ti.playservice 11.0.40, the problem does not occur.
If I use the android version firebase.analytics 2.1.0 and theti.playservice 11.0.40 o the last ti.playservice 11.8.0, the problem appears.

So there is something conflicting using the latest versions of firebase.analytics 2.1.0 and firebase.core 2.2.0 and ti.playservice 11.8.0

@hansemannn
Copy link
Owner

Addressed in Firebase Analytics 2.1.1

@Abdelalim-dev
Copy link

Abdelalim-dev commented Dec 5, 2018

I had the same issue with firebase.core 3.0.0 and ti.playservice 11.8.0.
I set ti.playservice version to 11.0.40 to get things working.

@hansemannn
Copy link
Owner

@Abdelalim-dev v11.8.0 is still a prerelease and should not be used so far.

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

No branches or pull requests

3 participants