Мой файл build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.mypc.hitarthapp"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:27.1.1'
//noinspection GradleCompatible
implementation 'com.android.support:design:27.1.1'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-
core:3.0.2'
implementation 'com.google.android.gms:play-services-ads:15.0.0'
}
MainActivity.java
package com.example.mypc.hitarthapp;
import android.support.annotation.NonNull;
import android.support.design.widget.NavigationView;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.MenuItem;
import android.widget.*;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
import com.google.android.gms.ads.MobileAds;
public class MainActivity extends AppCompatActivity {
DrawerLayout dl;
NavigationView nv;
AdView av;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
MobileAds.initialize(this,"ca-app-pub-7900332792984616/4506141248");
dl=findViewById(R.id.dv);
nv=findViewById(R.id.nv);
av=findViewById(R.id.ad);
nv.setNavigationItemSelectedListener(new
NavigationView.OnNavigationItemSelectedListener() {
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
item.setChecked(true);
dl.closeDrawers();
AdRequest ar=new AdRequest.Builder().build();
av.loadAd(ar);
return true;
}
});
}
}
main_activity.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:id="@+id/dv"
>
<android.support.v7.widget.ContentFrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</android.support.v7.widget.ContentFrameLayout>
<android.support.design.widget.NavigationView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:id="@+id/nv"
app:menu="@menu/menu"
app:headerLayout="@layout/myheader"
android:background="@android:color/holo_blue_bright">
</android.support.design.widget.NavigationView>
<com.google.android.gms.ads.AdView
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:id="@+id/ad"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
ads:adSize="BANNER"
ads:adUnitID="ca-app-pub-7900332792984616/4506141248"
>
</com.google.android.gms.ads.AdView>
</android.support.v4.widget.DrawerLayout>
Я получил эту ошибку-
Error: java.util.concurrent.ExecutionException:
com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs
for details
Я также пытался очистить и восстановить свой проект
Что-то не так в моих зависимостях или я должен изменить свой макет?
любая помощь будет оценена
заранее спасибо
мой logcat
введите описание изображения здесь
/////////////////////////////////////////////// //////////////////////////////////