Android Question FacebookSdk missing error for FirebaseAuth using Facebook

superkan

Member
Licensed User
I am using B4A 8.30, Facebook SDK 4.14.0, I have completed all the steps in https://www.b4x.com/android/forum/threads/facebook-extends-firebaseauth-to-support-facebook.67954/
I think I am missing something from this instruction - Find a file named facebook-android-sdk-xx.xx.xx.aar in the SDK. You need to rename it to: facebook-android-sdk.aar and copy it to the additional libraries folder.

I have copied the facebook-android-sdk.aar to my additional lib folder and checked the path to it in the configure path window.
Still then, when I open the Erel provided example in the above mentioned URL,
  • I cannot see anything extra in my Libraries panel even after refresh/restart
  • FacebookSdk declaration line is red underlined and the error is shown.
I didn't try to install AppCompat Library since the facebook sdk is below 5. Also tried installing the older user-created-facebook-library but I see the types are different so has no effect on the problem. After many hours, many searches I am unable to resolve this error. Previously I have successfully done the authentication with google.

(An extra information - I also have B4A 9.30 installed to a different drive and pointing to different android sdk. Only the shared folder between the two IDE versions is the additional library folder which has just 2 or 3 component libraries in it.)

If these don't help I will post screenshots later.
 
Last edited:

Erel

Administrator
Staff member
Licensed User
I cannot see anything extra in my Libraries panel even after refresh/restart
This is expected. It is a dependency that is used by the Facebook library.
FacebookSdk declaration line is red underlined and the error is shown.
You need to add a reference to the Facebook library.
 

superkan

