问题
My application was originally written using Delphi v10.2.2 and TBannerAd worked just fine.
Without any code changes and after upgrading Delphi to v10.2.3 (by installing over the existing v10.2.2 using the ISO without changing anything in the installation dialogs), calling TBannerAd's "LoadAd" method started triggering this exception:
Project myproject.apk raised exception class EJNIException with message 'java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected 4323000 but found 7095000. You must have the following declaration within the < application > element: < meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" / >'.
I reviewed the AndroidManifest.xml file and indeed the "7095000" value is used, but I don't know why/how delphi uses this value. Rebuilding the project generates a new AndroidManifest.xml file with the "7095000" value, so I can't directly edit the XML file as a work-around.
What causes this? Is it some setting or SDK path that changed due to the upgrade? (I tried searching but couldn't find anything relevant)
Things I tried:
- Completely uninstalling the application and running it again from Delphi (on a real device, a Galaxy note 4).
- Under options, changing the NDK API location and C++ Builder NSK Library paths from "\platforms\android-14" to "\platforms\android-19".
回答1:
Tokyo 10.2.3 has updated Google Play Services and its libraries.
Applications created with old version don't automatically update the libraries to new ones shipped with 10.2.3 release.
To update the libraries go to Project Manager -> Android -> Android SDK xxx -> Libraries and select "Revert System Files to Default" from the popup menu.
After reverting list of included libraries should be
来源:https://stackoverflow.com/questions/50038757/google-admob-tbannerad-loadad-exception-after-upgrading-to-delphi-v10-2-3