How to use a bottom sheet dialog from navigation ui component - android

I'm using nav graph for internal navigations. Now I want to open a bottom sheet dialog fragment using nav_graph.
I tried adding
<dialog
android:id="#+id/ItemBottomSheetFragment"
android:name="xxxxxxx.fragments.InvoiceItemBottomSheetFragment"
tools:layout="#layout/fragment_invoice_item_bottom_sheet"
android:label="ItemBottomSheetFragment" />
But my app crashes when I launch it.
Crash report
2019-11-23 18:42:13.393 16111-16111/xxxxxxxxxxxxx E/AndroidRuntime: FATAL EXCEPTION: main
Process: xxxxxxxxxxxxx, PID: 16111
java.lang.RuntimeException: Unable to start activity ComponentInfo{xxxxxxxxxxxxx/xxxxxxxxxxxxx.MainActivity}: android.view.InflateException: Binary XML file line #17: Binary XML file line #17: Error inflating class fragment
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: android.view.InflateException: Binary XML file line #17: Binary XML file line #17: Error inflating class fragment
Caused by: android.view.InflateException: Binary XML file line #17: Error inflating class fragment
Caused by: java.lang.RuntimeException: Exception inflating xxxxxxxxxxxxx:navigation/nav_graph line 266
at androidx.navigation.NavInflater.inflate(NavInflater.java:90)
at androidx.navigation.NavController.setGraph(NavController.java:447)
at androidx.navigation.NavController.setGraph(NavController.java:429)
at androidx.navigation.fragment.NavHostFragment.onCreate(NavHostFragment.java:226)
at androidx.fragment.app.Fragment.performCreate(Fragment.java:2528)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:843)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1135)
at androidx.fragment.app.FragmentManagerImpl.addFragment(FragmentManagerImpl.java:1391)
at androidx.fragment.app.FragmentManagerImpl.onCreateView(FragmentManagerImpl.java:3123)
at androidx.fragment.app.FragmentController.onCreateView(FragmentController.java:134)
at androidx.fragment.app.FragmentActivity.dispatchFragmentsOnCreateView(FragmentActivity.java:360)
at androidx.fragment.app.FragmentActivity.onCreateView(FragmentActivity.java:339)
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 android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:537)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)
at androidx.databinding.DataBindingUtil.setContentView(DataBindingUtil.java:303)
at androidx.databinding.DataBindingUtil.setContentView(DataBindingUtil.java:284)
at xxxxxxxxxxxxx.MainActivity.onCreate(MainActivity.kt:19)
at android.app.Activity.performCreate(Activity.java:7136)
at android.app.Activity.performCreate(Activity.java:7127)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
2019-11-23 18:42:13.395 16111-16111/xxxxxxxxxxxxx E/AndroidRuntime: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.IllegalStateException: Could not find Navigator with name "dialog". You must call NavController.addNavigator() for each navigation type.
at androidx.navigation.NavigatorProvider.getNavigator(NavigatorProvider.java:98)
at androidx.navigation.NavInflater.inflate(NavInflater.java:100)
at androidx.navigation.NavInflater.inflate(NavInflater.java:132)
at androidx.navigation.NavInflater.inflate(NavInflater.java:81)

Previously I was using navigation UI version 2.0.0
After upgrading to 2.1.0, it's working fine

Related

Launch new, external Activity, from Flutter android MainActivity

