草庐IT

$androidx

全部标签

未找到 AndroidX MultiDex

我正在创建一个新的android项目,并决定使用新的AndroidX替代支持库,可以在此处找到相关文档:https://developer.android.com/jetpack/androidx/migrate.我严格按照步骤操作,在同步gradle后,我可以访问androidx命名空间和其中包含的各种类。但是,在创建我的应用程序类时,我想继承自androidx.multidex.MultiDexApplication(可以在上面链接的表格中看到)。但是,整个multidex包并不存在。有人解决过这个问题吗?有什么指点吗? 最佳答案

android - 使用 API 28 和 "androidx.appcompat"库项目表示找不到 "AppCompatActivity"符号

我将构建版本和目标版本更新为28(Pie)并替换了相关依赖项。现在我的项目显示在AppCompatActivity上找不到Symbol。我试过了清理项目重建项目使缓存无效/重新启动但结果是一样的。此外,当我在Activity类中的扩展关键字之后尝试Ctrl+Space时,没有"AppCompatActivity建议。我试图调查它是否存在于libraries文件夹,它就在那里。现在,我应该怎么做才能让它发挥作用?如果androidx库有任何变化/替代方案,请告诉我。这是我完整的build.gradle文件applyplugin:'com.android.application'apply

AndroidX 包 android.support.design.R 不存在

当我将我的项目转换为AndroidX时,我遇到了error:packageandroid.support.design.Rdoesnotexistandroid.support.design.R.styleable.FloatingActionButton_Behavior_Layout);有什么办法解决吗? 最佳答案 我找到了解决方案,只需替换这一行android.support.design.R.与com.google.android.material.R. 关于AndroidX包a

android - SearchView 因通货膨胀错误而崩溃 (androidx) - 未找到资源异常

我的其中一个布局中有一个SearchView,并且在某些设备上发生附加崩溃。问题是找不到abc_textfield_search_material资源。但是我没有直接使用这个资源,因为我的xml布局看起来像下面这样:有什么解决办法吗?这种崩溃只发生在少数设备上(不到1%),大多数设备都能正常工作。我已经在考虑将其更改为带有复合可绘制对象的TextView,但也许有比避免使用SearchView更好的解决方案堆栈跟踪java.lang.RuntimeException:Unabletopauseactivity{com.my.app/com.my.app.MainActivity}:an

androidx.constraintlayout.widget.constraintlayout 没有可以拖动的链

我在我的布局中使用androidx.constraintlayout.widget.ConstraintLayout并且它不显示链,我也不能拖动任何小部件。我只需键入要使用的约束。这是androidxconstraintLayout的示例屏幕截图:androidx.constraintlayout.widget.ConstraintLayout但是当我尝试切换回:android.support.constraint.ConstraintLayout我可以看到它这里是支持constraintLayout的示例屏幕截图:android.support.constraint.Constrai

android - 使用 Dagger 2 注入(inject) Androidx fragment

我想使用dagger2注入(inject)我的Androidxfragment。在我的Activity中我有:publicclassMainActivityextendsAppCompatActivityimplementsHasSupportFragmentInjector{@InjectRepositoryrepository;@InjectDispatchingAndroidInjectordispatchingAndroidInjector;@OverrideprotectedvoidonCreate(BundlesavedInstanceState){super.onCrea

android - 如何使用新的 androidx.lifecycle :*:2. 2.0-alpha01 获取 lifecycle.coroutineScope

2019年5月7日androidx.lifecycle:*:2.2.0-alpha01发布公告:ThisreleaseaddsnewfeaturesthataddssupportforKotlincoroutinesforLifecycleandLiveData.Detaileddocumentationonthemcanbefoundhere.关于documentation提到我可以获得LifecycleScope:eithervialifecycle.coroutineScopeorlifecycleOwner.lifecycleScopeproperties但是我好像一个也找不到

android - 没有找到类 "androidx.core.widget.DrawerLayout"

使用AndroidStudio菜单选项Refactor->RefactortoAndroidx迁移到Androidx包后...我的build.gradle看起来像implementation'androidx.appcompat:appcompat:1.1.0-alpha01'implementation'com.google.android.material:material:1.1.0-alpha01'implementation'androidx.constraintlayout:constraintlayout:2.0.0-alpha2'在运行应用程序的过程中,我遇到了这个:D

安卓工作室 : Error: Program type already present: androidx. core.graphics.PathSegment

我使用的是AndroidStudio3.3Canary8。我创建了默认项目,然后尝试运行该项目。但我看到了以下堆栈跟踪:AGPBI:{"kind":"error","text":"Programtypealreadypresent:androidx.core.graphics.PathSegment","sources":[{}],"tool":"D8"}Task:app:buildInfoGeneratorDebugFAILURE:Buildfailedwithanexception.*Whatwentwrong:Executionfailedfortask':app:transfo

安卓工作室 3.5 警告 : The rule `-keep public class * extends androidx.versionedparcelable.VersionedParcelable { <init>(); }` uses extends

今天,我将我的AndroidStudio更新到了3.5。更新后,我在尝试运行该应用程序时发现以下警告。Therule-keeppublicclass*extendsandroidx.versionedparcelable.VersionedParcelable{();}usesextendsbutactuallymatchesimplements.我知道警告与我的混淆器规则有关。因此,我仔细检查了我的混淆器规则文件,但我确定我没有添加该规则,而且它不在我的混淆器规则文件中。下面是我构建项目时的警告。我的项目正在使用AndroidX。谁能知道可以跳过警告或警告来自哪里?任何想法或替代方式