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...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With