当前位置: 首页 > 知识库问答 >
问题:

我成功构建了我的应用程序,但当我运行它时,它会崩溃,这是我的日志中提示的消息

南宫奇思
2023-03-14

----------在android上。应用程序。ActivityThread。android上的installProvider(ActivityThread.java:7447)。应用程序。ActivityThread。android上的installContentProviders(ActivityThread.java:6964)。应用程序。ActivityThread。android上的handleBindApplication(ActivityThread.java:6870)。应用程序。ActivityThread。在android上访问1600美元(ActivityThread.java:255)。应用程序。android上的ActivityThread$H.handleMessage(ActivityThread.java:2106)。操作系统。处理程序。android上的dispatchMessage(Handler.java:107)。操作系统。活套。android上的loop(Looper.java:230)。应用程序。ActivityThread。java上的main(ActivityThread.java:7815)。lang.reflect。方法在com上调用(本机方法)。Android内部的操作系统。RuntimeInit$MethodandArgscaler。在com上运行(RuntimeInit.java:526)。Android内部的操作系统。合子岩。main(ZygoteInit.java:1034)由:java引起。lang.IllegalState例外:

******************************************************************************
* Invalid application ID. Follow instructions here:                          *
* https://googlemobileadssdk.page.link/admob-android-update-manifest         *
* to find your app ID.                                                       *
******************************************************************************


    at com.google.android.gms.internal.ads.zzzt.attachInfo(com.google.android.gms:play-services-ads-lite@@19.7.0:24)
    at com.google.android.gms.ads.MobileAdsInitProvider.attachInfo(com.google.android.gms:play-services-ads-lite@@19.7.0:3)
    at android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
    `` <?xml version="1.0" encoding="utf-8"?>
  <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
   package="com.dating.app">

    <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.VIBRATE" />

<application
    android:name="com.dating.app.Main.Application"
    android:allowBackup="true"
    android:icon="@mipmap/flirt_icon"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/flirt_icon"
    android:supportsRtl="true"
    android:theme="@style/AppTheme"
    tools:replace="android:icon">
    <activity android:name="com.dating.app.Settings.NotificationActivity"></activity>
    <activity android:name="com.dating.app.Start.RemindActivity" />
    <activity android:name="com.dating.app.Start.StartActivity" />
    <activity android:name="com.dating.app.Settings.SupportActivity" />
    <activity android:name="com.dating.app.Settings.PasswordActivity" />
    <activity android:name="com.dating.app.Settings.EmailActivity" />
    <activity android:name="com.dating.app.Settings.AccountActivity" />
    <activity android:name="com.dating.app.Settings.ReportActivity" />
    <activity android:name="com.dating.app.Profile.ProfileEditActivity" />
    <activity android:name="com.dating.app.Main.MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name="com.dating.app.Start.LoginActivity" />
    <activity android:name="com.dating.app.Start.RegisterActivity" />
    <activity android:name="com.dating.app.Message.MessageActivity" />
    <activity android:name="com.dating.app.Profile.ProfileActivity" />
    <activity
        android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
        android:theme="@style/Base.Theme.AppCompat" />
    <activity android:name="com.dating.app.Settings.SettingsActivity" />
    <activity android:name="com.dating.app.Settings.PrivacyActivity" />
    <activity android:name="com.dating.app.Accounts.AccountsActivity" />
    <activity android:name="com.dating.app.Premium.PremiumActivity" />

    <service android:name="com.dating.app.Extra.ServiceClass" />

    <meta-data
        android:name="com.facebook.sdk.ApplicationId"
        android:value="@string/facebook_app_id" />


    <meta-data
        android:name="com.google.android.gms.ads.APPLICATION_ID"
        android:value="@string/admob_banner_ad_unit_id" />


    <activity
        android:name="com.facebook.FacebookActivity"
        android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
        android:label="@string/app_name" />
    <activity
        android:name="com.facebook.CustomTabActivity"
        android:exported="true">
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />

            <data android:scheme="@string/fb_login_protocol_scheme" />
        </intent-filter>
     </activity>
 </application>

 </manifest>``







apply plugin: 'com.android.application'

android{compileSdkVersion 30 defaultConfig{Application ationId"com.dating.app.flirt.chat"minSdkVersion 19 Target etSdkVersion 30 versionCode 2 versionName"1.0.1"testInstrumentationRunner'androidx.test.runner.AndroidJUnitRunner'

    multiDexEnabled true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
android {
    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

}

   ````dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.viewpager:viewpager:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
implementation "com.google.firebase:firebase-core:18.0.2"
implementation 'com.google.firebase:firebase-database:19.6.0'
implementation 'com.google.firebase:firebase-auth:20.0.2'
implementation 'com.google.firebase:firebase-storage:19.2.1'
implementation 'com.google.firebase:firebase-firestore:22.1.0'
implementation 'com.google.firebase:firebase-ads:19.7.0'
implementation 'com.google.android.gms:play-services-auth:19.0.0'
implementation 'com.google.android.gms:play-services-location:18.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.multidex:multidex:2.0.0'
implementation 'de.hdodenhof:circleimageview:3.0.0'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.nabinbhandari.android:permissions:3.8'
implementation 'id.zelory:compressor:2.1.0'
implementation 'com.makeramen:roundedimageview:2.3.0'
implementation 'com.crystal:crystalrangeseekbar:1.1.3'
implementation 'com.patrickpissurno:ripple-effect:1.3.1'
implementation 'com.github.curioustechizen.android-ago:library:1.4.0'
implementation 'com.firebaseui:firebase-ui-firestore:4.0.1'
implementation "com.yuyakaido.android:card-stack-view:2.3.2"
implementation 'link.fls:swipestack:0.3.0'
implementation 'com.mindorks.android:placeholderview:1.0.3'
annotationProcessor 'com.mindorks.android:placeholderview-compiler:1.0.3'
implementation 'com.synnapps:carouselview:0.1.5'
implementation "com.squareup.okhttp3:okhttp:3.14.1"
implementation 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'
implementation 'com.ss.bannerslider:bannerslider:2.0.0'
implementation 'com.github.f0ris.sweetalert:library:1.5.6'
implementation 'com.sackcentury:shinebutton:0.2.0'
implementation 'org.greenrobot:eventbus:3.1.1'
implementation 'com.facebook.android:facebook-login:5.15.3'
implementation 'com.skyfishjy.ripplebackground:library:1.0.1'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.1.0-alpha08'

 ````

}

应用插件:“com.google.gms。谷歌服务'

共有1个答案

彭鸿彩
2023-03-14

如果这一行显示了您在此处添加的正确内容,则显示admob横幅ad unite id。然后尽快用admob应用程序ID更改它

<meta-data
    android:name="com.google.android.gms.ads.APPLICATION_ID"
    android:value="@string/admob_banner_ad_unit_id" />

ad unite和app ID是不同的,app ID用于在启动时初始化Ads SDK,ad unite用于加载和管理Ads。

 类似资料: