Android Question Problem "The File "google-services.json" is not Parsed"

I have a problem that when I use admob an error occurs at manifest editor that says the file google-services.json is not parsed
idk what is the reason of this error
the app and the file both have the same package

code_image_1.JPG
 

Attachments

  • code_image_2.JPG
    code_image_2.JPG
    130.8 KB · Views: 155
  • code_manifest_editor.JPG
    code_manifest_editor.JPG
    69.5 KB · Views: 164
  • the_error.JPG
    the_error.JPG
    129.1 KB · Views: 214
B4X:
 #Region  Project Attributes
    #ApplicationLabel: Admob Testing 2020
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: portrait
    #CanInstallToExternalStorage:True
#End Region

#Region  Activity Attributes
    #FullScreen: True
    #IncludeTitle:False
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    Private BannerAd As AdView
    Private IAd As InterstitialAd
End Sub
Sub ads(banner As String,inter As String)
    Dim MobileAds As MobileAds
    MobileAds.Initialize
    BannerAd.Initialize2("BannerAd", banner, BannerAd.SIZE_SMART_BANNER)
    Dim height As Int
    If GetDeviceLayoutValues.ApproximateScreenSize < 6 Then
       
        If 100%x > 100%y Then height = 32dip Else height = 50dip
    Else
        height = 90dip
    End If
    Activity.AddView(BannerAd, 0dip, 100%y - height, 100%x, height)
    BannerAd.LoadAd
   
    IAd.Initialize("iad",inter)
    IAd.LoadAd
End Sub
Sub Activity_Create(FirstTime As Boolean)
    ads("ca-app-pub-3940256099942544/6300978111","ca-app-pub-3940256099942544/1033173712")
End Sub

Sub Activity_Resume

End Sub
Sub IAD_AdClosed
    IAd.LoadAd
End Sub
Sub Activity_Pause (UserClosed As Boolean)

End Sub
Sub Activity_Click
    If IAd.Ready Then
        IAd.Show
    End If
End Sub
 
Upvote 0
error when I try to compile:
B4A Version: 10.2
Java Version: 11
Parsing code. (0.06s)
Building folders structure. (0.37s)
Compiling code. Error
Error parsing manifest script:
Error parsing google-services.json
 
Upvote 0
Manifest Editor Script
B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="29"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.LightTheme)
'Start
    CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
    CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
    CreateResourceFromFile(Macro, FirebaseNotifications.FirebaseNotifications)
    CreateResourceFromFile(Macro, FirebaseAnalytics.FirebaseAnalytics)
    CreateResourceFromFile(Macro, FirebaseAdMob.FirebaseAds)
    CreateResourceFromFile(Macro, FirebaseAuth.FirebaseAuth)
    AddReplacement($ADMOB_APP_ID$,ca-app-pub-5673670033130136~4352770874) 'use your admob adunit
'end
'End of default text.
 
Upvote 0
I opened google-services.json in a text editor and that's what I got
B4X:
{
  "project_info": {
    "project_number": "567380328639",
    "firebase_url": "https://b4aadmob2020.firebaseio.com",
    "project_id": "b4aadmob2020",
    "storage_bucket": "b4aadmob2020.appspot.com"
  },
  "client": [
    {
      "client_info": {
        "mobilesdk_app_id": "1:567380328639:android:1d5c471069b7f60818460a",
        "android_client_info": {
          "package_name": "com.b4a_2020"
        }
      },
      "oauth_client": [
        {
          "client_id": "567380328639-qgcr000o1n1bh0pgtq09ivq93vgt547e.apps.googleusercontent.com",
          "client_type": 3
        }
      ],
      "api_key": [
        {
          "current_key": "AIzaSyCTBBHX6A7YEBlwO039fPur_mwxfErx4qA"
        }
      ],
      "services": {
        "appinvite_service": {
          "other_platform_oauth_client": [
            {
              "client_id": "567380328639-qgcr000o1n1bh0pgtq09ivq93vgt547e.apps.googleusercontent.com",
              "client_type": 3
            }
          ]
        }
      }
    }
  ],
  "configuration_version": "1"
}
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

MikeSW17

Active Member
Licensed User
Longtime User
Not much point in looking IN the " google-services.json " file for an error as the compile doesn't get that far. It fails to parse the file because that file is NOT FOUND in the folder specified in the error message. Where is the google-services.json file stored?
 
Upvote 0
It works! ?
Thanks for everyone for the help!
Really this is the best forum you all are very kind and very helpful
Now I can finally put ads in my apps
Thanks so much
 

Attachments

  • Screenshot_٢٠٢٠١٠١١-١٥٣١٥٩.png
    Screenshot_٢٠٢٠١٠١١-١٥٣١٥٩.png
    345.1 KB · Views: 157
  • Screenshot_٢٠٢٠١٠١١-١٥٣٢٠٨.png
    Screenshot_٢٠٢٠١٠١١-١٥٣٢٠٨.png
    43.5 KB · Views: 195
Upvote 0
Top