Member
Licensed User
...add a reference to the Facebook library.
Thank You. Can I know How to do that because what I knew so far is that you check a library to add it to the project (reference it?). Facebook Auth integration is already very complex. I have browsed top 4 links including (https://www.b4x.com/android/forum/threads/currency-converter-http-web-services-and-more.6506/) but unable to find. Everything points to the 'two files add to library' version.

What I have done so far
#AdditionalJar: facebook-android-sdk

Sub GetContext As JavaObject
Return GetBA.GetField("context")
End Sub

Sub GetBA As JavaObject
Dim jo As JavaObject
Dim cls As String = Me
cls = cls.SubString("class ".Length)
jo.InitializeStatic(cls)
Return jo.GetFieldJO("processBA")
End Sub
Doesn't remove the error in anyway.
 
Last edited:

superkan

Member
Licensed User
Hi, is there any one who can solve this issue. It has ruined the whole weekend and is shaking my faith in B4A. There is zero information on AAR additional library out there. How can people not come up with anything when it concerns Facebook.
 
Last edited:

superkan

Member
Licensed User
I have already completed all the steps there. But what is missing I am not getting.

1587285617759.png

1587285674992.png



1587285699000.png



Other additional libraries are picked up I have tested.
 

superkan

Member
Licensed User
Installed the facebook sdk files, updated the android sdk through sdk manager now I had a problem - firebase broken. But, followed through some other posts and replaced from the 'additional resources' the required folders in the updated and faulty android sdk. Every firebase maven error is gone. FacebookSdk is also recognized now. But, now when I compile, I run into this error in two of the projects including the attached facebook auth example.

Code:
B4A Version: 9.30
Java Version: 8
Parsing code.    (0.01s)
Building folders structure.    (0.02s)
Compiling code.    (0.02s)
Compiling layouts code.    (0.01s)
Organizing libraries.    (0.00s)
    (AndroidX SDK)
Generating R file.    (4.19s)
Compiling generated Java code.    Error
javac 1.8.0_151
src\mycompany\myapp\main.java:64: error: method startFromActivity in class StarterHelper cannot be applied to given types;
        if (anywheresoftware.b4a.objects.ServiceHelper.StarterHelper.startFromActivity(this, processBA, wl, false))
                                                                    ^
  required: BA,Runnable,boolean
  found: main,BA,WaitForLayout,boolean
  reason: actual and formal argument lists differ in length
Note: src\mycompany\myapp\starter.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
 

Erel

Administrator
Staff member
Licensed User
, updated the android sdk through sdk manager now I had a problem
Follow the installation instructions. It is not needed.

But, followed through some other posts and replaced from the 'additional resources' the required folders in the updated and faulty android sdk.
Same as above. Big mistake to follow all kinds of old threads instead of following the instructions: https://www.b4x.com/b4a.html

It will not work unless you carefully follow the instructions. Based on the error message you have corrupted the B4A and are using old versions of core libraries.

1. Delete B4A.
2. Make sure that the installation folder is empty.
3. Install B4A.
4. Delete Android SDK.
5. Follow the installation instructions.
 

superkan

Member
Licensed User
Actually the reason of updating the sdk was my mistake that I was having two B4A installations. Somewhere down the line it corrupted the two Android SDKs through the SDK Manager(referring to some common settings outside of the installation path?). And I needed to install some packages as described in the 'Appcompat' installation required for facebook sdk. This gave the 'index out of bounds error' (even if I started with empty SDK folders after installs) and I had to reinstall the sdks.

For the better, I am going to remove the older IDE completely and follow the instructions as above on a clean install of B4A 9.3 and tell you.
 
Last edited:

superkan

Member
Licensed User
1.Uninstalled everything. Folders removed (IDE and SDK). Installed latest IDE.
2. Followed instruction to setup android SDK (starting with extracted tools and adding folders from resources_zip). Installed recommended items as seen below:
1587393054226.png


3. from facebook-5.5.0.zip, put the xml and jar file in library folder. The other files of the zip were in additional folder since yesterday. Appcompat jar, aar, xml were in additional folder since yesterday.

4. Downloaded the facebook auth example project again, made the changes like added in manifest the app compat theme line, added in activity the extends appcompat line. Ensured the package name changed to firebase/facebook app related. Changed the manifest where the firebase/facebook app details were required. Set targetSdkVersion="28" following appcompat warning.

The libraries look like:
1587403887546.png


Additional Libraries Folder:
1587404207757.png

(Note: Except the appcompat and facebook related files in additional libraries, the others have not been cleared while redoing everything i.e. these other files are old now. Can these be a source of error.)

The app compiles fine but crashes just after launching with the following unfiltered log:

Markdown (GitHub flavored):
Logger connected to:  HUAWEI DUA-AL00
--------- beginning of crash
FATAL EXCEPTION: main
Process: mycompany.myapp, PID: 9194
java.lang.RuntimeException: Unable to create service mycompany.myapp.starter: java.lang.RuntimeException: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.firebase.auth.FirebaseAuth.addAuthStateListener(com.google.firebase.auth.FirebaseAuth$AuthStateListener)' on a null object reference
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:3560)
    at android.app.ActivityThread.-wrap4(Unknown Source:0)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1865)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:166)
    at android.app.ActivityThread.main(ActivityThread.java:6861)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:450)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.firebase.auth.FirebaseAuth.addAuthStateListener(com.google.firebase.auth.FirebaseAuth$AuthStateListener)' on a null object reference
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:233)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:176)
    at mycompany.myapp.starter.onCreate(starter.java:56)
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:3547)
    ... 8 more
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.firebase.auth.FirebaseAuth.addAuthStateListener(com.google.firebase.auth.FirebaseAuth$AuthStateListener)' on a null object reference
    at anywheresoftware.b4a.objects.FirebaseAuthWrapper.Initialize(FirebaseAuthWrapper.java:56)
    at mycompany.myapp.starter._service_create(starter.java:163)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:196)
    ... 11 more
