我正在使用带有5.6.1的Firebase数据库。我正在使用(新)gradle方法构建一个Android应用程序,因为我有太多的字段引用而不是允许的。 Firebase说明如下:
1.Project-level build.gradle (<project>/build.gradle):
buildscript {
dependencies {
// Add this line
classpath 'com.google.gms:google-services:3.2.0'
}
}
2.App-level build.gradle (<project>/<app-module>/build.gradle):
dependencies {
// Add this line
compile 'com.google.firebase:firebase-core:12.0.0'
}
...
// Add to the bottom of the file
apply plugin: 'com.google.gms.google-services'
这是我的 AndroidManifest.xml 文件:
-<manifest android:versionName="1.0" android:versionCode="1" android:installLocation="preferExternal" xmlns:tools="http://schemas.android.com/tools" package="com.unity3d.player" xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:anyDensity="true" android:xlargeScreens="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true"/>
-<application android:name="android.support.multidex.MultiDexApplication" android:debuggable="true" android:label="@string/app_name" android:icon="@drawable/app_icon" android:theme="@style/UnityThemeSelector">
-<activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name">
-<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true"/>
</activity>
<activity android:name="com.facebook.unity.FBUnityLoginActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"/>
<activity android:name="com.facebook.unity.FBUnityDialogsActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"/>
<activity android:name="com.facebook.unity.FBUnityAppLinkActivity" android:exported="true"/>
<activity android:name="com.facebook.unity.FBUnityDeepLinkingActivity" android:exported="true"/>
<activity android:name="com.facebook.unity.FBUnityGameRequestActivity"/>
<activity android:name="com.facebook.unity.FBUnityCreateGameGroupActivity"/>
<activity android:name="com.facebook.unity.FBUnityJoinGameGroupActivity"/>
<activity android:name="com.facebook.unity.AppInviteDialogActivity"/>
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="fb142416569762965"/>
<provider android:name="com.facebook.FacebookContentProvider" android:exported="true" android:authorities="com.facebook.app.FacebookContentProvider142416569762965"/>
</application>
</manifest>
此处,项目级build.gradle表示 Assets / Plugins / Android / mainTemplate.gradle 中的mainTemplate.gradle文件。但是我应该在哪里添加应用级别的成绩档案?我试图创建一个名为&#39; app&#39;的文件夹。在资产/插件/ Android 中编写指示的语句。但是,它似乎不起作用。