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

Embed chat as a fragment feature #70

Closed
picaro opened this issue Aug 12, 2021 · 6 comments
Closed

Embed chat as a fragment feature #70

picaro opened this issue Aug 12, 2021 · 6 comments

Comments

@picaro
Copy link

picaro commented Aug 12, 2021

android.view.InflateException: Binary XML file line #31: Binary XML file line #31: Error inflating class fragment
Caused by: android.view.InflateException: Binary XML file line #31: Error inflating class fragment
Caused by: android.app.Fragment$InstantiationException: Unable to instantiate fragment im.crisp.sdk.ui.CrispFragment: make sure class name exists, is public, and has an empty constructor that is public
    at android.app.Fragment.instantiate(Fragment.java:538)
    at android.app.FragmentContainer.instantiate(FragmentContainer.java:53)
    at android.app.FragmentManagerImpl.onCreateView(FragmentManager.java:3551)
    at android.app.FragmentController.onCreateView(FragmentController.java:103)
    at android.app.Activity.onCreateView(Activity.java:6445)
    at androidx.fragment.app.FragmentActivity.onCreateView(FragmentActivity.java:300)
    at io.github.inflationx.viewpump.internal.-ViewPumpLayoutInflater$PrivateWrapperFactory2ViewCreator.onCreateView(-ViewPumpLayoutInflater.kt:422)
    at io.github.inflationx.viewpump.internal.-FallbackViewCreationInterceptor.intercept(-FallbackViewCreationInterceptor.kt:14)
    at io.github.inflationx.viewpump.internal.-InterceptorChain.proceed(-InterceptorChain.kt:30)
    at io.github.inflationx.viewpump.ViewPump.inflate(ViewPump.kt:36)
    at io.github.inflationx.viewpump.internal.-ViewPumpLayoutInflater$PrivateWrapperFactory2.onCreateView(-ViewPumpLayoutInflater.kt:399)
    at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:186)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:780)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
    at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
    at io.github.inflationx.viewpump.internal.-ViewPumpLayoutInflater.inflate(-ViewPumpLayoutInflater.kt:57)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
    at io.github.inflationx.viewpump.internal.-ViewPumpLayoutInflater.inflate(-ViewPumpLayoutInflater.kt:48)
    at com.workingbricks.rentitapp.presentation.core.AbstractFragment.onCreateView(AbstractFragment.java:94)
    at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2963)
    at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:518)
    at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:282)
    at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2189)
    at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2100)
    at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2002)
    at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3138)
    at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:3072)
    at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:251)
    at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:502)
    at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:246)
    at com.workingbricks.rentitapp.presentation.core.AbstractActivity.onStart(AbstractActivity.java:111)
    at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1391)
    at android.app.Activity.performStart(Activity.java:7348)
    at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3140)
    at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:180)
    at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:165)
    at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:142)
    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)

E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1950)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7073)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964)
Caused by: java.lang.ClassNotFoundException: Didn't find class "im.crisp.sdk.ui.CrispFragment" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.workingbricks.rentitapp-EZi5GAFS0Id3MrQt2MujNg==/base.apk"],nativeLibraryDirectories=[/data/app/com.workingbricks.rentitapp-EZi5GAFS0Id3MrQt2MujNg==/lib/arm64, /data/app/com.workingbricks.rentitapp-EZi5GAFS0Id3MrQt2MujNg==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.Fragment.instantiate(Fragment.java:524)

@picaro
Copy link
Author

picaro commented Aug 12, 2021

ah, found.

<\fragment
android:name="im.crisp.sdk.ui.CrispFragment"
android:tag="crisp_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="0dp" />

but what can use instead now?

@baptistejamin
Copy link
Member

Hi there! Our tech team will get back to you on this as soon as possible. Thank you for your patience. :)

@picaro
Copy link
Author

picaro commented Aug 12, 2021

Hi @baptistejamin , I replaced my own fragments with

Intent crispIntent = new Intent(this, ChatActivity.class);
startActivity(crispIntent);

and it works.
Thanks!
As I understood a new version will have no possibility to run as a fragment? Correct?

@Doc1faux
Copy link
Collaborator

Hello @picaro and thank your for your feedback.

Indeed, the new Android native SDK was not intended to run in a fragment but we discussed of it internally as mentioned in #67 (comment) and it could come back in a future release, stay tuned :)

@Doc1faux
Copy link
Collaborator

Supporting SDK to be integrated as a fragment will require the hosting activity to be able to restart from Activity.recreate() method in order to:

  • apply chat theme on 1st launch and each time you change it in your website settings on Crisp website or each time you switch of website from the app,
  • apply set locale each time you call it (see Set app locale feature #62).

Unfortunately, this method seems to crash on Xiaomi devices :/ (see #99)

@Doc1faux Doc1faux changed the title Didn't find class "im.crisp.sdk.ui.CrispFragment" with version 1.0.7 Embed chat as a fragment feature Jun 9, 2022
@Doc1faux
Copy link
Collaborator

Finally, this feature has been dropped in our roadmap as in the next release, Crisp will be displayed as BottomSheet instead.

So closing this issue.

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

No branches or pull requests

3 participants