Code Monkey home page Code Monkey logo

Comments (10)

gusmarra avatar gusmarra commented on September 14, 2024 1

Hi stewwan, I found the issue. It is running again.
Thanks

from firebase-analytics.

stewones avatar stewones commented on September 14, 2024

can you try again from 2.0.1 ?

from firebase-analytics.

gusmarra avatar gusmarra commented on September 14, 2024

Now it is not working at all. When you try to run it on a device you got the following error

E/AndroidRuntime: FATAL EXCEPTION: main
Process: ------, PID: 12408
java.lang.RuntimeException: Unable to start activity ComponentInfo{----/----.MainActivity}: android.view.InflateException: Binary XML file line #2: Binary XML file line #2: Error inflating class androidx.coordinatorlayout.widget.CoordinatorLayout
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2957)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3032)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
at android.os.Handler.dispatchMessage(Handler.java:105)

from firebase-analytics.

stewones avatar stewones commented on September 14, 2024

Are you targeting android 29? Please give it a try with a clean install from capacitor v2

from firebase-analytics.

gusmarra avatar gusmarra commented on September 14, 2024

Capacitor V2 is still beta. Is there a way I can install again the previous version of the plugin?

from firebase-analytics.

stewones avatar stewones commented on September 14, 2024

Sure you can try removing node_modules, package.lock and npm install [email protected]

Then npx cap sync android

from firebase-analytics.

gusmarra avatar gusmarra commented on September 14, 2024

Thanks. I was able to roll it back but I am getting the following error

Uncaught (in promise): TypeError: Cannot read property 'logEvent' of undefined
TypeError: Cannot read property 'logEvent' of undefined

After the update this code was working.

Just using

import { Analytics } from 'capacitor-analytics';
const analytics = new Analytics();

ngOnInit() {
analytics.logEvent({
name: 'view',
params: { page: 'carrito' }
});
}

Also try placing the code on the constructor.

Thanks

from firebase-analytics.

stewones avatar stewones commented on September 14, 2024

sounds like js api is broken.

you can try using capacitor api directly

import { Plugins } from '@capacitor/core';
const { AnalyticsPlugin } = Plugins;

//...

AnalyticsPlugin.logEvent(...)

also don't forget to initialise the plugin in java code as described on readme
add(AnalyticsPlugin.class);

from firebase-analytics.

gusmarra avatar gusmarra commented on September 14, 2024

Still the same. I have init the plugin

import io.stewan.capacitor.analytics.AnalyticsPlugin;
//...

add(AnalyticsPlugin.class);

from firebase-analytics.

stewones avatar stewones commented on September 14, 2024

nice @gusmarra. feel free to report any new issue.

from firebase-analytics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.