Couldn't build my application with realm. throws error saying realm's constructor is not found in iOS and can't configure realm in android - realm

Recently I changed my system and when I try to build my application in my new MacBook it doesn't builds with realm.
Two errors in android.
1) A problem occurred configuring project ':realm'.
compileSdkVersion is not specified.
2) A problem occurred evaluating project ':realm'.
Extension not initialized yet, couldn't access compileSdkVersion.
and in iOS it says it couldn't find the realm constructor.
I've already checked the compilesdk versions on the main gradle file and in the realm module's gradle file. they look fine.
{
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
}
allprojects {
repositories {
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$projectDir/../../react-native/android"
}
}
}
apply plugin: 'com.android.library'
task forwardDebugPort(type: Exec) {
def adb = android.getAdbExe()?.toString() ?: 'false'
commandLine adb, 'forward', 'tcp:8083', 'tcp:8083'
ignoreExitValue true
doLast {
if (execResult.getExitValue() != 0) {
logger.error(
'===========================================================================\n' +
'WARNING: Failed to automatically forward port 8083.\n' +
'In order to use Realm in Chrome debugging mode, port 8083 must be forwarded\n' +
'from localhost to the device or emulator being used to run the application.\n' +
'You may need to add the appropriate flags to the command that failed:\n' +
' adb forward tcp:8083 tcp:8083\n' +
'===========================================================================\n'
)
}
}
}
android {
compileSdkVersion rootProject.hasProperty("compileSdkVersion") ? rootProject.compileSdkVersion : 28
buildToolsVersion rootProject.hasProperty("buildToolsVersion") ? rootProject.buildToolsVersion : "28.0.3"
defaultConfig {
minSdkVersion rootProject.hasProperty("minSdkVersion") ? rootProject.minSdkVersion : 16
targetSdkVersion rootProject.hasProperty("targetSdkVersion") ? rootProject.targetSdkVersion : 28
}
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn forwardDebugPort
}
}
def dependencyType = "implementation"
try {
project.getConfigurations().getByName("implementation")
} catch (UnknownConfigurationException e) {
dependencyType = "compile" // Pre 3.0 Android Gradle Plugin
}
project.dependencies {
add(dependencyType, fileTree(dir: 'libs', include: ['*.jar']))
add(dependencyType, 'org.nanohttpd:nanohttpd:2.2.0')
add(dependencyType, 'com.facebook.react:react-native:+')
}
}

Related

Could not find com.google.firebase:firebase-analytics-ktx:. Required by: project :app

I followed the steps in registering my mobile application in firestore but when I try running the code I get the following error. I have downloaded the google services.json from firestore while registering my app and added it to android/app level of my project. Also I have added 'com.google.firebase:firebase-analytics-ktx' in my android/app/build gradle file
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
> Could not find com.google.firebase:firebase-analytics-ktx:.
Required by:
project :app
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
Exception: Gradle task assembleDebug failed with exit code 1
My project level build gradle is as below
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.4'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
My app level build gradle is as below
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 28
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.ashniz.firestore_time_compare"
minSdkVersion 21
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation 'androidx.multidex:multidex:2.0.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.google.firebase:firebase-analytics-ktx'
}
apply plugin: 'com.google.gms.google-services'
Does anyone know how to fix this issue? Thank you
try to replace this dep
implementation 'com.google.firebase:firebase-analytics-ktx'
with
implementation 'com.google.firebase:firebase-analytics:17.5.0'
I could only get the firebase BoM working with build.gradle.kts like this:
implementation(platform("com.google.firebase:firebase-bom:28.4.1"))
implementation("com.google.firebase:firebase-analytics-ktx")
implementation("com.google.firebase:firebase-crashlytics-ktx")
Instead of depending on specific versions of different Firebase libraries that might be incompatible, you might want to start using Bill of Materials, such as:
dependencies {
// Import the BoM for the Firebase platform
implementation platform('com.google.firebase:firebase-bom:26.5.0')
// Declare the dependencies for the desired Firebase products without specifying versions
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.google.firebase:firebase-firestore-ktx'
}
The Firebase Android BoM (Bill of Materials) enables you to manage all your Firebase library versions by specifying only one version — the BoM's version.
When you use the Firebase BoM in your app, the BoM automatically pulls in the individual library versions mapped to BoM's version. All the individual library versions will be compatible. When you update the BoM's version in your app, all the Firebase libraries that you use in your app will update to the versions mapped to that BoM version.
Learn more at https://firebase.google.com/docs/android/learn-more#bom
I had a similar issue, in my case I was using BoM, but I have declared the BoM dependency like
implementation 'com.google.firebase:firebase-bom:28.0.1' // without platform
instead of
implementation platform('com.google.firebase:firebase-bom:28.0.1')
All you need that update flutter sdk by running that command in terminal:
flutter upgrade
After completing the update, build your new project and link it to firebase but make sure that in 'PROJECT_PATH/android/app/build.gradle', minSdkVersion is 19 or higher.
applicationId "com.example.flutter_application_1"
minSdkVersion 19 // here
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
I had the same issue, the Bom implementation that worked for me was this -
implementation platform('com.google.firebase:firebase-bom:29.2.1')
and as mentioned in docs when using Bom implementation we don't require to specify the version of analytics
The following should be used with java -
implementation 'com.google.firebase:firebase-analytics'
With java
and with kotlin-
implementation 'com.google.firebase:firebase-analytics-ktx'
with kotlin
The following not be used in conjunction with Bom
implementation 'com.google.firebase:firebase-analytics:17.5.0'
bom take cares of version
You can visit - https://firebase.google.com/docs/android/learn-more?authuser=0&hl=en#bom for more on the Bill of Materials (BoM)
try adding this to your biuld.gradle file:
implementation 'com.google.firebase:firebase-auth-ktx:21.1.0'

