Java 应用图标显示在广告中,但应用未运行
我正在尝试创建一个启动屏幕。我可以在ADB手机屏幕上看到应用程序图标,但应用程序没有运行。围住logcat LogcatJava 应用图标显示在广告中,但应用未运行,java,android,Java,Android,我正在尝试创建一个启动屏幕。我可以在ADB手机屏幕上看到应用程序图标,但应用程序没有运行。围住logcat Logcat 2020-09-16 17:03:52.612 12836-12836/? I/.example.stree: Not late-enabling -Xcheck:jni (already on) 2020-09-16 17:03:52.639 12836-12836/? I/.example.stree: Unquickening 12 vdex files! 2020-0
2020-09-16 17:03:52.612 12836-12836/? I/.example.stree: Not late-enabling -Xcheck:jni (already on)
2020-09-16 17:03:52.639 12836-12836/? I/.example.stree: Unquickening 12 vdex files!
2020-09-16 17:03:52.641 12836-12836/? W/.example.stree: Unexpected CPU variant for X86 using defaults: x86
2020-09-16 17:03:52.850 12836-12836/com.example.street I/.example.stree: The ClassLoaderContext is a special shared library.
2020-09-16 17:03:53.056 12836-12836/com.example.street E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.street, PID: 12836
java.lang.RuntimeException: Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.IllegalStateException:
******************************************************************************
* The Google Mobile Ads SDK was initialized incorrectly. AdMob publishers *
* should follow the instructions here: *
* https://googlemobileadssdk.page.link/admob-android-update-manifest *
* to add a valid App ID inside the AndroidManifest. *
* Google Ad Manager publishers should follow instructions here: *
* https://googlemobileadssdk.page.link/ad-manager-android-update-manifest. **
******************************************************************************
at android.app.ActivityThread.installProvider(ActivityThread.java:7244)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6780)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6697)
at android.app.ActivityThread.access$1300(ActivityThread.java:237)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Caused by: java.lang.IllegalStateException:
******************************************************************************
* The Google Mobile Ads SDK was initialized incorrectly. AdMob publishers *
* should follow the instructions here: *
* https://googlemobileadssdk.page.link/admob-android-update-manifest *
* to add a valid App ID inside the AndroidManifest. *
* Google Ad Manager publishers should follow instructions here: *
* https://googlemobileadssdk.page.link/ad-manager-android-update-manifest. *
******************************************************************************
at com.google.android.gms.internal.ads.zzxw.attachInfo(com.google.android.gms:play-services-ads-lite@@18.3.0:27)
at com.google.android.gms.ads.MobileAdsInitProvider.attachInfo(com.google.android.gms:play-services-ads-lite@@18.3.0:3)
at android.app.ActivityThread.installProvider(ActivityThread.java:7239)
... 10 more
2020-09-16 17:03:53.120 12836-12836/? I/Process: Sending signal. PID: 12836 SIG: 9
这是我的清单xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.street">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.AppCompat">
<activity android:name=".SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimaryDark"
tools:context=".SplashActivity">
<ImageView
android:id="@+id/just_logo"
android:layout_width="180dp"
android:layout_height="180dp"
android:layout_centerInParent="true"
android:contentDescription="@string/app_name"
android:src="@drawable/just_logo" />
<TextView
android:layout_below="@id/just_logo"
android:layout_centerHorizontal="true"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/app_name"
android:textColor="@color/colorAccent"
android:textSize="32sp" />
</RelativeLayout>
启动活动文件
package com.example.street;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
package com.example.street;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
public class SplashActivity extends AppCompatActivity {
Handler handler;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main_splashscreen);
handler=new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
Intent intent=new Intent(SplashActivity.this,MainActivity.class);
startActivity(intent);
finish();
}
},3000);
}
}1-转到AdMob>应用程序>查看所有应用程序>搜索你的应用程序>从他们的应用程序中复制应用程序ID 2-转到您的
AndroidManifest.xml
文件,并在应用程序标记内复制粘贴以下行:
<meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="XXXXXXX"/>
3-用你的应用程序ID替换XXXXXXX我不需要admob,希望我的应用程序在没有admob的情况下运行。那么我该如何删除它呢?删除
谷歌广告的依赖关系
你能指导我如何删除谷歌广告的依赖关系吗?