I'm trying to write some native code in my Flutter app to integrate with Zendesk using their SDK. Thus far, my Flutter app has not required me to drop down and write any actual native code, so I'm getting a bit stuck here. What I have looks like this:
public class MainActivity extends FlutterActivity {
private static final String ZENDESK_CHANNEL = "zendesk";
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
GeneratedPluginRegistrant.registerWith(this);
new MethodChannel(getFlutterView(), ZENDESK_CHANNEL).setMethodCallHandler(
this::invokeZendesk);
}
private void invokeZendesk(MethodCall call, MethodChannel.Result result) {
if (call.method.equals("init")) {
Zendesk.INSTANCE.init(this, "https://myapp.zendesk.com",
"myappid",
"myclientid");
Identity identity = new AnonymousIdentity();
Zendesk.INSTANCE.setIdentity(identity);
Support.INSTANCE.init(Zendesk.INSTANCE);
} else if (call.method.equals("launch")) {
RequestActivity.builder().show(this);
}
}
...
When I invoke the "launch" code I get this error:
E/AndroidRuntime(18326): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mypackage.myapp/zendesk.support.request.RequestActivity}: android.view.InflateException: Binary XML file line #10: Binary XML file line #10: Error inflating class com.google.android.material.appbar.AppBarLayout
E/AndroidRuntime(18326): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913)
E/AndroidRuntime(18326): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
E/AndroidRuntime(18326): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
E/AndroidRuntime(18326): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
E/AndroidRuntime(18326): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
E/AndroidRuntime(18326): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
E/AndroidRuntime(18326): at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime(18326): at android.os.Looper.loop(Looper.java:193)
E/AndroidRuntime(18326): at android.app.ActivityThread.main(ActivityThread.java:6669)
E/AndroidRuntime(18326): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(18326): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/AndroidRuntime(18326): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
E/AndroidRuntime(18326): Caused by: android.view.InflateException: Binary XML file line #10: Binary XML file line #10: Error inflating class com.google.android.material.appbar.AppBarLayout
E/AndroidRuntime(18326): Caused by: android.view.InflateException: Binary XML file line #10: Error inflating class com.google.android.material.appbar.AppBarLayout
E/AndroidRuntime(18326): Caused by: java.lang.reflect.InvocationTargetException
E/AndroidRuntime(18326): at java.lang.reflect.Constructor.newInstance0(Native Method)
E/AndroidRuntime(18326): at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
E/AndroidRuntime(18326): at android.view.LayoutInflater.createView(LayoutInflater.java:647)
E/AndroidRuntime(18326): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
E/AndroidRuntime(18326): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
E/AndroidRuntime(18326): at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
E/AndroidRuntime(18326): at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
E/AndroidRuntime(18326): at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
E/AndroidRuntime(18326): at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
E/AndroidRuntime(18326): at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
E/AndroidRuntime(18326): at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:555)
E/AndroidRuntime(18326): at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)
E/AndroidRuntime(18326): at zendesk.support.request.RequestActivity.onCreate(RequestActivity.java:85)
E/AndroidRuntime(18326): at android.app.Activity.performCreate(Activity.java:7136)
E/AndroidRuntime(18326): at android.app.Activity.performCreate(Activity.java:7127)
E/AndroidRuntime(18326): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
E/AndroidRuntime(18326): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
E/AndroidRuntime(18326): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
E/AndroidRuntime(18326): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
E/AndroidRuntime(18326): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
E/AndroidRuntime(18326): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
E/AndroidRuntime(18326): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
E/AndroidRuntime(18326): at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime(18326): at android.os.Looper.loop(Looper.java:193)
E/AndroidRuntime(18326): at android.app.ActivityThread.main(ActivityThread.java:6669)
E/AndroidRuntime(18326): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(18326): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/AndroidRuntime(18326): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
E/AndroidRuntime(18326): Caused by: java.lang.IllegalArgumentException: The style on this component requires your app theme to be Theme.AppCompat (or a descendant).
E/AndroidRuntime(18326): at com.google.android.material.internal.ThemeEnforcement.checkTheme(ThemeEnforcement.java:221)
E/AndroidRuntime(18326): at com.google.android.material.internal.ThemeEnforcement.checkAppCompatTheme(ThemeEnforcement.java:196)
E/AndroidRuntime(18326): at com.google.android.material.internal.ThemeEnforcement.checkCompatibleTheme(ThemeEnforcement.java:131)
E/AndroidRuntime(18326): at com.google.android.material.internal.ThemeEnforcement.obtainStyledAttributes(ThemeEnforcement.java:72)
E/AndroidRuntime(18326): at com.google.android.material.appbar.ViewUtilsLollipop.setStateListAnimatorFromAttrs(ViewUtilsLollipop.java:45)
E/AndroidRuntime(18326): at com.google.android.material.appbar.AppBarLayout.<init>(AppBarLayout.java:183)
E/AndroidRuntime(18326): ... 28 more
When googling for that particular error I find some things about ensuring that you create an AppCompat theme for your activity, etc. but since this is not my own activity that I'm trying to launch, I'm not really sure what to do here.

My app keep closing in the emulator after migrate to androidx. Does anyone have solution for this?