React Native build fails after add firebase setup

I need to set up my react-native app with firebase and I followed the firebase setup guide and after that rerun the app but it fails with giving me errors, I tried lots of solutions that available on the internet but still my issue is not fixed.
if anyone have got this issue before and fixed it already, could you please help me to fix this issue.
this is the error:
* What went wrong:
Could not determine the dependencies of task ':app:preDebugBuild'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
> Could not find com.google.android.gms:play-services-measurement:12.0.1.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/google/android/gms/play-services-measurement/12.0.1/play-services-measurement-12.0.1.pom
- https://dl.google.com/dl/android/maven2/com/google/android/gms/play-services-measurement/12.0.1/play-services-measurement-12.0.1.aar
- file:/home/iswan/.m2/repository/com/google/android/gms/play-services-measurement/12.0.1/play-services-measurement-12.0.1.pom
- file:/home/iswan/.m2/repository/com/google/android/gms/play-services-measurement/12.0.1/play-services-measurement-12.0.1.aar
- file:/home/iswan/works/office/xforce/xForceMobile/node_modules/react-native/android/com/google/android/gms/play-services-measurement/12.0.1/play-services-measurement-12.0.1.pom
- file:/home/iswan/works/office/xforce/xForceMobile/node_modules/react-native/android/com/google/android/gms/play-services-measurement/12.0.1/play-services-measurement-12.0.1.aar
- file:/home/iswan/works/office/xforce/xForceMobile/node_modules/jsc-android/dist/com/google/android/gms/play-services-measurement/12.0.1/play-services-measurement-12.0.1.pom
- file:/home/iswan/works/office/xforce/xForceMobile/node_modules/jsc-android/dist/com/google/android/gms/play-services-measurement/12.0.1/play-services-measurement-12.0.1.aar
- https://jcenter.bintray.com/com/google/android/gms/play-services-measurement/12.0.1/play-services-measurement-12.0.1.pom
- https://jcenter.bintray.com/com/google/android/gms/play-services-measurement/12.0.1/play-services-measurement-12.0.1.aar
- https://jitpack.io/com/google/android/gms/play-services-measurement/12.0.1/play-services-measurement-12.0.1.pom
- https://jitpack.io/com/google/android/gms/play-services-measurement/12.0.1/play-services-measurement-12.0.1.aar
Required by:
project :app > com.google.firebase:firebase-analytics:17.2.0
> Could not find com.google.android.gms:play-services-measurement-api:12.0.1.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/google/android/gms/play-services-measurement-api/12.0.1/play-services-measurement-api-12.0.1.pom
- https://dl.google.com/dl/android/maven2/com/google/android/gms/play-services-measurement-api/12.0.1/play-services-measurement-api-12.0.1.aar
- file:/home/iswan/.m2/repository/com/google/android/gms/play-services-measurement-api/12.0.1/play-services-measurement-api-12.0.1.pom
- file:/home/iswan/.m2/repository/com/google/android/gms/play-services-measurement-api/12.0.1/play-services-measurement-api-12.0.1.aar
- file:/home/iswan/works/office/xforce/xForceMobile/node_modules/react-native/android/com/google/android/gms/play-services-measurement-api/12.0.1/play-services-measurement-api-12.0.1.pom
- file:/home/iswan/works/office/xforce/xForceMobile/node_modules/react-native/android/com/google/android/gms/play-services-measurement-api/12.0.1/play-services-measurement-api-12.0.1.aar
- file:/home/iswan/works/office/xforce/xForceMobile/node_modules/jsc-android/dist/com/google/android/gms/play-services-measurement-api/12.0.1/play-services-measurement-api-12.0.1.pom
- file:/home/iswan/works/office/xforce/xForceMobile/node_modules/jsc-android/dist/com/google/android/gms/play-services-measurement-api/12.0.1/play-services-measurement-api-12.0.1.aar
- https://jcenter.bintray.com/com/google/android/gms/play-services-measurement-api/12.0.1/play-services-measurement-api-12.0.1.pom
- https://jcenter.bintray.com/com/google/android/gms/play-services-measurement-api/12.0.1/play-services-measurement-api-12.0.1.aar
- https://jitpack.io/com/google/android/gms/play-services-measurement-api/12.0.1/play-services-measurement-api-12.0.1.pom
- https://jitpack.io/com/google/android/gms/play-services-measurement-api/12.0.1/play-services-measurement-api-12.0.1.aar
Required by:
project :app > com.google.firebase:firebase-analytics:17.2.0
> Could not find com.google.android.gms:play-services-measurement-sdk:12.0.1.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/google/android/gms/play-services-measurement-sdk/12.0.1/play-services-measurement-sdk-12.0.1.pom
- https://dl.google.com/dl/android/maven2/com/google/android/gms/play-services-measurement-sdk/12.0.1/play-services-measurement-sdk-12.0.1.aar
- file:/home/iswan/.m2/repository/com/google/android/gms/play-services-measurement-sdk/12.0.1/play-services-measurement-sdk-12.0.1.pom
- file:/home/iswan/.m2/repository/com/google/android/gms/play-services-measurement-sdk/12.0.1/play-services-measurement-sdk-12.0.1.aar
- file:/home/iswan/works/office/xforce/xForceMobile/node_modules/react-native/android/com/google/android/gms/play-services-measurement-sdk/12.0.1/play-services-measurement-sdk-12.0.1.pom
- file:/home/iswan/works/office/xforce/xForceMobile/node_modules/react-native/android/com/google/android/gms/play-services-measurement-sdk/12.0.1/play-services-measurement-sdk-12.0.1.aar
- file:/home/iswan/works/office/xforce/xForceMobile/node_modules/jsc-android/dist/com/google/android/gms/play-services-measurement-sdk/12.0.1/play-services-measurement-sdk-12.0.1.pom
- file:/home/iswan/works/office/xforce/xForceMobile/node_modules/jsc-android/dist/com/google/android/gms/play-services-measurement-sdk/12.0.1/play-services-measurement-sdk-12.0.1.aar
- https://jcenter.bintray.com/com/google/android/gms/play-services-measurement-sdk/12.0.1/play-services-measurement-sdk-12.0.1.pom
- https://jcenter.bintray.com/com/google/android/gms/play-services-measurement-sdk/12.0.1/play-services-measurement-sdk-12.0.1.aar
- https://jitpack.io/com/google/android/gms/play-services-measurement-sdk/12.0.1/play-services-measurement-sdk-12.0.1.pom
- https://jitpack.io/com/google/android/gms/play-services-measurement-sdk/12.0.1/play-services-measurement-sdk-12.0.1.aar
Required by:
project :app > com.google.firebase:firebase-analytics:17.2.0
build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
googlePlayServicesVersion = "+"
}
repositories {
google()
maven { url "https://maven.google.com" }
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:3.4.2")
classpath 'com.google.gms:google-services:4.3.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
google()
maven { url "https://maven.google.com" }
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
jcenter()
maven { url 'https://jitpack.io' }
}
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.google.android.gms'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "12.0.1"
}
}
}
}
}
#AjithMadhu I found the issue, it because of the below section. I hardcoded before a month ago and I didn't notice that one.
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.google.android.gms'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "12.0.1"
}
}
}
}
well this is how I done. please refer this,
android/build.gradle
dependencies {
classpath("com.android.tools.build:gradle:3.4.2")
+ classpath 'com.google.gms:google-services:4.3.3' // check this line
}
android/app/build.gradle
dependencies {
+ implementation "com.google.android.gms:play-services-base:17.1.0"
+ implementation 'com.google.firebase:firebase-core:17.2.1'
+ implementation 'com.google.firebase:firebase-messaging:20.0.1'
}
android/
grade.properties
firebaseCoreVersion=17.2.1
firebaseMessagingVersion=20.0.1
MainApplication.java
+ import io.invertase.firebase.messaging.RNFirebaseMessagingPackage;
+ import io.invertase.firebase.notifications.RNFirebaseNotificationsPackage;
#Override
protected List<ReactPackage> getPackages() {
#SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
packages.add(new RNFirebaseMessagingPackage());
packages.add(new RNFirebaseNotificationsPackage());
return packages;
}

