小编aca*_*zas的帖子

为什么在TextInputLayout中找不到属性app:endIconMode?

您好,我正在使用androidx库创建一个应用程序,但是当我尝试添加一个开关来显示或隐藏具有app:endIconMode属性的TextInputEditText中的密码时,出现错误错误:找不到属性endIconMode。

这是我的TextInputLayout和TextInputEditText

<com.google.android.material.textfield.TextInputLayout
            android:id="@+id/password_text_input_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="password"
            app:endIconMode="password_toggle"
            app:layout_constraintTop_toBottomOf="@+id/user_text_input_layout"
            style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">

        <com.google.android.material.textfield.TextInputEditText
                android:id="@+id/password_text_input_edit_text"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:inputType="textPassword"/>

    </com.google.android.material.textfield.TextInputLayout>
Run Code Online (Sandbox Code Playgroud)

这些也是我在gradle中的依赖

implementation 'androidx.appcompat:appcompat:1.1.0-alpha01'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3'
implementation 'com.google.android.material:material:1.0.0'
Run Code Online (Sandbox Code Playgroud)

我不确定我缺少什么,也许是依赖关系?据我在文档中阅读的内容,除了材料之外,不需要任何额外的依赖。

谢谢

android android-textinputlayout androidx

10
推荐指数
1
解决办法
3656
查看次数

无法使用阴影插件为 gradle 重新定位依赖项

我有一个项目,它使用一个包含在 aar 文件中的库。问题是我的应用程序使用 daager 1 进行依赖注入,它使用 Dagger 1,因为我使用的框架仅与 dagger 1 兼容。问题是我需要使用的库使用 Dagger 2 进行依赖注入,所以当我添加时库和我在我的应用程序 gradle 文件中添加依赖项它不起作用(正如预期的那样,因为 Dagger 1 和 Dagger 2 不能开箱即用地同时使用),所以我试图使用重新定位 Dagger 2 依赖项影子插件。

我按照本教程进行操作http://ferndocejas.com/2016/08/03/android-dagger-1-and-2-living-together/

jar 文件在模块内生成但为空,它们不包含 Dagger 2 的重命名文件。我从 github https://github.com/android10/two-daggers下载了该项目,它可以工作,但我可以管理让它在我的项目中工作。

我创建的模块中的 gradle 文件与教程中的文件完全相同。你能看出我做错了什么吗?

shadow.gradle 也是一个精确的副本。

唯一的区别是我的应用程序中的 build.gradle 是

apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
apply plugin: 'com.jakewharton.hugo'


android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

defaultConfig {
    applicationId "com.xxx.xxx"
    minSdkVersion 16
    targetSdkVersion 23
    versionCode Integer.parseInt("$APP_VERSION_CODE")
    versionName "$APP_VERSION_NAME"

    testInstrumentationRunner "com.android.test.runner.MultiDexTestRunner"

    // Enabling multidex support.
    multiDexEnabled true

}

testBuildType …
Run Code Online (Sandbox Code Playgroud)

android jar gradle android-studio aar

5
推荐指数
0
解决办法
1007
查看次数