I just migrated to androidx. For some reason, my app keeps crashing whenever I use it in the emulator. I need help
I have been searching on the Internet for hours but have not seen any solution for that. I also examine my logcat but I do not get the error
2019-10-16 18:33:11.287 7763-7763/com.example.recyclerview E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.recyclerview, PID: 7763
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.recyclerview/com.example.recyclerview.MainActivity}: android.view.InflateException: Binary XML file line #2: Binary XML file line #2: Error inflating class androidx.core.widget.DrawerLayout
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: android.view.InflateException: Binary XML file line #2: Binary XML file line #2: Error inflating class androidx.core.widget.DrawerLayout
Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class androidx.core.widget.DrawerLayout
Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.core.widget.DrawerLayout" on path: DexPathList[[zip file "/data/app/com.example.recyclerview-gS5TXhudi0GJX8tyIujcvA==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.recyclerview-gS5TXhudi0GJX8tyIujcvA==/lib/x86, /system/lib]]
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.view.LayoutInflater.createView(LayoutInflater.java:606)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.example.recyclerview.MainActivity.onCreate(MainActivity.java:40)
at android.app.Activity.performCreate(Activity.java:7136)
at android.app.Activity.performCreate(Activity.java:7127)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
In the activity java and xml file with drawer layout replace androidx.core.widget.DrawerLayou with androidx.drawerlayout.widget.DrawerLayout. If you can't see it directly, use find option and search the string directly.
try to change androidx.core.widget.DrawerLayout with androidx.drawerlayout.widget.DrawerLayout
Your error message says your layout used in com.example.recyclerview.MainActivity.onCreate contains the class androidx.core.widget.DrawerLayout, but the package name for DrawerLayout is androidx.drawerlayout.widget.DrawerLayout. Correct your layout to use the right class name.

Arcore fragment crashes on startup

