小编mon*_*lou的帖子

主机名不能为空

升级我的 Android Studio 后,每当我想生成签名的 Apk 时都会收到此错误(没有任何关于问题所在的详细信息)。我刚构建Apk时没有问题。

The Host name may not be empty
Run Code Online (Sandbox Code Playgroud)

java android release kotlin android-studio-4.0

11
推荐指数
3
解决办法
4514
查看次数

java.lang.NoSuchMethodException: android.content.res.Resources$Theme.rebase []

设置后minifyEnabled true,我在发布的应用程序中收到此错误

知道如何解决吗?

2020-07-01 11:51:33.651 30098-30098/? I/ResourcesCompat: Failed to retrieve rebase() method
    java.lang.NoSuchMethodException: android.content.res.Resources$Theme.rebase []
        at java.lang.Class.getMethod(Class.java:2069)
        at java.lang.Class.getDeclaredMethod(Class.java:2047)
        at androidx.core.content.res.ResourcesCompat$ThemeCompat$ImplApi23.rebase(SourceFile:3)
        at androidx.core.content.res.ResourcesCompat$ThemeCompat.rebase(SourceFile:3)
        at androidx.appcompat.app.AppCompatDelegateImpl.attachBaseContext2(SourceFile:32)
        at androidx.appcompat.app.AppCompatActivity.attachBaseContext(SourceFile:1)
        at com.kahkeshan.tv_app.base.BaseActivity.attachBaseContext(SourceFile:1)
        at android.app.Activity.attach(Activity.java:7244)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3080)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3282)
        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:1970)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7156)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975) 
Run Code Online (Sandbox Code Playgroud)

gradle 文件中的设置:

  release {
            minifyEnabled true
            shrinkResources true
            zipAlignEnabled true
            pseudoLocalesEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
Run Code Online (Sandbox Code Playgroud)

java android proguard kotlin android-studio

8
推荐指数
1
解决办法
975
查看次数

多语言站点的 URL 结构

我想制作一个多语言网站,但我不确定从 SEO 的角度来看处理 URL 结构的最佳方法是什么。一些例子:

产品

example.com/product/123/en/product-name
Run Code Online (Sandbox Code Playgroud)

或者

example.com/product/123/product-name/en
Run Code Online (Sandbox Code Playgroud)

或其他?

类别

example.com/Category/en/furniture/chair/
Run Code Online (Sandbox Code Playgroud)

或者

example.com/Category/en/120/chair/
Run Code Online (Sandbox Code Playgroud)

或者

example.com/Category/en/chair/
Run Code Online (Sandbox Code Playgroud)

或其他?

multilingual seo url-design web

3
推荐指数
1
解决办法
854
查看次数

Change background color of selectedItem in recyclerView android databinding

How can I change the backgroudColor ofselectedItem in recyclerView adapter when I use android databinding?

this is my Adapte,and class CategoyItemClickListener is implemened for handling item clicks :

class ProgramCatAdapter(
    val mContext: Context,
    val mData: MutableList<CategoryResponse>,
    val clickListener: CategoyItemClickListener
) : RecyclerView.Adapter<ProgramCatAdapter.CategoryViewHolder>() {



    override fun onCreateViewHolder(
        parent: ViewGroup,
        viewType: Int
    ): CategoryViewHolder {
        return CategoryViewHolder.from(parent)
    }

    override fun getItemCount(): Int {
        return mData.size
    }

    override fun onBindViewHolder(holder: CategoryViewHolder, position: Int) {
        holder.bind(
            mData[position],
            clickListener,
            position

        )


    }

    fun getItem(position: Int): …
Run Code Online (Sandbox Code Playgroud)

android kotlin android-recyclerview android-databinding

2
推荐指数
1
解决办法
645
查看次数

无法解析@layout/exo_simple_player_view

我在我的项目中实现了 Exoplayer,它工作得很好,但今天它开始在我的字段的 XML 布局中产生错误app:player_layout_id="@layout/exo_simple_player_view",说无法解析 @layout/exo_simple_player_view

android exoplayer exoplayer2.x

2
推荐指数
1
解决办法
832
查看次数