--------- beginning of main
Application info not found.
Could not retrieve metadata, returning empty list of registrars.
FirebaseApp initialization successful
Could not get cmap table size!
: success to get AllImpl object and return....
: successes to get AllImpl object and return....
common created.
Starting remote logger. Port: 12161
CubicBezierInterpolator  mControlPoint1x = 0.23, mControlPoint1y = 0.06, mControlPoint2x = 0.09, mControlPoint2y = 0.97
CubicBezierInterpolator  mControlPoint1x = 0.6, mControlPoint1y = 0.9, mControlPoint2x = 0.8, mControlPoint2y = 1.0
CubicBezierInterpolator  mControlPoint1x = 0.23, mControlPoint1y = 0.06, mControlPoint2x = 0.09, mControlPoint2y = 0.97
CubicBezierInterpolator  mControlPoint1x = 0.6, mControlPoint1y = 0.9, mControlPoint2x = 0.8, mControlPoint2y = 1.0
Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat$2>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/view/View$OnUnhandledKeyEventListener;
  at void androidx.core.view.ViewCompat.setBackground(android.view.View, android.graphics.drawable.Drawable) (ViewCompat.java:2609)
  at void androidx.appcompat.widget.ActionBarContainer.<init>(android.content.Context, android.util.AttributeSet) (ActionBarContainer.java:63)
  at java.lang.Object java.lang.reflect.Constructor.newInstance0(java.lang.Object[]) (Constructor.java:-2)
  at java.lang.Object java.lang.reflect.Constructor.newInstance(java.lang.Object[]) (Constructor.java:334)
  at android.view.View android.view.LayoutInflater.createView(java.lang.String, java.lang.String, android.util.AttributeSet) (LayoutInflater.java:658)
  at android.view.View android.view.LayoutInflater.createViewFromTag(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet, boolean) (LayoutInflater.java:801)
  at android.view.View android.view.LayoutInflater.createViewFromTag(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet) (LayoutInflater.java:741)
  at void android.view.LayoutInflater.rInflate(org.xmlpull.v1.XmlPullParser, android.view.View, android.content.Context, android.util.AttributeSet, boolean) (LayoutInflater.java:874)
  at void android.view.LayoutInflater.rInflateChildren(org.xmlpull.v1.XmlPullParser, android.view.View, android.util.AttributeSet, boolean) (LayoutInflater.java:835)
  at android.view.View android.view.LayoutInflater.inflate(org.xmlpull.v1.XmlPullParser, android.view.ViewGroup, boolean) (LayoutInflater.java:515)
  at android.view.View android.view.LayoutInflater.inflate(int, android.view.ViewGroup, boolean) (LayoutInflater.java:423)
  at android.view.View android.view.LayoutInflater.inflate(int, android.view.ViewGroup) (LayoutInflater.java:374)
  at android.view.ViewGroup androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor() (AppCompatDelegateImpl.java:749)
  at void androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor() (AppCompatDelegateImpl.java:659)
  at void androidx.appcompat.app.AppCompatDelegateImpl.setContentView(android.view.View) (AppCompatDelegateImpl.java:543)
  at void androidx.appcompat.app.AppCompatActivity.setContentView(android.view.View) (AppCompatActivity.java:166)
  at void mycompany.myapp.main.onCreate(android.os.Bundle) (main.java:61)
  at void android.app.Activity.performCreate(android.os.Bundle, android.os.PersistableBundle) (Activity.java:7110)
  at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:7101)
  at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1214)
  at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2922)
  at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:3047)
  at void android.app.ActivityThread.-wrap11(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1)
  at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1777)
  at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:106)
  at void android.os.Looper.loop() (Looper.java:166)
  at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6861)
  at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:-2)
  at void com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run() (RuntimeInit.java:450)
  at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:936)
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.View$OnUnhandledKeyEventListener" on path: DexPathList[[zip file "/data/app/mycompany.myapp--K1MXEa-zIX21lfoKMJu7g==/base.apk"],nativeLibraryDirectories=[/data/app/mycompany.myapp--K1MXEa-zIX21lfoKMJu7g==/lib/arm64, /system/lib64, /vendor/lib64]]
  at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:125)
  at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379)
  at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
  at void androidx.core.view.ViewCompat.setBackground(android.view.View, android.graphics.drawable.Drawable) (ViewCompat.java:2609)
  at void androidx.appcompat.widget.ActionBarContainer.<init>(android.content.Context, android.util.AttributeSet) (ActionBarContainer.java:63)
  at java.lang.Object java.lang.reflect.Constructor.newInstance0(java.lang.Object[]) (Constructor.java:-2)
  at java.lang.Object java.lang.reflect.Constructor.newInstance(java.lang.Object[]) (Constructor.java:334)
  at android.view.View android.view.LayoutInflater.createView(java.lang.String, java.lang.String, android.util.AttributeSet) (LayoutInflater.java:658)
  at android.view.View android.view.LayoutInflater.createViewFromTag(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet, boolean) (LayoutInflater.java:801)
  at android.view.View android.view.LayoutInflater.createViewFromTag(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet) (LayoutInflater.java:741)
  at void android.view.LayoutInflater.rInflate(org.xmlpull.v1.XmlPullParser, android.view.View, android.content.Context, android.util.AttributeSet, boolean) (LayoutInflater.java:874)
  at void android.view.LayoutInflater.rInflateChildren(org.xmlpull.v1.XmlPullParser, android.view.View, android.util.AttributeSet, boolean) (LayoutInflater.java:835)
  at android.view.View android.view.LayoutInflater.inflate(org.xmlpull.v1.XmlPullParser, android.view.ViewGroup, boolean) (LayoutInflater.java:515)
  at android.view.View android.view.LayoutInflater.inflate(int, android.view.ViewGroup, boolean) (LayoutInflater.java:423)
  at android.view.View android.view.LayoutInflater.inflate(int, android.view.ViewGroup) (LayoutInflater.java:374)
  at android.view.ViewGroup androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor() (AppCompatDelegateImpl.java:749)
  at void androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor() (AppCompatDelegateImpl.java:659)
  at void androidx.appcompat.app.AppCompatDelegateImpl.setContentView(android.view.View) (AppCompatDelegateImpl.java:543)
  at void androidx.appcompat.app.AppCompatActivity.setContentView(android.view.View) (AppCompatActivity.java:166)
  at void mycompany.myapp.main.onCreate(android.os.Bundle) (main.java:61)
  at void android.app.Activity.performCreate(android.os.Bundle, android.os.PersistableBundle) (Activity.java:7110)
  at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:7101)
  at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1214)
  at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2922)
  at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:3047)
  at void android.app.ActivityThread.-wrap11(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1)
  at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1777)
  at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:106)
  at void android.os.Looper.loop() (Looper.java:166)
  at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6861)
  at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:-2)
  at void com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run() (RuntimeInit.java:450)
  at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:936)
Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat$2>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/view/View$OnUnhandledKeyEventListener;
  at void androidx.core.view.ViewCompat.setBackground(android.view.View, android.graphics.drawable.Drawable) (ViewCompat.java:2609)
  at void androidx.appcompat.widget.ActionBarContainer.<init>(android.content.Context, android.util.AttributeSet) (ActionBarContainer.java:63)
  at java.lang.Object java.lang.reflect.Constructor.newInstance0(java.lang.Object[]) (Constructor.java:-2)
  at java.lang.Object java.lang.reflect.Constructor.newInstance(java.lang.Object[]) (Constructor.java:334)
  at android.view.View android.view.LayoutInflater.createView(java.lang.String, java.lang.String, android.util.AttributeSet) (LayoutInflater.java:658)
  at android.view.View android.view.LayoutInflater.createViewFromTag(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet, boolean) (LayoutInflater.java:801)
  at android.view.View android.view.LayoutInflater.createViewFromTag(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet) (LayoutInflater.java:741)
  at void android.view.LayoutInflater.rInflate(org.xmlpull.v1.XmlPullParser, android.view.View, android.content.Context, android.util.AttributeSet, boolean) (LayoutInflater.java:874)
  at void android.view.LayoutInflater.rInflateChildren(org.xmlpull.v1.XmlPullParser, android.view.View, android.util.AttributeSet, boolean) (LayoutInflater.java:835)
  at android.view.View android.view.LayoutInflater.inflate(org.xmlpull.v1.XmlPullParser, android.view.ViewGroup, boolean) (LayoutInflater.java:515)
  at android.view.View android.view.LayoutInflater.inflate(int, android.view.ViewGroup, boolean) (LayoutInflater.java:423)
  at android.view.View android.view.LayoutInflater.inflate(int, android.view.ViewGroup) (LayoutInflater.java:374)
  at android.view.ViewGroup androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor() (AppCompatDelegateImpl.java:749)
  at void androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor() (AppCompatDelegateImpl.java:659)
  at void androidx.appcompat.app.AppCompatDelegateImpl.setContentView(android.view.View) (AppCompatDelegateImpl.java:543)
  at void androidx.appcompat.app.AppCompatActivity.setContentView(android.view.View) (AppCompatActivity.java:166)
  at void mycompany.myapp.main.onCreate(android.os.Bundle) (main.java:61)
  at void android.app.Activity.performCreate(android.os.Bundle, android.os.PersistableBundle) (Activity.java:7110)
  at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:7101)
  at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1214)
  at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2922)
  at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:3047)
  at void android.app.ActivityThread.-wrap11(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1)
  at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1777)
  at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:106)
  at void android.os.Looper.loop() (Looper.java:166)
  at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6861)
  at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:-2)
  at void com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run() (RuntimeInit.java:450)
  at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:936)
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.View$OnUnhandledKeyEventListener" on path: DexPathList[[zip file "/data/app/mycompany.myapp--K1MXEa-zIX21lfoKMJu7g==/base.apk"],nativeLibraryDirectories=[/data/app/mycompany.myapp--K1MXEa-zIX21lfoKMJu7g==/lib/arm64, /system/lib64, /vendor/lib64]]
  at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:125)
  at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379)
  at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
  at void androidx.core.view.ViewCompat.setBackground(android.view.View, android.graphics.drawable.Drawable) (ViewCompat.java:2609)
  at void androidx.appcompat.widget.ActionBarContainer.<init>(android.content.Context, android.util.AttributeSet) (ActionBarContainer.java:63)
  at java.lang.Object java.lang.reflect.Constructor.newInstance0(java.lang.Object[]) (Constructor.java:-2)
  at java.lang.Object java.lang.reflect.Constructor.newInstance(java.lang.Object[]) (Constructor.java:334)
  at android.view.View android.view.LayoutInflater.createView(java.lang.String, java.lang.String, android.util.AttributeSet) (LayoutInflater.java:658)
  at android.view.View android.view.LayoutInflater.createViewFromTag(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet, boolean) (LayoutInflater.java:801)
  at android.view.View android.view.LayoutInflater.createViewFromTag(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet) (LayoutInflater.java:741)
  at void android.view.LayoutInflater.rInflate(org.xmlpull.v1.XmlPullParser, android.view.View, android.content.Context, android.util.AttributeSet, boolean) (LayoutInflater.java:874)
  at void android.view.LayoutInflater.rInflateChildren(org.xmlpull.v1.XmlPullParser, android.view.View, android.util.AttributeSet, boolean) (LayoutInflater.java:835)
  at android.view.View android.view.LayoutInflater.inflate(org.xmlpull.v1.XmlPullParser, android.view.ViewGroup, boolean) (LayoutInflater.java:515)
  at android.view.View android.view.LayoutInflater.inflate(int, android.view.ViewGroup, boolean) (LayoutInflater.java:423)
  at android.view.View android.view.LayoutInflater.inflate(int, android.view.ViewGroup) (LayoutInflater.java:374)
  at android.view.ViewGroup androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor() (AppCompatDelegateImpl.java:749)
  at void androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor() (AppCompatDelegateImpl.java:659)
  at void androidx.appcompat.app.AppCompatDelegateImpl.setContentView(android.view.View) (AppCompatDelegateImpl.java:543)
  at void androidx.appcompat.app.AppCompatActivity.setContentView(android.view.View) (AppCompatActivity.java:166)
  at void mycompany.myapp.main.onCreate(android.os.Bundle) (main.java:61)
  at void android.app.Activity.performCreate(android.os.Bundle, android.os.PersistableBundle) (Activity.java:7110)
  at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:7101)
  at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1214)
  at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2922)
  at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:3047)
  at void android.app.ActivityThread.-wrap11(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1)
  at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1777)
  at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:106)
  at void android.os.Looper.loop() (Looper.java:166)
  at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6861)
  at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:-2)
  at void com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run() (RuntimeInit.java:450)
  at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:936)
Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat$2>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/view/View$OnUnhandledKeyEventListener;
  at void androidx.core.view.ViewCompat.setBackground(android.view.View, android.graphics.drawable.Drawable) (ViewCompat.java:2609)
  at void androidx.appcompat.widget.ActionBarContainer.<init>(android.content.Context, android.util.AttributeSet) (ActionBarContainer.java:63)
  at java.lang.Object java.lang.reflect.Constructor.newInstance0(java.lang.Object[]) (Constructor.java:-2)
  at java.lang.Object java.lang.reflect.Constructor.newInstance(java.lang.Object[]) (Constructor.java:334)
  at android.view.View android.view.LayoutInflater.createView(java.lang.String, java.lang.String, android.util.AttributeSet) (LayoutInflater.java:658)
  at android.view.View android.view.LayoutInflater.createViewFromTag(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet, boolean) (LayoutInflater.java:801)
  at android.view.View android.view.LayoutInflater.createViewFromTag(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet) (LayoutInflater.java:741)
  at void android.view.LayoutInflater.rInflate(org.xmlpull.v1.XmlPullParser, android.view.View, android.content.Context, android.util.AttributeSet, boolean) (LayoutInflater.java:874)
  at void android.view.LayoutInflater.rInflateChildren(org.xmlpull.v1.XmlPullParser, android.view.View, android.util.AttributeSet, boolean) (LayoutInflater.java:835)
  at android.view.View android.view.LayoutInflater.inflate(org.xmlpull.v1.XmlPullParser, android.view.ViewGroup, boolean) (LayoutInflater.java:515)
  at android.view.View android.view.LayoutInflater.inflate(int, android.view.ViewGroup, boolean) (LayoutInflater.java:423)
  at android.view.View android.view.LayoutInflater.inflate(int, android.view.ViewGroup) (LayoutInflater.java:374)
  at android.view.ViewGroup androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor() (AppCompatDelegateImpl.java:749)
  at void androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor() (AppCompatDelegateImpl.java:659)
  at void androidx.appcompat.app.AppCompatDelegateImpl.setContentView(android.view.View) (AppCompatDelegateImpl.java:543)
  at void androidx.appcompat.app.AppCompatActivity.setContentView(android.view.View) (AppCompatActivity.java:166)
  at void mycompany.myapp.main.onCreate(android.os.Bundle) (main.java:61)
  at void android.app.Activity.performCreate(android.os.Bundle, android.os.PersistableBundle) (Activity.java:7110)
  at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:7101)
  at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1214)
  at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2922)
  at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:3047)
  at void android.app.ActivityThread.-wrap11(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1)
  at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1777)
  at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:106)
  at void android.os.Looper.loop() (Looper.java:166)
  at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6861)
  at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:-2)
  at void com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run() (RuntimeInit.java:450)
  at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:936)
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.View$OnUnhandledKeyEventListener" on path: DexPathList[[zip file "/data/app/mycompany.myapp--K1MXEa-zIX21lfoKMJu7g==/base.apk"],nativeLibraryDirectories=[/data/app/mycompany.myapp--K1MXEa-zIX21lfoKMJu7g==/lib/arm64, /system/lib64, /vendor/lib64]]
  at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:125)
  at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379)
  at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
  at void androidx.core.view.ViewCompat.setBackground(android.view.View, android.graphics.drawable.Drawable) (ViewCompat.java:2609)
  at void androidx.appcompat.widget.ActionBarContainer.<init>(android.content.Context, android.util.AttributeSet) (ActionBarContainer.java:63)
