androidx

AndroidTests stopped building after adding androidx.fragment:fragment-testing dependency

邮差的信 提交于 2020-04-13 07:02:28
问题 After I have added fragment-testing dependency to my project: // Testing dependencies espressoVersion = '3.2.0-beta01' testCoreVersion = '1.1.0' runnerVersion = '1.1.0' extJunitVersion = '1.1.0' testRulesVersion = '1.1.0' fragmentVersion = '1.1.0-alpha09' orchestratorVersion = '1.1.0' uiAutomatorVersion = '2.2.0' junitVersion = '4.12' mockitoVersion = '2.7.22' robolectricVersion = '4.2.1' liveDataTestingVersion = '1.1.0' androidArchCoreTestingVersion = '2.0.0' androidTestImplementation(

Robolectric AndroidX fragments NoClassDefFoundError

吃可爱长大的小学妹 提交于 2020-04-10 07:23:30
问题 After migration of code and tests to AndroidX , all seems to work pretty well, however Robolectric junit tests for two fragments are failing due to NoClassDefFoundError: androidx/fragment/testing/R$style exception. The stack trace: java.lang.NoClassDefFoundError: androidx/fragment/testing/R$style at androidx.fragment.app.testing.FragmentScenario$EmptyFragmentActivity.onCreate(FragmentScenario.java:79) at android.app.Activity.performCreate(Activity.java:5933) at android.app.Instrumentation

Robolectric AndroidX fragments NoClassDefFoundError

旧时模样 提交于 2020-04-10 07:21:25
问题 After migration of code and tests to AndroidX , all seems to work pretty well, however Robolectric junit tests for two fragments are failing due to NoClassDefFoundError: androidx/fragment/testing/R$style exception. The stack trace: java.lang.NoClassDefFoundError: androidx/fragment/testing/R$style at androidx.fragment.app.testing.FragmentScenario$EmptyFragmentActivity.onCreate(FragmentScenario.java:79) at android.app.Activity.performCreate(Activity.java:5933) at android.app.Instrumentation

Robolectric AndroidX fragments NoClassDefFoundError

时间秒杀一切 提交于 2020-04-10 07:21:07
问题 After migration of code and tests to AndroidX , all seems to work pretty well, however Robolectric junit tests for two fragments are failing due to NoClassDefFoundError: androidx/fragment/testing/R$style exception. The stack trace: java.lang.NoClassDefFoundError: androidx/fragment/testing/R$style at androidx.fragment.app.testing.FragmentScenario$EmptyFragmentActivity.onCreate(FragmentScenario.java:79) at android.app.Activity.performCreate(Activity.java:5933) at android.app.Instrumentation

Error inflating class android.webkit.WebView on android 5

落爺英雄遲暮 提交于 2020-04-10 03:41:28
问题 I got the following error testing on Android 5.0 (API 21). Tested on other OS versions works well. java.lang.RuntimeException: Unable to start activity ComponentInfo{...ui.activities.navigationActivity.fragments.legalFragment.LegalDetailActivity}: android.view.InflateException: Binary XML file line #24: Error inflating class android.webkit.WebView Can't find nothing special about the xml layout, at line 24: <WebView android:id="@+id/nav_fg_legal_detail_web" android:layout_width="match_parent"

Error inflating class android.webkit.WebView on android 5

懵懂的女人 提交于 2020-04-10 03:39:59
问题 I got the following error testing on Android 5.0 (API 21). Tested on other OS versions works well. java.lang.RuntimeException: Unable to start activity ComponentInfo{...ui.activities.navigationActivity.fragments.legalFragment.LegalDetailActivity}: android.view.InflateException: Binary XML file line #24: Error inflating class android.webkit.WebView Can't find nothing special about the xml layout, at line 24: <WebView android:id="@+id/nav_fg_legal_detail_web" android:layout_width="match_parent"

Get current fragment with ViewPager2

与世无争的帅哥 提交于 2020-04-07 17:42:32
问题 I'm migrating my ViewPager to ViewPager2 since the latter is supposed to solve all the problems of the former. Unfortunately, when using it with a FragmentStateAdapter , I don't find any way to get the currently displayed fragment. viewPager.getCurrentItem() gives the current displayed index and adapter.getItem(index) generally creates a new Fragment for the current index. Unless keeping a reference to all created fragments in getItem() , I have no idea how to access the currently displayed

Different android support versions in packages?

生来就可爱ヽ(ⅴ<●) 提交于 2020-03-25 18:40:50
问题 I am trying to adapt the classytaxi app to androidx: I needed to get multidex activated (in the gradle file, the manifest had already a name field asigned to .SubApp in the application Tag, see manifest snippet). I get this error: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/internal/zzbgl; [...] Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.internal.zzbgl" on path: DexPathList [...] according to that question, the

Different android support versions in packages?

断了今生、忘了曾经 提交于 2020-03-25 18:38:17
问题 I am trying to adapt the classytaxi app to androidx: I needed to get multidex activated (in the gradle file, the manifest had already a name field asigned to .SubApp in the application Tag, see manifest snippet). I get this error: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/internal/zzbgl; [...] Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.internal.zzbgl" on path: DexPathList [...] according to that question, the

With API 28 and “androidx.appcompat” library project says “AppCompatActivity” symbol not found

天大地大妈咪最大 提交于 2020-02-26 12:05:01
问题 I updated my build and target version to 28 (Pie) and replaced the relevant dependencies. Now my project says Symbol not found on AppCompatActivity . I have tried to Clean project Rebuild project Invalidate Caches / Restart But the result is the same. Moreover when I try Ctrl + Space after extends keyword in activity class there is no "AppCompatActivity suggestion. I tried to investigate if its present in libraries folder, it's present there. Now, what should I do to make it work? If there is