简体   繁体   中英

implementation 'com.android.support:appcompat-v7:28.0.0-beta01' showing error

please help me. i was created an android project completely. but problems is my app gradle file showing this error sshot below.

错误

and i have one more problem. i was set InterstitialAd but it's not showing in my activity. please inform me how to solve this problem??

gradle.build

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:28.0.0-beta01'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.android.support:design:28.0.0-beta01'
    implementation 'com.android.support:cardview-v7:28.0.0-beta01'
    implementation 'com.google.android.gms:play-services-ads:15.0.1'
}

activity java

AdRequest adRequest = new AdRequest.Builder().build();
        interstitial = new InterstitialAd(Howtogeek.this);
        interstitial.setAdUnitId(getString(R.string.admob_interstitial_id));

        interstitial.loadAd(adRequest);
        interstitial.setAdListener(new AdListener() {
            public void onAdLoaded() {
                displayInterstitial();
            }
        });

        Howtogeek = (WebView)findViewById(R.id.Howtogeek);
        bar = (ProgressBar)findViewById(R.id.bar);
        Howtogeek.setWebViewClient(new Howtogeek.myWebclient());
        bar.setMax(100);
        Howtogeek.loadUrl("https://www.howtogeek.com/");

        WebSettings webSettings = Howtogeek.getSettings();
        webSettings.setJavaScriptEnabled(true);
        Howtogeek.getSettings().setRenderPriority(WebSettings.RenderPriority.HIGH);
        Howtogeek.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
        Howtogeek.getSettings().setAppCacheEnabled(true);
        Howtogeek.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
        webSettings.setDomStorageEnabled(true);
        webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS);
        webSettings.setUseWideViewPort(true);
        webSettings.setSavePassword(true);
        webSettings.setSaveFormData(true);
        webSettings.setEnableSmoothTransition(true);
    }

    public void displayInterstitial() {
        if (interstitial.isLoaded()) {
            interstitial.show();
        }
    }

If you have use this

 implementation 'com.android.support:appcompat-v7:28.0.2'

and also use one more dependency

 implementation 'com.android.support:support-v13:28.0.2'

this is work for me. I hope it will help you.

I have the same problem as you. you have to add all the libraries which are shown in "examples include" not same version

i had it too. problem was with

implementation 'com.android.support:cardview-v7:28.0.0-rc01'

i changed it to

 implementation 'com.android.support:cardview-v7:27.0.1'

and it works well

Try this Google Play implemented target version of API 26 so use API 27 still good

implementation 'com.android.support:appcompat-v7:27.0.1'
implementation 'com.android.support:design:27.0.1'

And also use the later version of play services

implementation 'com.google.android.gms:play-services-ads:12.0.0'

I have had the same problem.... as you know Android 9.0 (API level 28) there is a new version of the support library called AndroidX. You can continue to use the support library (those versioned 27 and earlier) BUT google Developer recommend using the AndroidX libraries in all new projects.

With Android Studio 3.2 and higher, you can quickly migrate an existing project to use AndroidX by selecting Refactor > Migrate to AndroidX from the menu bar.

Further reading:

https://developer.android.com/topic/libraries/support-library/ https://developer.android.com/jetpack/androidx/migrate

It worked for me. good luck

尝试清理项目并重建。

I used

allprojects {
repositories {
    mavenCentral()
    google()
    jcenter()

}

and

implementation 'com.facebook.android:facebook-android-sdk:[5,6)'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM