繁体   English   中英

实现'com.android.support:appcompat-v7:28.0.0-beta01'显示错误

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

请帮我。 我被完全创建了一个android项目。 但问题是我的应用程序gradle文件在下面显示了此错误提示。

错误

我还有一个问题。 我被设置为InterstitialAd,但没有显示在我的活动中。 请告诉我如何解决这个问题?

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'
}

活动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();
        }
    }

如果您使用过

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

并且还使用一个依赖

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

这对我来说是工作。 希望对您有帮助。

我和你有同样的问题。 您必须添加“示例包含”中显示的所有库,而不是同一版本

我也有 问题出在

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

我将其更改为

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

而且效果很好

尝试使用此Google Play实现的API 26目标版本,因此仍然可以使用API​​ 27

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

并使用更高版本的播放服务

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

我遇到了同样的问题...。正如您所知,Android 9.0(API级别28)有一个新版本的支持库,称为AndroidX。 您可以继续使用支持库(版本为27和更早版本), google Developer建议在所有新项目中使用AndroidX库。

在Android Studio 3.2及更高版本中,您可以通过从菜单栏中选择“重构”>“迁移到AndroidX”来快速迁移现有项目以使用AndroidX。

进一步阅读:

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

它为我工作。 祝好运

尝试清理项目并重建。

我用了

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

}

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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