亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

添加了 Google API 密鑰仍然收到錯誤 API 密鑰未找到

添加了 Google API 密鑰仍然收到錯誤 API 密鑰未找到

慕少森 2023-10-14 16:14:08
我確實在清單文件的元數據中添加了 google API 密鑰,但仍然收到錯誤“API 密鑰未找到”<manifest xmlns:android="http://schemas.android.com/apk/res/android"package="com.abit"><uses-permission android:name="android.permission.INTERNET" /><uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/><uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/><application  android:name=".MainApplication"  android:label="@string/app_name"  android:icon="@mipmap/ic_launcher"  android:roundIcon="@mipmap/ic_launcher_round"  android:allowBackup="false"  android:theme="@style/AppTheme"  >    <activity    android:name=".MainActivity"    android:label="@string/app_name"    android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"    android:launchMode="singleTask"    android:windowSoftInputMode="adjustResize">    <intent-filter>        <action android:name="android.intent.action.MAIN" />        <category android:name="android.intent.category.LAUNCHER" />    </intent-filter>  </activity>  <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />  <meta-dataandroid:name="com.google.android.geo.AIzaSyDPUc0RSV5OZzACrJcFPuBpxUHi0000000"android:value="AIzaSyDPUc0RSV5OZzACrJcFPuBpxUHi0000000" /></application>我不知道哪里出了問題。請幫忙?。。?
查看完整描述

1 回答

?
慕碼人8056858

TA貢獻1803條經驗 獲得超6個贊

根據文檔步驟,您應該添加標簽作為應用程序標簽的子級,元數據應如下所示:


<meta-data

    android:name="com.google.android.geo.API_KEY"

    android:value="YOUR_API_KEY"/>

所以,根據這個你的代碼應該是:


<application

  android:name=".MainApplication"

  android:label="@string/app_name"

  android:icon="@mipmap/ic_launcher"

  android:roundIcon="@mipmap/ic_launcher_round"

  android:allowBackup="false"

  android:theme="@style/AppTheme"

 >   

  <activity

     android:name=".MainActivity"

    android:label="@string/app_name"

android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"

   android:launchMode="singleTask"

   android:windowSoftInputMode="adjustResize">

   <intent-filter>

     <action android:name="android.intent.action.MAIN" />

     <category android:name="android.intent.category.LAUNCHER" />

   </intent-filter>

 </activity>

 <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />

 <meta-data android:name="android:name="com.google.android.geo.API_KEY""

  android:value="AIzaSyDPUc0RSV5OZzACrJcFPuBpxUHi0000000" />

 </application>

注意點:android:name您傳遞的是as的值com.google.android.geo.AIzaSyDPUc0RSV5OZzACrJcFPuBpxUHi0000000而不是com.google.android.geo.API_KEY



查看完整回答
反對 回復 2023-10-14
  • 1 回答
  • 0 關注
  • 191 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號