RNfirebase installation issue with firebase-functions 11.6

I keep getting the following error when I am trying to run the build after completing all the RNFIREBASE steps to install Firebase for my react-native project.
RN version: 0.55.3
Using appcenter for builds
The build was working fine on appcenter when I did not add firebase. The build on iOS is working on the phone and appcenter.
Error
> - Trying to run build on Appcenter. Using configuration: release
>
> Resolved com.facebook.react:react-native:0.55.3 in :react-native-firebase:releaseCompileClasspath
Resolved com.android.support:support-v4:27.0.2 in :react-native-firebase:releaseCompileClasspath
Resolved com.crashlytics.sdk.android:crashlytics:2.9.3 in :react-native-firebase:releaseCompileClasspath
Resolved com.google.android.gms:play-services-base:11.6.0 in :react-native-firebase:releaseCompileClasspath
Resolved com.google.firebase:firebase-ads:11.6.0 in :react-native-firebase:releaseCompileClasspath
Resolved com.google.firebase:firebase-auth:11.6.0 in :react-native-firebase:releaseCompileClasspath
Resolved com.google.firebase:firebase-config:11.6.0 in :react-native-firebase:releaseCompileClasspath
Resolved com.google.firebase:firebase-core:11.6.0 in :react-native-firebase:releaseCompileClasspath
Resolved com.google.firebase:firebase-crash:11.6.0 in :react-native-firebase:releaseCompileClasspath
Resolved com.google.firebase:firebase-database:11.6.0 in :react-native-firebase:releaseCompileClasspath
Resolved com.google.firebase:firebase-firestore:11.6.0 in :react-native-firebase:releaseCompileClasspath
Resolved com.google.firebase:firebase-invites:11.6.0 in :react-native-firebase:releaseCompileClasspath
Resolved com.google.firebase:firebase-storage:11.6.0 in :react-native-firebase:releaseCompileClasspath
Resolved com.google.firebase:firebase-messaging:11.6.0 in :react-native-firebase:releaseCompileClasspath
Resolved com.google.firebase:firebase-perf:11.6.0 in :react-native-firebase:releaseCompileClasspath
Resolved me.leolin:ShortcutBadger:1.1.21 in :react-native-firebase:releaseCompileClasspath
Resolved com.android.support:multidex:1.0.2 in :react-native-firebase:releaseCompileClasspath
:react-native-firebase:compileReleaseAidl FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':react-native-firebase:releaseCompileClasspath'.
> Could not find com.google.firebase:firebase-functions:11.6.0.
Searched in the following locations:
file:/Users/vsts/Library/Android/sdk/extras/m2repository/com/google/firebase/firebase-functions/11.6.0/firebase-functions-11.6.0.pom
file:/Users/vsts/Library/Android/sdk/extras/m2repository/com/google/firebase/firebase-functions/11.6.0/firebase-functions-11.6.0.jar
file:/Users/vsts/Library/Android/sdk/extras/google/m2repository/com/google/firebase/firebase-functions/11.6.0/firebase-functions-11.6.0.pom
file:/Users/vsts/Library/Android/sdk/extras/google/m2repository/com/google/firebase/firebase-functions/11.6.0/firebase-functions-11.6.0.jar
file:/Users/vsts/Library/Android/sdk/extras/android/m2repository/com/google/firebase/firebase-functions/11.6.0/firebase-functions-11.6.0.pom
file:/Users/vsts/Library/Android/sdk/extras/android/m2repository/com/google/firebase/firebase-functions/11.6.0/firebase-functions-11.6.0.jar
file:/Users/vsts/.m2/repository/com/google/firebase/firebase-functions/11.6.0/firebase-functions-11.6.0.pom
file:/Users/vsts/.m2/repository/com/google/firebase/firebase-functions/11.6.0/firebase-functions-11.6.0.jar
https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-functions/11.6.0/firebase-functions-11.6.0.pom
https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-functions/11.6.0/firebase-functions-11.6.0.jar
https://jcenter.bintray.com/com/google/firebase/firebase-functions/11.6.0/firebase-functions-11.6.0.pom
https://jcenter.bintray.com/com/google/firebase/firebase-functions/11.6.0/firebase-functions-11.6.0.jar
file:/Users/vsts/agent/2.140.0/work/1/s/node_modules/react-native/android/com/google/firebase/firebase-functions/11.6.0/firebase-functions-11.6.0.pom
file:/Users/vsts/agent/2.140.0/work/1/s/node_modules/react-native/android/com/google/firebase/firebase-functions/11.6.0/firebase-functions-11.6.0.jar
https://maven.google.com/com/google/firebase/firebase-functions/11.6.0/firebase-functions-11.6.0.pom
https://maven.google.com/com/google/firebase/firebase-functions/11.6.0/firebase-functions-11.6.0.jar
Required by:
project :react-native-firebase
android/build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.google.gms:google-services:4.0.1'
classpath 'io.fabric.tools:gradle:1.25.4'
classpath 'com.google.firebase:firebase-plugins:1.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
google()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven {
url 'https://maven.google.com/'
name 'Google'
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.google.android.gms') {
details.useVersion '11.6.0'
}
if (requested.group == 'com.google.firebase') {
details.useVersion '11.6.0'
}
}
}
}
}
ext {
compileSdkVersion = 27
buildToolsVersion = '27.0.3'
}
subprojects { subproject ->
afterEvaluate{
if((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) {
android {
compileSdkVersion rootProject.ext.compileSdkVersion
// buildToolsVersion rootProject.ext.buildToolsVersion
lintOptions {
checkReleaseBuilds false
}
}
}
}
}
app/build.gradle
apply plugin: "com.android.application"
apply plugin: "io.fabric"
apply plugin: "com.google.firebase.firebase-perf"
import com.android.build.OutputFile
project.ext.react = [
entryFile: "index.js"
]
project.ext.envConfigFiles = [
debug : ".env",
staging: ".env",
release: ".env",
]
apply from: "../../node_modules/react-native/react.gradle"
apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"
def enableSeparateBuildPerCPUArchitecture = false
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = false
android {
compileSdkVersion rootProject.ext.compileSdkVersion
// buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
resValue "string", "build_config_package", "in.app"
applicationId "in.app"
minSdkVersion 19
targetSdkVersion 27
versionCode 5
versionName "2.1.5"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
signingConfigs {
release {
if (project.hasProperty('RELEASE_STORE_FILE')) {
storeFile file(RELEASE_STORE_FILE)
storePassword RELEASE_STORE_PASSWORD
keyAlias RELEASE_KEY_ALIAS
keyPassword RELEASE_KEY_PASSWORD
}
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
buildTypes {
debug {
buildConfigField "String", "CODE_PUSH_KEY", '""'
applicationIdSuffix ".debug"
versionNameSuffix '-DEBUG'
}
releaseStaging {
// initWith(buildTypes.release)
buildConfigField "String", "CODE_PUSH_KEY", ''
signingConfig signingConfigs.release
applicationIdSuffix ".staging"
}
release {
buildConfigField "String", "CODE_PUSH_KEY", ''
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release
}
}
applicationVariants.all { variant ->
variant.outputs.each { output ->
def versionCodes = ["armeabi-v7a": 1, "x86": 2]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
}
dependencies {
implementation project(':react-native-firebase')
implementation 'com.google.firebase:firebase-functions:16.0.1'
implementation('com.crashlytics.sdk.android:crashlytics:2.9.4#aar') { transitive = true }
implementation('com.crashlytics.sdk.android:crashlytics:2.9.4#aar') { transitive = true }
implementation 'com.google.android.gms:play-services-base:15.0.1'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-crash:11.8.0'
implementation 'com.google.firebase:firebase-perf:16.0.0'
api project(':react-native-vector-icons')
api project(':react-native-svg')
api project(':react-native-paytm')
api project(':react-native-image-resizer')
api project(':react-native-image-picker')
api project(':react-native-google-fit')
api project(':react-native-device-info')
api project(':react-native-config')
api project(':react-native-code-push')
api project(':react-native-razorpay')
api fileTree(include: ['*.jar'], dir: 'libs')
api 'com.android.support:appcompat-v7:26.0.1'
api 'com.facebook.react:react-native:+'
// From node_modules
}
// Run this once to be able to run the application with BUCK
// puts all api dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.api
into 'libs'
}
apply plugin: 'com.google.gms.google-services'

Google Game Service error ratio of 100%: how to solve it?

My Android application is linked to a Google Game Services project which was working until some days ago.
However, now its error ratio is 100%. Failure of every request.
It is not my application. Indeed, its errors occurs even when I try to open the leaderboard on Play Games.
I do not want to create another application, so I want to solve it.
what can I do ?
For example, I have a leaderboard in the Play Game, that does not open in the Play Games application (the application that comes within Android).
In the application I am develloping, it is the same, I try to open the leaderboard with the code:
Games.getLeaderboardsClient(MyApplication.getAppContext(), GoogleSignIn.getLastSignedInAccount(this))
.getLeaderboardIntent(getString(R.string.leaderboard_id))
.addOnSuccessListener(new OnSuccessListener<Intent>() {
#Override
public void onSuccess(Intent intent) {
Log.d("LeaderBoard","onSuccess");
startActivityForResult(intent, RC_LEADERBOARD_UI);
}
}).addOnFailureListener(new OnFailureListener(){
#Override
public void onFailure(#NonNull Exception e) {
Log.d("LeaderBoard",e.toString());
Toast.makeText(thisActivity, "Failed to open the leaderboard.", Toast.LENGTH_SHORT).show();
}
});
It just open a blue screen for two seconds that just closes without showing any leaderboard.
I tryed to create a new leaderboard, which was successfuly created, but it started to happen the same with this one after I tryied to add a score to it:
Games.getLeaderboardsClient(this, GoogleSignIn.getLastSignedInAccount(this))
.submitScore(getString(R.string.leaderboard_id), score);
These codes were working before. It stopped working without any apparent reason.
<< Informations about the project >>
gradle(Project)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
//classpath 'com.android.tools.build:gradle:2.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.1.0'
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
maven {
url "https://maven.google.com"
}
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
gradle(Module)
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '27.0.2'
defaultConfig {
applicationId "com.cerveja.qof.pedro.qof_cerveja"
minSdkVersion 16
targetSdkVersion 27
versionCode 13
versionName "2.0.3"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
}
)
//noinspection GradleCompatible
compile 'com.android.support:appcompat-v7:27.0.2'
//
//
//compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.google.android.gms:play-services-ads:11.8.0'
compile 'com.google.android.gms:play-services-auth:11.8.0'
compile 'com.google.android.gms:play-services-games:11.8.0'
compile 'com.android.support:support-v4:27.0.2'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.facebook.android:facebook-login:[4,5)'
compile 'com.facebook.android:facebook-share:[4,5)'
//compile 'com.google.firebase:firebase-core:11.6.2'
//compile 'com.google.firebase:firebase-auth:11.6.2'
compile 'com.google.firebase:firebase-core:11.8.0'
compile 'com.google.firebase:firebase-auth:11.8.0'
compile 'net.zetetic:android-database-sqlcipher:3.5.9#aar'
testCompile 'junit:junit:4.12'
implementation 'com.google.ads.mediation:applovin:7.6.1.0'
implementation 'com.google.ads.mediation:inmobi:6.2.4.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.android.support:recyclerview-v7:27.0.2'
//implementation 'com.applovin:applovin-sdk:7.6.1'
implementation fileTree(include: ['*.jar'], dir: 'libs')
//implementation 'com.google.ads.mediation:chartboost:7.0.1.0'
//implementation files('libs/chartboost.jar')
implementation files('libs/applovin-sdk-7.6.2.jar')
}
apply plugin: 'com.google.gms.google-services'

Spring boot + gradle - H2 db is not accessible with 404 error

My H2 web interface is not accessible. Though Java code can get data but web interface is failing to connect to it. This started happening after I rebooted my system.
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Tue May 02 21:34:04 PDT 2017
There was an unexpected error (type=Not Found, status=404).
No message available
Gradle File: build.gradle:-
buildscript {
ext {
springBootVersion = '1.4.4.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
jar {
baseName = 'cg'
version = '0.0.1-SNAPSHOT'
}
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-jdbc')
compile ("commons-dbcp:commons-dbcp")
compile('org.springframework.boot:spring-boot-starter-security')
compile('org.springframework.boot:spring-boot-starter-web')
runtime('org.springframework.boot:spring-boot-devtools')
runtime('com.h2database:h2')
testCompile('org.springframework.boot:spring-boot-starter-test')
}

Resources