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!
I have got this problem when I made an update in a splash screen and a quick solution is
Try now! I hope it will work...
Go To Build > Clean Project
Tried INVALIDATE CACHES AND RESTART and works perfect. The main reason is android studio tries to update the build index but is not able to access it !
Delete your build folder in the project hierarchy & the release/debug folder in the app hierarchy,then rebuild your project, it worked for me that way.
don't delete anything just turn off android studio than turn on then make clean and rebuilt to your project and every thing will be good
I tried Build -> Clean Project and File -> Invalidate cache too.
Nothing worked.
Only thing that worked for me was deleting the previous apk that was generated
Which is in android/app/debug/app-debug.apk