Just started with ARCore. I want to display a simple 3d model on a plane. I am using version 1.10.0 of ARCore. When I start up the app the app crashes with the stacktrace below:
This is my layout
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<fragment
android:id="#+id/ar_fragment"
android:name="com.google.ar.sceneform.ux.ArFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<include
android:id="#+id/overlay"
layout="#layout/overlay"
app:showOverlay="#{showOverlay}" />
</FrameLayout>
I use databinding to inflate a layout. I have no Idea what I am doing wrong. It looks like the ArFragment can not be found.
2019-07-23 14:05:15.209 12108-12108/com.icapps.arcapps E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.icapps.arcapps, PID: 12108
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.icapps.arcapps/com.icapps.arcapps.activity.products.PlantDetailActivity}: android.view.InflateException: Binary XML file line #23: Binary XML file line #23: Error inflating class fragment
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3037)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3172)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1906)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6863)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: android.view.InflateException: Binary XML file line #23: Binary XML file line #23: Error inflating class fragment
Caused by: android.view.InflateException: Binary XML file line #23: Error inflating class fragment
Caused by: androidx.fragment.app.Fragment$InstantiationException: Unable to instantiate fragment com.google.ar.sceneform.ux.ArFragment: calling Fragment constructor caused an exception
at androidx.fragment.app.Fragment.instantiate(Fragment.java:532)
at androidx.fragment.app.FragmentContainer.instantiate(FragmentContainer.java:57)
at androidx.fragment.app.FragmentManagerImpl$6.instantiate(FragmentManagerImpl.java:2850)
at androidx.fragment.app.FragmentManagerImpl.onCreateView(FragmentManagerImpl.java:3195)
at androidx.fragment.app.FragmentController.onCreateView(FragmentController.java:134)
at androidx.fragment.app.FragmentActivity.dispatchFragmentsOnCreateView(FragmentActivity.java:357)
at androidx.fragment.app.FragmentActivity.onCreateView(FragmentActivity.java:336)
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 android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:545)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)
at androidx.databinding.DataBindingUtil.setContentView(DataBindingUtil.java:303)
at androidx.databinding.DataBindingUtil.setContentView(DataBindingUtil.java:284)
at com.icapps.arcapps.activity.products.PlantDetailActivity.onCreate(PlantDetailActivity.kt:39)
at android.app.Activity.performCreate(Activity.java:7149)
at android.app.Activity.performCreate(Activity.java:7140)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1288)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3017)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3172)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1906)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6863)
2019-07-23 14:05:15.210 12108-12108/com.icapps.arcapps E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at androidx.fragment.app.Fragment.instantiate(Fragment.java:514)
... 33 more
Caused by: java.lang.BootstrapMethodError: Exception from call site #38 bootstrap method
at com.google.ar.sceneform.ux.BaseArFragment.<init>(BaseArFragment.java:97)
at com.google.ar.sceneform.ux.ArFragment.<init>(ArFragment.java:35)
... 36 more
Caused by: java.lang.ClassCastException: Bootstrap method returned null
... 38 more
2019-07-23 14:05:15.211 12108-12108/com.icapps.arcapps E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.icapps.arcapps, PID: 12108
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.icapps.arcapps/com.icapps.arcapps.activity.products.PlantDetailActivity}: android.view.InflateException: Binary XML file line #23: Binary XML file line #23: Error inflating class fragment
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3037)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3172)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1906)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6863)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: android.view.InflateException: Binary XML file line #23: Binary XML file line #23: Error inflating class fragment
Caused by: android.view.InflateException: Binary XML file line #23: Error inflating class fragment
Caused by: androidx.fragment.app.Fragment$InstantiationException: Unable to instantiate fragment com.google.ar.sceneform.ux.ArFragment: calling Fragment constructor caused an exception
at androidx.fragment.app.Fragment.instantiate(Fragment.java:532)
at androidx.fragment.app.FragmentContainer.instantiate(FragmentContainer.java:57)
at androidx.fragment.app.FragmentManagerImpl$6.instantiate(FragmentManagerImpl.java:2850)
at androidx.fragment.app.FragmentManagerImpl.onCreateView(FragmentManagerImpl.java:3195)
at androidx.fragment.app.FragmentController.onCreateView(FragmentController.java:134)
at androidx.fragment.app.FragmentActivity.dispatchFragmentsOnCreateView(FragmentActivity.java:357)
at androidx.fragment.app.FragmentActivity.onCreateView(FragmentActivity.java:336)
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 android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:545)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)
at androidx.databinding.DataBindingUtil.setContentView(DataBindingUtil.java:303)
at androidx.databinding.DataBindingUtil.setContentView(DataBindingUtil.java:284)
at com.icapps.arcapps.activity.products.PlantDetailActivity.onCreate(PlantDetailActivity.kt:39)
at android.app.Activity.performCreate(Activity.java:7149)
at android.app.Activity.performCreate(Activity.java:7140)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1288)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3017)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3172)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1906)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6863)
2019-07-23 14:05:15.212 12108-12108/com.icapps.arcapps E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at androidx.fragment.app.Fragment.instantiate(Fragment.java:514)
... 33 more
Caused by: java.lang.BootstrapMethodError: Exception from call site #38 bootstrap method
at com.google.ar.sceneform.ux.BaseArFragment.<init>(BaseArFragment.java:97)
at com.google.ar.sceneform.ux.ArFragment.<init>(ArFragment.java:35)
... 36 more
Caused by: java.lang.ClassCastException: Bootstrap method returned null
... 38 more```
I forgot to add the compile options
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

Account kit crashes in splitscreen mode

I have trouble with account kit, it crashes on entering phone number screen in split screen mode.
Im using next dependencies with last versions.
implementation 'com.facebook.android:account-kit-sdk:4.34.0'
Here is stacktrace:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.appname.dev, PID: 25576
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.appname.dev/com.facebook.accountkit.ui.AccountKitActivity}: android.view.InflateException: Binary XML file line #26: Binary XML file line #26: Error inflating class TextView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2831)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2906)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4778)
at android.app.ActivityThread.-wrap18(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1611)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:172)
at android.app.ActivityThread.main(ActivityThread.java:6637)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Caused by: android.view.InflateException: Binary XML file line #26: Binary XML file line #26: Error inflating class TextView
Caused by: android.view.InflateException: Binary XML file line #26: Error inflating class TextView
Caused by: java.lang.UnsupportedOperationException: Can't convert value at index 37 to dimension: type=0x1
at android.content.res.TypedArray.getDimensionPixelSize(TypedArray.java:730)
at android.view.View.<init>(View.java:4998)
at android.widget.TextView.<init>(TextView.java:824)
at android.widget.TextView.<init>(TextView.java:818)
at android.support.v7.widget.ab.<init>(AppCompatTextView.java:76)
at android.support.v7.widget.ab.<init>(AppCompatTextView.java:72)
at android.support.v7.app.AppCompatViewInflater.a(AppCompatViewInflater.java:176)
at android.support.v7.app.AppCompatViewInflater.a(AppCompatViewInflater.java:101)
at android.support.v7.app.j.b(AppCompatDelegateImplV9.java:1035)
at android.support.v7.app.j.onCreateView(AppCompatDelegateImplV9.java:1092)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:772)
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 android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at com.facebook.accountkit.ui.be$a.a(TitleFragmentFactory.java:87)
at com.facebook.accountkit.ui.ai.onCreateView(LoginFragment.java:43)
at com.facebook.accountkit.ui.be$a.onCreateView(TitleFragmentFactory.java:50)
at android.app.Fragment.performCreateView(Fragment.java:2611)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1276)
at android.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1549)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1611)
at android.app.FragmentManagerImpl.dispatchMoveToState(FragmentManager.java:3039)
at android.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:2991)
at android.app.FragmentController.dispatchActivityCreated(FragmentController.java:178)
at android.app.Activity.performCreateCommon(Activity.java:6969)
at android.app.Activity.performCreate(Activity.java:6977)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2784)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2906)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4778)
at android.app.ActivityThread.-wrap18(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1611)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:172)
at android.app.ActivityThread.main(ActivityThread.java:6637)
E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Android 8.0
Xiaomi Mi A1

AuthUI.IdpConfig.EmailBuilder() inflate view error

I need to use firebase-ui-auth in my programm...
// Choose authentication providers
List providers = Arrays.asList(
new AuthUI.IdpConfig.EmailBuilder().build(),
new AuthUI.IdpConfig.GoogleBuilder().build());
// Create and launch sign-in intent
caller.startActivityForResult(
AuthUI.getInstance()
.createSignInIntentBuilder()
.setAvailableProviders(providers)
.build(),
RC_SIGN_IN);`
and function very good (I call this in my mainActivity)...
but, when I choose only: AuthUI.IdpConfig.EmailBuilder() the app crashes, because there is some problem to inflate xml...
error code:
Process: com.superena.superenaactivity, PID: 6516
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.superena.superenaactivity/com.firebase.ui.auth.ui.email.EmailActivity}: android.view.InflateException: Binary XML file line #24: Binary XML file line #24: Error inflating class android.support.design.widget.TextInputLayout
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: android.view.InflateException: Binary XML file line #24: Binary XML file line #24: Error inflating class android.support.design.widget.TextInputLayout
Caused by: android.view.InflateException: Binary XML file line #24: Error inflating class android.support.design.widget.TextInputLayout
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:334)
at android.view.LayoutInflater.createView(LayoutInflater.java:647)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
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.rInflate(LayoutInflater.java:866)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:866)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at com.firebase.ui.auth.ui.email.CheckEmailFragment.onCreateView(CheckEmailFragment.java:89)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:2335)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1423)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1754)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1822)
at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:797)
at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2591)
at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2378)
at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2333)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2240)
at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3243)
at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:3195)
at android.support.v4.app.FragmentController.dispatchActivityCreated(FragmentController.java:195)
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:596)
at android.support.v7.app.AppCompatActivity.onStart(AppCompatActivity.java:177)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1334)
at android.app.Activity.performStart(Activity.java:7029)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2741)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
06-27 12:54:24.320 6516-6516/com.superena.superenaactivity E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.lang.NoSuchFieldError: No static field error_color_material of type I in class Landroid/support/v7/appcompat/R$color; or its superclasses (declaration of 'android.support.v7.appcompat.R$color' appears in /data/app/com.superena.superenaactivity-reFM-WL6EH7D2KJRxYTXFw==/split_lib_slice_2_apk.apk)
at android.support.design.widget.TextInputLayout.setErrorEnabled(TextInputLayout.java:654)
at android.support.design.widget.TextInputLayout.<init>(TextInputLayout.java:257)
at android.support.design.widget.TextInputLayout.<init>(TextInputLayout.java:187)
... 40 more
with the two options it works very well; with only new AuthUI.IdpConfig.EmailBuilder().build());don't functions, if somebody can help me, please
I face same problem. Solved it by adding this
compile 'com.android.support:design:28.0.0'
into dependencies of app level gradle file.

Categories

Resources