chemerisuk / cordova-support-google-services

DEPRECATED. Cordova plugin to add google services support
MIT License
41 stars 107 forks source link

Could not find google-services.json while looking in [src/nullnull/debug #8

Closed rtm closed 6 years ago

rtm commented 6 years ago

On a brand new Cordova (8.0.0) project, having installed the Android platform (7.0.0), installed the google-support-google-services plugin (1.2.0), placed a google-services.json file in the project root, and adding the <resource-file> directive to config.xml, upon trying to build, I get

Could not find google-services.json while looking in [src/nullnull/debug, src/debug/nullnull, src/nullnull, src/debug, src/nullnullDebug]

Obviously, something is null which should not be--but what might that be, and where is it supposed to be set?

Is it relevant that $CORDOVA_HOME/platforms/android/app does not contain google-services.json, even though config.json contains

   <resource-file src="google-services.json" target="app/google-services.json" />

It is probably irrelevant, but I am also getting deprecation messages during the build, such as

publishNonDefault is deprecated and has no effect anymore. All variants are now published.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
        at build_bz6sxgr7c1apkp52ew2hx590z.run(/home/rtm/repos/nims/blue/cordova/platforms/android/app/build.gradle:144)
Could not find google-services.json while looking in [src/nullnull/debug, src/debug/nullnull, src/nullnull, src/debug, src/nullnullDebug]
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)

Are these messages related to some version issue with the Android SDK, perhaps?

Diegow3b commented 6 years ago

Same problem over here

conormag commented 6 years ago

and here

Diegow3b commented 6 years ago

not find a sollution yet, someone help please?

chemerisuk commented 6 years ago

This is just a spam in log output that does not break a build.

rtm commented 6 years ago

@chemerisuk That's reassuring, thanks.

However, a wise man--my mentor--once told me that I should worry about all warnings from compiles and builds. He used to spend unreasonable amounts of time tracking them down and getting rid of them. In many cases, that turned out to be time well spent. In this particular case, who is actually putting out this spurious message?

Diegow3b commented 6 years ago

The only warning im getting is google-services.json not found.;.. doenst matter where i place it... root android project... app folder... and ofc changing the xml with app/google-services.json or just google-services.json

And yes i followed google steps setting the others variables on both build.gradle

dunglehome commented 6 years ago

I Resolved warning message by adding a debug and a release directories to project such as: MyApplication/app/src/debug and MyApplication/app/src/release/ - then copy google-services.json file to both of these locations.

shawns582 commented 6 years ago

@dunnleaddress How did you add those directories to the project? Besides actually creating the directories, did you add a line to your project.properties file or AndroidManifiest.xml or config.xml?

dunglehome commented 6 years ago

@shawns582 i created the directories manually, this is because it is depending on what project template you select the directories get created accordingly, so manual creation is OK. and I only have AndroidManifiest.xml so here it is:

<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.dule.myapplication3">

<!--
Adding permission to receive this Bootup Broadcast
Then we need to register our BroadcastReceiver, we do it in application tag
but outside activity tag
-->

<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">

    <activity android:name=".MainActivity"
        android:label="@string/app_name"
        android:theme="@style/AppTheme.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <activity android:name=".SettingsActivity"></activity>

    <service android:name=".MyService" />

    <receiver android:name=".StartActivityOnBootBroadcastReceiver">
        <intent-filter>
            <action android:name="android.intent.action.BOOT_COMPLETED" />
            <!--on some devices receiver will not be booted up or triggered if the device is
            not completely power recycle so we need the below line, TYPE IN MANUALLY-->
            <action android:name="android.intent.action.QUICKBOOT_POWERON" />
        </intent-filter>
    </receiver>

</application>

dunglehome commented 6 years ago

screenclip

shawns582 commented 6 years ago

Thanks for the help. I created a line in my config.xml to put the google-services.json into my main Android folder and it worked

On Tue, Sep 18, 2018, 12:51 PM Dung Le notifications@github.com wrote:

[image: screenclip] https://user-images.githubusercontent.com/4603672/45712594-f8719480-bb49-11e8-8a0e-b3111a56a825.png

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/chemerisuk/cordova-support-google-services/issues/8#issuecomment-422527628, or mute the thread https://github.com/notifications/unsubscribe-auth/AKw35Cw3g4a0iGDSYZQBwsLvkYln8hTeks5ucU7RgaJpZM4UxXG8 .

moulanaaidi commented 6 years ago

@shawns582 hi, may i have the line u put inside the config.xml?

shawns582 commented 5 years ago

under <platform name="android" ...>

added this: <resource-file src="google-services.json" target="app/google-services.json" />

under <platform name="ios" ...>

added this:

On Thu, Sep 20, 2018 at 3:47 AM Moulana Aidi notifications@github.com wrote:

@shawns582 https://github.com/shawns582 hi, may i have the line u put inside the config.xml?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/chemerisuk/cordova-support-google-services/issues/8#issuecomment-423137194, or mute the thread https://github.com/notifications/unsubscribe-auth/AKw35NEs_7qkFXlBQaXJTAjBYxQWv3g9ks5uc3IugaJpZM4UxXG8 .

hasan642 commented 5 years ago

upgrade com.google.gms:google-services to 4.0.2 solve this issue

itshazlan commented 5 years ago

@hasanal1995 in which file should I change?

BorntraegerMarc commented 5 years ago

@chemerisuk I agree with @rtm that this error should be fixed. I lost some time to debug why it actually happens and then found this issue report.

I made some bad experiences in the past where a exception shouldn't have caused any issues but then did 🙂

chemerisuk commented 5 years ago

@BorntraegerMarc I don't see this log message in v1.3. It seems like google fixed the error.

BorntraegerMarc commented 5 years ago

@chemerisuk that's weird. because I just updated to v1.3.1 two hours ago and I still saw the error.