所以前幾天註冊了我自己的 iPhoneX 到 JapanGo 上 並下載 dev client 測試,沒什麼問題 那我就想,應該把 Josie 的 iPhone SE 也拿來測試一下 畢竟那是最小的 iPhone 那因為我要多註冊一個裝置,所以必須重新打包 這時 EAS 就報錯了
題外話:等好久…
不知道是不是因為凌晨是國外的 APP 打包旺季 EAS build 居然需要排隊 270 分鐘!!! 阿不就幸好我可以去睡覺 (其實也早該睡了) 不然也等太久了吧 算了反正我是 EAS 免費仔 不付費就是要排隊XD
回來正題:EAS 報錯
總之我睡了一覺起來就看到紅色的 error 錯誤訊息如下:
1 2 3 4
Error: Compatible versions of some pods could not be resolved. You are seeing this error because either: - Versions in the Podfile.lock cached by EAS do not match required values in Podspecs of some of the libraries. To fix that add the "cache.key" field (it can be set to any value) in the build profile in eas.json to invalidate the cache. - Some of the pods used in your project depend on different versions of the same pod. See logs for more information.
最後一步,由於這個元件需要動用原生 API 代表我們不能夠用 Expo Go 來預覽開發了 而是要改用 expo dev client 這篇我就不深入探討這是什麼 可以先當作我們要客製一個可以動用原生元件的 Expo Go 來用
結果這邊就出錯了
無法 build…
執行 eas build --profile development 後
重點應該在第 27 行(重新排版了一下)
1 2 3 4 5 6 7
/home/expo/workingdir/build/android/app/src/debug/AndroidManifest.xml:17:85-105 Error: Attribute meta-data#com.google.android.gms.ads.DELAY_APP_MEASUREMENT_INIT@value value=(true) from AndroidMenifest.xml:17:85-105 is also present at [:react-native-google-mobile-ads] AndroidManifest.xml:19:13-34 value=(false).
Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:17:5-107 to override.
"react-native-google-mobile-ads":{ "android_app_id":"ca-app-pub-3940256099942544~3347511713", "ios_app_id":"ca-app-pub-3940256099942544~1458002511", "delay_app_measurement_init":false, "user_tracking_usage_description":"This identifier will be used to deliver personalized ads to you." }
接著我在進一步去翻套件的檔案 在european-user-consent.mdx裡看到這段說明
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
### Delaying app measurement
By default, the Google Mobile Ads SDK initializes app measurement and begins sending user-level event data to Google immediately when the app starts. If your app will be used by users within the EEA, it is important you prevent app measurement until your first ad has been requested (after consent).
Within your projects `app.json` file, set the `delay_app_measurement_init` to `true` to delay app measurement: