Weihang Tang
Weihang Tang

Reputation: 31

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

Upvotes: 3

Views: 426

Answers (1)

Andr&#233; Vicente
Andr&#233; Vicente

Reputation: 146

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" />

Upvotes: 2

Related Questions