Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error “Google is not defined” after Android target API level 28+”

"Starting August 1, 2019, Google Play requires that new apps target at least Android 9.0 (API level 28), and that app updates target Android 9.0 from November 1, 2019. Until these dates, new apps and app updates must target at least Android 8.0 (API level 26)."

After I changed to 28

<preference name="android-targetSdkVersion" value="28" />

Google map stops working and throws this error

ERROR Error: Uncaught (in promise): ReferenceError: google is not defined

like image 772
Weihang Tang Avatar asked May 25 '26 13:05

Weihang Tang


1 Answers

I solved it, after some hours, just putting two things in AndroidManifest.xml

Open

platforms/android/AndroidManifest.xml

In tag Application put

android:usesCleartextTraffic="true"

Inside tag Application put the tag

<uses-library android:name="org.apache.http.legacy" android:required="false" />

like image 78
André Vicente Avatar answered May 27 '26 02:05

André Vicente



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!