Tried compiling an older app on firebase admob ads that previously worked. It also crashes on start up. Couldn't get the logs in release or debug modes. So, its an overall firebase problem and may be not related to facebook auth. Other apps without all these are running fine.
 

Attachments

Last edited:

superkan

Member
Licensed User
I think it is better to solve the Authentication issue first. I don't need AdMob right now. I was just testing the previously working admob project. So the project is actually, the example attached in your post in facebookAuth post.

Somewhere else in a firebase not working post in 2020, you told about a workaround method to get Firebase working. Is that any different from above steps and need to be followed in my case?
 
Last edited:

superkan

Member
Licensed User
Thank you Erel. Problem is solved.

For anyone (including me for future reference), to minimize log based de-bugging of crashing app/non-compiling app:
1. Examples attached to formal threads may be old (manifest, lib version, missing parameter/flag declaration etc.)
2. Important pieces of instruction may be later and scattered in between posts (like the jetifier related post here #308 )
3. Use bookmarks to mark posts highlighting problems that you will tend to overlook often, and organize them.
4. Pay attention to security certificates thing - local(keystore file) and in remote(SHA/Firebase console) if you start an app by copying an existing working one and then later point it to a different firebase app/project. The key dialog box has memo with lot of contents wrapped in it (if you tend to modify things only when you see them)
5. Way below in the SDK Manager you can see the extra things which may not be recommended for the right reasons but the libraries need it (with nothing ever notifying you to install them except the instructions and the runtime errors)
6. SDK Manager will have recommendations from time to time as you keep referencing the libraries.
7. If you have made it too much messy with all the mix of lib versions, sdk packages etc go for clean install with full folder wipe-out (leftovers from uninstall i.e. libraries etc)
8. Watch a thread to know about the latest happenings on that topic.

apart from that, some temporary rules and ones i haven't verified yet:
1. you may look at the jetifier in the end for runtime errors.
2. take snapshots of sdk, additional libraries and libraries (you cannot reverse on the sdk perhaps because of tree like branching relationships)
4. most of the time take out the libraries from snapshots as they are demanded in the IDE or you will mess up the old and new versions.
3. B4A download page has latest things even with same looking name of files. Internal libs are already updated in the new setup files.
4. I started with tools + (extract from the resources_zip) for my latest case.
5. I had problem with multiple version installation of the IDE at different drives (was not needed actually).


self bookmarking this.
 
Last edited:
Top