【问题标题】:auth0: failed to resolve com.auth0.android:lockauth0: 无法解析 com.auth0.android:lock
【发布时间】:2016-11-19 12:03:19
【问题描述】:

我正在关注 auth0-documentation,我创建了一个针对 Android 6 的新项目,但第一步不起作用:

compile 'com.auth0.android:lock:2.0.0'

结果

无法解析 com.auth0.android:lock:2.0.0

在同步 gradle 之后。

我哪里错了?

PS:如果你想让我在这里发布源代码......我没有写任何东西!我刚刚在我的 gradle 构建文件中写了那一行

【问题讨论】:

  • 贴出相关代码
  • 我还没有写任何代码:-),我只写了那一行
  • 编译'com.auth0.android:lock:1.16.+'
  • auth0/Lock.Android repo 自述文件指示使用该库添加以下行:compile 'com.auth0.android:lock:1.16.+' - github.com/auth0/Lock.Android
  • 你在哪里找到任何对 2.0.0 的引用

标签: android android-gradle-plugin build.gradle auth0


【解决方案1】:

尝试使用compile 'com.auth0.android:lock:2.0.0-beta.3'

或者只是compile 'com.auth0.android:lock:2.+'

auth0 / lock-android / lock / 2.0.0-beta.3

对我来说,它在 API 19 设备上失败,在 API 23 上运行。

更新:问题出在 KitKat API 中的矢量图形错误中。 使用更改默认标题图标有助于解决问题。

一种方式:

  <style name="AppTheme.Lock.Theme" parent="Lock.Theme">
    <item name="Auth0.HeaderLogo">@drawable/app_logo</item>
  </style>

在 AndroidManifest.xml 中更改活动主题

<activity
      android:name="com.auth0.android.lock.LockActivity"
      android:label="@string/app_name"
      android:launchMode="singleTask"
      android:screenOrientation="portrait"
      android:theme="@style/AppTheme.Lock.Theme">

 //here is your header logo res
 int headerLogo = R.drawable.app_logo;

..

 Theme theme = Theme.newBuilder()
    .withHeaderLogo(headerLogo)        
    .build();

..

 this.lock = Lock.newBuilder(auth0, callback)
    .withTheme(theme)
    .build();

【讨论】:

  • 在新的 beta4 中,他们删除了 'withTheme()' 调用。您知道这些更改后如何更改徽标/标题吗?
猜你喜欢
  • 2019-05-24
  • 2021-08-19
  • 1970-01-01
  • 2019-10-19
  • 2018-11-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多