我知道,至少还有20篇类似的文章,但我似乎无法解决。 我正在尝试将Firebase服务连接到使用Gluon mobile开发的应用程序。根据Firebase指南,您必须在项目和应用程序级别添加一些行到build.gradle并添加JSON文件。 我已经读了2年前的帖子,但仍然遇到困难。 Firebase分析无法对我的应用程序进行响应。
我将发布一些数据:
build.gradle在项目级别
apply plugin: 'base'
buildscript {
repositories {
google() // Google's Maven repository
}
dependencies {
classpath 'com.google.gms:google-services:3.1.1'
}
}
allprojects {
repositories {
google() // Google's Maven repository
}
}
build.gradle在应用程序级别
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:1.3.17'
}
}
apply plugin: 'org.javafxports.jfxmobile'
repositories {
jcenter()
maven {
url 'http://nexus.gluonhq.com/nexus/content/repositories/releases'
}
}
mainClassName = 'net.studionotturno.Connect4'
dependencies {
compile 'com.gluonhq:charm:5.0.2'
compile 'com.gluonhq:glisten-afterburner:1.4.1'
implementation 'com.google.firebase:firebase-analytics:17.2.0'
}
jfxmobile {
javafxportsVersion = '8.60.9'
downConfig {
version = '3.8.6'
// Do not edit the line below. Use Gluon Mobile Settings in your project context menu instead
plugins 'display', 'lifecycle', 'statusbar', 'storage'
}
android {
manifest = 'src/android/AndroidManifest.xml'
dexOptions {
javaMaxHeapSize '3g'
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
}
ios {
infoPList = file('src/ios/Default-Info.plist')
forceLinkClasses = [
'net.studionotturno.**.*',
'com.gluonhq.**.*',
'javax.annotations.**.*',
'javax.inject.**.*',
'javax.json.**.*',
'org.glassfish.json.**.*'
]
}
}
apply plugin: 'com.google.gms.google-services'
Android清单
<?xml version="1.0" encoding="UTF-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="net.studionotturno" android:versionCode="1" android:versionName="1.0">
<supports-screens android:xlargeScreens="true"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="26"/>
<application android:label="Connect4" android:name="android.support.multidex.MultiDexApplication" android:icon="@mipmap/ic_launcher">
<activity android:name="javafxports.android.FXActivity" android:label="Connect4" android:configChanges="orientation|screenSize">
<meta-data android:name="main.class" android:value="net.studionotturno.Connect4"/>
<meta-data android:name="debug.port" android:value="0"/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name="com.gluonhq.impl.charm.down.plugins.android.PermissionRequestActivity" />
</application>
</manifest>
我已使用此Android软件包名称(在第一行)在Firebase上注册了该应用程序
我可能拼错了包裹的名称,但是在哪里? 基本上,Firebase和应用程序之间不会同步