Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Entry name 'res/color/material_on_surface_disabled.xml' collided

I just created a signed apk after which, I added two files to my project- my_web_activity.xml and MyWebActivity.kt. After compiling the code, I got the error-"Entry name 'res/color/material_on_surface_disabled.xml' collided" Nothing else was specified.

my_web_activity.xml

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_height="match_parent">

    <com.google.android.gms.ads.AdView
        android:id="@+id/adView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="false"
        app:adSize="BANNER"
        app:adUnitId="ca-app-pub-3940256099942544/6300978111"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.0"
        app:layout_constraintStart_toStartOf="parent" />

    <WebView
        android:id="@+id/my_web_view"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginBottom="1dp"
        app:layout_constraintBottom_toTopOf="@+id/adView"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
```

MyWebActivity.kt
```
package com.albertjokelin.revise

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.google.android.gms.ads.AdRequest
import com.google.android.gms.ads.AdView
import com.google.android.gms.ads.MobileAds

class MyWebActivity : AppCompatActivity() {

    lateinit var mAdView: AdView

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        setContentView(R.layout.my_web_activity)

        // Google Ad view
        MobileAds.initialize(this)
        mAdView = findViewById(R.id.adView)
        val adRequest: AdRequest = AdRequest.Builder().build()
        mAdView.loadAd(adRequest)
    }

}
```

Edit: I ended up rebuilding the whole project from scratch after trying everything available at that time. So I don't know which solution works. Cheers!
like image 640
alburrito Avatar asked May 01 '20 05:05

alburrito


1 Answers

I have got this problem when I made an update in a splash screen and a quick solution is

  1. Delete your build folder from android/app/build or yourProjectFoler/build
  2. Delete your release folder from android/app/release or yourProjectFoler/release
  3. Last step from android studio goto => Build > Rebuild Project

Try now! I hope it will work...

like image 78
Vaibhav Bajpayee Avatar answered Sep 22 '22 23:09

Vaibhav Bajpayee