NativeScript / nativescript-facebook

NativeScript plugin, wrapper of native Facebook SDK for Android and iOS
Apache License 2.0
79 stars 50 forks source link

Cannot read property 'setAutoLogAppEventsEnabled' of undefined #94

Closed johnRosalin closed 6 years ago

johnRosalin commented 6 years ago

I am trying to use this plugin for my android application but when I try to initialize facebook I am getting this error System.err: TypeError: Cannot read property 'setAutoLogAppEventsEnabled' of undefined

This error occurs on version 2.2.2

here is the full error log

System.err: java.lang.RuntimeException: Unable to start activity ComponentInfo{org.nativescript.hiveapp/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: System.err: Calling js method onCreate failed System.err: System.err: TypeError: Cannot read property 'setAutoLogAppEventsEnabled' of undefined System.err: File: "file:///data/data/org.nativescript.hiveapp/files/app/tns_modules/nativescript-facebook/login-manager.js, line: 15, column: 28 System.err: System.err: StackTrace: System.err: Frame: function:'init', file:'file:///data/data/org.nativescript.hiveapp/files/app/tns_modules/nativescript-facebook/login-manager.js', line: 15, column: 29 System.err: Frame: function:'', file:'file:///data/data/org.nativescript.hiveapp/files/app/app.module.js', line: 10, column: 14 System.err: Frame: function:'Observable.notify', file:'file:///data/data/org.nativescript.hiveapp/files/app/tns_modules/tns-core-modules/data/observable/observable.js', line: 103, column: 23 System.err: Frame: function:'ActivityCallbacksImplementation.notifyLaunch', file:'file:///data/data/org.nativescript.hiveapp/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 621, column: 21 System.err: Frame: function:'ActivityCallbacksImplementation.onCreate', file:'file:///data/data/org.nativescript.hiveapp/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 585, column: 29 System.err: Frame: function:'NativeScriptActivity.onCreate', file:'file:///data/data/org.nativescript.hiveapp/files/app/tns_modules/tns-core-modules/ui/frame/activity.js', line: 20, column: 25 System.err: System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778) System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856) System.err: at android.app.ActivityThread.-wrap11(Unknown Source:0) System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589) System.err: at android.os.Handler.dispatchMessage(Handler.java:106) System.err: at android.os.Looper.loop(Looper.java:164) System.err: at android.app.ActivityThread.main(ActivityThread.java:6494) System.err: at java.lang.reflect.Method.invoke(Native Method) System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) System.err: Caused by: com.tns.NativeScriptException: System.err: Calling js method onCreate failed System.err: System.err: TypeError: Cannot read property 'setAutoLogAppEventsEnabled' of undefined System.err: File: "file:///data/data/org.nativescript.hiveapp/files/app/tns_modules/nativescript-facebook/login-manager.js, line: 15, column: 28 System.err: System.err: StackTrace: System.err: Frame: function:'init', file:'file:///data/data/org.nativescript.hiveapp/files/app/tns_modules/nativescript-facebook/login-manager.js', line: 15, column: 29 System.err: Frame: function:'', file:'file:///data/data/org.nativescript.hiveapp/files/app/app.module.js', line: 10, column: 14 System.err: Frame: function:'Observable.notify', file:'file:///data/data/org.nativescript.hiveapp/files/app/tns_modules/tns-core-modules/data/observable/observable.js', line: 103, column: 23 System.err: Frame: function:'ActivityCallbacksImplementation.notifyLaunch', file:'file:///data/data/org.nativescript.hiveapp/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 621, column: 21 System.err: Frame: function:'ActivityCallbacksImplementation.onCreate', file:'file:///data/data/org.nativescript.hiveapp/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 585, column: 29 System.err: Frame: function:'NativeScriptActivity.onCreate', file:'file:///data/data/org.nativescript.hiveapp/files/app/tns_modules/tns-core-modules/ui/frame/activity.js', line: 20, column: 25 System.err: System.err: at com.tns.Runtime.callJSMethodNative(Native Method) System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088) System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:970) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:957) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:941) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:933) System.err: at com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:13) System.err: at android.app.Activity.performCreate(Activity.java:7009) System.err: at android.app.Activity.performCreate(Activity.java:7000) System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214) System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731) System.err: ... 9 more

johnRosalin commented 6 years ago

i apologize I didn't realize there was already a similar issue with this. but i was able to fix this issue by removing the android platform then rebuilding the it.