Chat SDK - Support for Android X

16 Comments

  • Greg - Community Manager
    Comment actions Permalink

    Hi WeWALK Admin! Could you tell me exactly what you have located in line 13 that is referenced in your error message?

    -1
  • WeWALK Admin
    Comment actions Permalink

    Hi Greg. This is your SDK's layout (zui_view_messaging) . So I cannot look line 13 what you have located

    0
  • Greg - Community Manager
    Comment actions Permalink

    I see in the ticket that was created that you are using AndroidX. The agent pointed out that you would need to utilize Jetifier in order to get this working. Can you confirm that you have done this? 

    0
  • WeWALK Admin
    Comment actions Permalink

    Hello Greg,

    Sorry for the delayed response.

    We've enabled jetifier. The result is same as we shared. Is there any tutorial about AndroidX? Hope to solve this issue as soon as possible.

    Thanks

    0
  • WeWALK Admin
    Comment actions Permalink

    Also is there any open sdk? If we see the source, we may understand the cause of the problem.

    0
  • André Tessmer
    Comment actions Permalink

    It's crashing on my app as well.

    Here is the full stack trace:

    Caused by java.lang.UnsupportedOperationException: Failed to resolve attribute at index 13: TypedValue{t=0x2/d=0x7f0400bb a=6}
    at android.content.res.TypedArray.getDrawableForDensity(TypedArray.java:996)
    at android.content.res.TypedArray.getDrawable(TypedArray.java:980)
    at android.view.View.<init>(View.java:5700)
    at android.view.ViewGroup.<init>(ViewGroup.java:687)
    at android.view.ViewGroup.<init>(ViewGroup.java:683)
    at androidx.appcompat.widget.Toolbar.<init>(Toolbar.java:236)
    at androidx.appcompat.widget.Toolbar.<init>(Toolbar.java:232)
    at java.lang.reflect.Constructor.newInstance0(Constructor.java)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
    at android.view.LayoutInflater.createView(LayoutInflater.java:854)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1006)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:1233)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:1119)
    at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:682)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:481)
    at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:555)
    at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)
    at com.zopim.android.sdk.prechat.ZopimChatActivity.onCreate(ZopimChatActivity.java:47)
    at android.app.Activity.performCreate(Activity.java:7955)
    at android.app.Activity.performCreate(Activity.java:7944)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3463)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3635)
    at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2175)
    at android.os.Handler.dispatchMessage(Handler.java:107)
    at android.os.Looper.loop(Looper.java:237)
    at android.app.ActivityThread.main(ActivityThread.java:7857)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076)

     

    Any ETA to get it fixed?

    1
  • Greg - Community Manager
    Comment actions Permalink

    It looks like the release on June 7 did not include the fix for AndroidX. Apologies for the information yesterday and I will keep you updated when it has been released.

    1
  • WeWALK Admin
    Comment actions Permalink

    Hello Greg,

    Looking forward to getting an update. We think the problem is about UI. If your strategy allow to see source code, we can always contribute to it.

    Best wishes and thanks...

    1
  • Jorge
    Comment actions Permalink

    Hello,

    I found that this exception occurs when the android:theme attribute is defined in the <activity> declaration instead of the <application> one in the Manifest file.

    0
  • Dwayne Hoy
    Comment actions Permalink

    Is there an ETA on a fix? Or is there a workaround available?

    0
  • André Tessmer
    Comment actions Permalink

    It is still crashing for me, even using the latest version of the libraries:

    implementation 'com.zendesk:support:4.0.0'
    implementation 'com.zopim.android:sdk:1.4.8'


    Here is the crash stack trace:

    2020-07-30 17:08:42.670 8704-8704/myapp E/AndroidRuntime: FATAL EXCEPTION: main
    Process: myapp, PID: 8704
    java.lang.RuntimeException: Unable to start activity ComponentInfo{myapp/com.zopim.android.sdk.prechat.ZopimChatActivity}: android.view.InflateException: Binary XML file line #9 in myapp:layout/zopim_chat_activity: Binary XML file line #2 in myapp:layout/zopim_toolbar: Error inflating class <unknown>
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3270)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
    at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
    at android.os.Handler.dispatchMessage(Handler.java:107)
    at android.os.Looper.loop(Looper.java:214)
    at android.app.ActivityThread.main(ActivityThread.java:7356)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
    Caused by: android.view.InflateException: Binary XML file line #9 in myapp:layout/zopim_chat_activity: Binary XML file line #2 in myapp:layout/zopim_toolbar: Error inflating class <unknown>
    Caused by: android.view.InflateException: Binary XML file line #2 in myapp:layout/zopim_toolbar: Error inflating class <unknown>
    Caused by: java.lang.reflect.InvocationTargetException
    at java.lang.reflect.Constructor.newInstance0(Native Method)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
    at android.view.LayoutInflater.createView(LayoutInflater.java:854)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1006)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:1233)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:1119)
    at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:682)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:481)
    at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:555)
    at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)
    at com.zopim.android.sdk.prechat.ZopimChatActivity.onCreate(ZopimChatActivity.java:47)
    at android.app.Activity.performCreate(Activity.java:7802)
    at android.app.Activity.performCreate(Activity.java:7791)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
    at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
    at android.os.Handler.dispatchMessage(Handler.java:107)
    at android.os.Looper.loop(Looper.java:214)
    at android.app.ActivityThread.main(ActivityThread.java:7356)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
    Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 13: TypedValue{t=0x2/d=0x7f0400c3 a=6}
    at android.content.res.TypedArray.getDrawableForDensity(TypedArray.java:996)
    at android.content.res.TypedArray.getDrawable(TypedArray.java:980)
    2020-07-30 17:08:42.670 8704-8704/myapp E/AndroidRuntime: at android.view.View.<init>(View.java:5254)
    at android.view.ViewGroup.<init>(ViewGroup.java:675)
    at android.view.ViewGroup.<init>(ViewGroup.java:671)
    at androidx.appcompat.widget.Toolbar.<init>(Toolbar.java:236)
    at androidx.appcompat.widget.Toolbar.<init>(Toolbar.java:232)
    ... 28 more

     

    startActivity(Intent(context, ZopimChatActivity::class.java))


    This is the theme that I am using on my app:

    <style name="Base.MaterialThemeBuilder" parent="Theme.MaterialComponents.DayNight.NoActionBar">


    Can someone help me out here, please? It's months since this issue was reported and yet no fix for it.

    0
  • Greg - Community Manager
    Comment actions Permalink

    Hi all that are still experiencing this issue! Could you take a Jorge's post to see if that resolves the issue for you?

    1
  • André Tessmer
    Comment actions Permalink

    We set our theme in the <application> tag, and just in this tag. That fix doesn't work for me.

    <application
    android:name=".TownSqApplication"
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:requestLegacyExternalStorage="true"
    android:theme="@style/TsqCommunitiesTheme.DayNight"
    tools:replace="android:icon">

     

    Here is our theme tree:

    <style name="TsqCommunitiesTheme.DayNight" parent="Base.Theme">
    <style name="Base.Theme" parent="Base.MaterialThemeBuilder">
    <style name="Base.MaterialThemeBuilder" parent="Theme.MaterialComponents.DayNight.NoActionBar">


    As you can see by the end of all our custom themes, we extend "Theme.MaterialComponents.DayNight.NoActionBar" 


    0
  • Greg - Community Manager
    Comment actions Permalink

    Thanks for the update. I know that our SDK team is working on something for later this month/early next month that may resolve some of these issues. I'll share this with them and ask someone to drop a line in here next week to see what help they can offer.

    0
  • André Tessmer
    Comment actions Permalink

    Thanks for the update guys, it fixed my problem with the styles, but now I'm having trouble while adding the visitor information.

    I am following the Migration guide.

    Previously I had something like this:

    VisitorInfo visitorInfo = new VisitorInfo.Builder()
                    .email(user?.email)
                    .name(user?.fullName())
    .note(getUserRole(user, condo))
    .note(condo?.name) .build(); ZopimChat.setVisitorInfo(visitorInfo);

     

    And now, this is what I have:

    val profileProvider = Chat.INSTANCE.providers()?.profileProvider() ?: return

    val visitorInfo: VisitorInfo = VisitorInfo.builder()
    .withName(user?.fullName())
    .withEmail(user?.email)
    .build()

    profileProvider.setVisitorInfo(visitorInfo, null)
    profileProvider.setVisitorNote(condo?.name.orEmpty(), null)
    profileProvider.setVisitorNote(getUserRole(user, condo).orEmpty(), null)


    And it doesn't work. If I add the callbacks, every setVisitorInfo() gives me "error_ack_timeout" as error reason.

    Any idea on how to fix it?

    1

Please sign in to leave a comment.

Powered by Zendesk