React Native build fails after add firebase setup - firebase

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;
}

Related

Could not resolve com.google.firebase:firebase-messaging:[10.2.1, 12.1.0)

I want to share a problem that become a nightmare for me:
ERROR: Unable to resolve dependency for ':OnlineHeadBall2#debug/compileClasspath': Could not resolve com.google.firebase:firebase-messaging:[10.2.1, 12.1.0).
When I try to build my project, I get an error on console:
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':appName:transformClassesAndResourcesWithR8ForRelease'.
> Could not resolve all task dependencies for configuration ':appName:releaseCompileClasspath'.
> Could not resolve com.google.firebase:firebase-messaging:[10.2.1, 12.1.0).
Required by:
project :appName > com.onesignal:OneSignal:3.10.9
> Failed to list versions for com.google.firebase:firebase-messaging.
> Could not list versions using M2 pattern 'https://raw.githubusercontent.com/HyprMXMobile/Android-SDKs/master/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier])(.[ext])'.
> Could not get resource 'https://raw.githubusercontent.com/HyprMXMobile/Android-SDKs/master/com/google/firebase/firebase-messaging/'.
> Could not GET 'https://raw.githubusercontent.com/HyprMXMobile/Android-SDKs/master/com/google/firebase/firebase-messaging/'. Received status code 400 from server: Bad Request
> Failed to list versions for com.google.firebase:firebase-messaging.
> Unable to load Maven meta-data from https://s3.amazonaws.com/moat-sdk-builds/com/google/firebase/firebase-messaging/maven-metadata.xml.
> Could not get resource 'https://s3.amazonaws.com/moat-sdk-builds/com/google/firebase/firebase-messaging/maven-metadata.xml'.
> Could not GET 'https://s3.amazonaws.com/moat-sdk-builds/com/google/firebase/firebase-messaging/maven-metadata.xml'. Received status code 403 from server: Forbidden
> Could not resolve com.google.android.gms:play-services-location:[10.2.1, 12.1.0).
Required by:
project :appName > com.onesignal:OneSignal:3.10.9
> Failed to list versions for com.google.android.gms:play-services-location.
> Could not list versions using M2 pattern 'https://raw.githubusercontent.com/HyprMXMobile/Android-SDKs/master/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier])(.[ext])'.
> Could not get resource 'https://raw.githubusercontent.com/HyprMXMobile/Android-SDKs/master/com/google/android/gms/play-services-location/'.
> Could not GET 'https://raw.githubusercontent.com/HyprMXMobile/Android-SDKs/master/com/google/android/gms/play-services-location/'. Received status code 400 from server: Bad Request
> Failed to list versions for com.google.android.gms:play-services-location.
> Unable to load Maven meta-data from https://s3.amazonaws.com/moat-sdk-builds/com/google/android/gms/play-services-location/maven-metadata.xml.
> Could not get resource 'https://s3.amazonaws.com/moat-sdk-builds/com/google/android/gms/play-services-location/maven-metadata.xml'.
> Could not GET 'https://s3.amazonaws.com/moat-sdk-builds/com/google/android/gms/play-services-location/maven-metadata.xml'. Received status code 403 from server: Forbidden
> Could not resolve com.google.android.gms:play-services-base:[10.2.1, 12.1.0).
Required by:
project :appName > com.onesignal:OneSignal:3.10.9
> Failed to list versions for com.google.android.gms:play-services-base.
> Could not list versions using M2 pattern 'https://raw.githubusercontent.com/HyprMXMobile/Android-SDKs/master/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier])(.[ext])'.
> Could not get resource 'https://raw.githubusercontent.com/HyprMXMobile/Android-SDKs/master/com/google/android/gms/play-services-base/'.
> Could not GET 'https://raw.githubusercontent.com/HyprMXMobile/Android-SDKs/master/com/google/android/gms/play-services-base/'. Received status code 400 from server: Bad Request
> Failed to list versions for com.google.android.gms:play-services-base.
> Unable to load Maven meta-data from https://s3.amazonaws.com/moat-sdk-builds/com/google/android/gms/play-services-base/maven-metadata.xml.
> Could not get resource 'https://s3.amazonaws.com/moat-sdk-builds/com/google/android/gms/play-services-base/maven-metadata.xml'.
> Could not GET 'https://s3.amazonaws.com/moat-sdk-builds/com/google/android/gms/play-services-base/maven-metadata.xml'. Received status code 403 from server: Forbidden
* Try:
Run with --stacktrace option to get the stack trace. Run with --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 23s
Error running command, return code: 1.
I feel that the suspicious in here is OneSignal. Therefore I apply the workaround in here to OneSignal, but my apk that I recently build is crash on starting. So the workaround does not work for me.
My general gradle file is below:
buildscript {
repositories {
google()
jcenter()
maven { url "https://maven.google.com" }
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.google.gms:google-services:4.3.3'
classpath 'io.fabric.tools:gradle:1.31.2'
}
}
allprojects {
repositories {
google()
mavenLocal()
mavenCentral()
jcenter()
}
}
This is my app gradle file:
/** GENERATE CMAKEFILES.TXT FOR GAME CLASSES **/
file("../../Classes/cmake/CMakeLists.txt").withWriter("utf-8") { writer ->
writer.writeLine("\n# APP NAME AUTOGENERATED CMAKELISTS FILE, DO NOT DELETE #\n")
writer.writeLine("set(GAME_SOURCE")
project.fileTree("../../Classes").matching {
include "**/**.cpp"
include "**/**.c"
}.sort().forEach { file ->
writer.writeLine("\t${file.path}")
}
writer.writeLine(")\n\n")
writer.write("set(GAME_HEADER\n")
project.fileTree("../../Classes").matching {
include "**/**.hpp"
include "**/**.h"
}.sort().forEach { file ->
writer.writeLine("\t${file.path}")
}
writer.writeLine(")\n\n")
}
/*********************************************/
buildscript {
repositories {
google()
jcenter()
maven { url "https://maven.google.com" }
maven { url 'https://plugins.gradle.org/m2/'}//onesignal
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.google.gms:google-services:4.3.3'
//noinspection GradleDynamicVersion
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.12.1'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.company.appName"
minSdkVersion 15
targetSdkVersion 28
versionCode 111908
versionName "1.119"
multiDexEnabled true
manifestPlaceholders = [onesignal_app_id : "*****************************",
onesignal_google_project_number: "REMOTE"]
ndk {
abiFilters "armeabi-v7a", "arm64-v8a"
}
externalNativeBuild {
if(PROP_BUILD_TYPE == 'ndk-build') {
ndkBuild {
targets 'appName'
def module_paths = [project.file("../../cocos2d").absolutePath,
project.file("../../cocos2d/cocos").absolutePath,
project.file("../../cocos2d/external").absolutePath]
arguments 'NDK_TOOLCHAIN_VERSION=clang'
arguments 'APP_PLATFORM=android-' + PROP_TARGET_SDK_VERSION
arguments '-j' + Runtime.runtime.availableProcessors()
if (OperatingSystem.current().isWindows()) {
module_paths = module_paths.collect {it.replaceAll('\\\\', '/')}
arguments 'NDK_MODULE_PATH=' + module_paths.join(";")
} else {
arguments 'NDK_MODULE_PATH=' + module_paths.join(':')
}
}
} else if(PROP_BUILD_TYPE == 'cmake') {
cmake {
targets 'appName'
arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE"
cppFlags "-frtti -fexceptions -fsigned-char"
}
}
}
}
dexOptions {
javaMaxHeapSize "4g"
}
packagingOptions {
exclude 'META-INF/rxjava.properties'
}
sourceSets.main {
java.srcDir "src"
res.srcDir "res"
jniLibs.srcDirs = ['jniLibs']
jni.srcDirs = []
manifest.srcFile "AndroidManifest.xml"
assets.srcDir "../../Resources"
}
externalNativeBuild {
if(PROP_BUILD_TYPE == 'ndk-build') {
ndkBuild {
path "jni/Android.mk"
}
} else if (PROP_BUILD_TYPE == 'cmake') {
cmake {
path "../../CMakeLists.txt"
}
}
}
signingConfigs {
release {
def userHomePath = System.properties['user.home']
def propertyFile = new File(userHomePath, ".gradle/gradle.properties") // Can be signing.properties as well
if (propertyFile.canRead()){
Properties props = new Properties()
props.load(new FileInputStream(propertyFile))
// Loading credentials from props
storeFile file(props['RELEASE_STORE_FILE'])
storePassword props['RELEASE_STORE_PASSWORD']
keyAlias props['RELEASE_KEY_ALIAS']
keyPassword props['RELEASE_KEY_PASSWORD']
}
}
}
useLibrary 'org.apache.http.legacy'
buildTypes {
release {
ext.alwaysUpdateBuildId = true
zipAlignEnabled false
debuggable false
jniDebuggable false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
externalNativeBuild {
ndkBuild {
arguments 'NDK_DEBUG=0'
}
}
}
debug {
ext.alwaysUpdateBuildId = false // prevent fabric.io to generate id
debuggable true
jniDebuggable true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
externalNativeBuild {
ndkBuild {
arguments 'NDK_DEBUG=1'
}
}
}
}
/*
// This is required for the gradle automation.
// Source https://medium.com/mindorks/how-did-i-automate-the-generation-of-release-apk-3e42b6540a4a
TLDR;
Also notice that I have added lintOptions which ignores errors at build time. This is needed for our automate script to work.
If lintOptions are not disabled, it gives the error belov
▸ org.xmlpull.v1.XmlPullParserException: expected: /meta read: HEAD (position:END_TAG </HEAD>#2:32 in java.io.InputStreamReader#4b80c948)
*/
lintOptions {
checkReleaseBuilds false
abortOnError false
}
}
repositories {
google()
jcenter()
mavenCentral()
flatDir {
dirs 'libs'
}
maven { url 'https://maven.google.com' }
maven { url 'https://maven.fabric.io/public' }
maven { url 'http://repo.admost.com:8081/artifactory/admost' }
//maven { url 'http://repo.admost.com:8081/artifactory/test-before-publish' }
maven { url 'https://raw.githubusercontent.com/HyprMXMobile/Android-SDKs/master' }
maven { url 'https://vungle.bintray.com/vungle-android-beta' }
maven { url "https://s3.amazonaws.com/moat-sdk-builds" }
maven { url "http://dl.appnext.com/" }
maven { url 'https://jitpack.io' }
maven { url 'https://dl.bintray.com/pubnative/maven' }
}
crashlytics {
enableNdk true
}
rootProject.allprojects.each(){
it.repositories {
flatDir dirs: (projectDir.absolutePath+'/libs')
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':libcocos2dx')
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.core:core:1.2.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.browser:browser:1.2.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
implementation 'androidx.percentlayout:percentlayout:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.gms:play-services-plus:17.0.0'
implementation 'com.google.android.gms:play-services-games:17.0.0'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
implementation 'com.google.android.gms:play-services-basement:17.1.1'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'com.google.firebase:firebase-analytics:17.2.3'
implementation 'com.google.firebase:firebase-messaging:20.1.0'
//'com.onesignal:OneSignal:[3.11.2, 3.99.99]'
implementation 'com.google.firebase:firebase-ads:19.0.0'
implementation 'com.google.firebase:firebase-config:19.1.1'
implementation 'com.adjust.sdk:adjust-android:4.16.0'
//noinspection GradleDynamicVersion
implementation 'com.facebook.android:facebook-android-sdk:5.+'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.onesignal:OneSignal:3.11.1'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation 'com.crashlytics.sdk.android:crashlytics-ndk:2.1.1'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.google.android.exoplayer:exoplayer:2.8.3'
implementation 'com.android.volley:volley:1.1.0'
implementation 'io.branch.sdk.android:library:2.19.5'
// AMR
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.admost.sdk:amr:2.0.7'
implementation 'com.admost.sdk:admost:0.0.6.a16'
implementation 'com.google.android.gms:play-services-base:17.1.0'
implementation 'com.google.android.gms:play-services-ads:17.2.1'
implementation 'com.admost.sdk:admob-gt-17.2.0-adapter:1.0.2.a16'
implementation 'com.admost.sdk:adcolony:4.1.2.a16'
implementation 'com.admost.sdk:chartboost:7.5.0.a16'
implementation 'com.admost.sdk:facebook:5.6.1.a16'
implementation 'com.admost.sdk:hyprmx-adapter:5.0.1.a16'
implementation 'com.hyprmx.android:HyprMX-SDK:5.0.1'
implementation 'com.admost.sdk:ironsource:6.13.0.1.a16'
implementation 'com.admost.sdk:mintegral:10.2.1.a16'
implementation 'com.admost.sdk:ogury:4.3.7.a16'
implementation 'net.pubnative:hybid.sdk:0.7.1'
implementation 'com.admost.sdk:pubnative-adapter:0.7.1.a16'
implementation 'com.admost.sdk:qumpara:0.3.3.a16'
implementation 'com.admost.sdk:tapjoy:12.4.2.a16'
implementation 'com.admost.sdk:unity:3.4.0.a16'
implementation 'com.vungle:publisher-sdk-android:6.5.1'
implementation 'com.admost.sdk:vungle-adapter:6.5.1.a16'
implementation name: 'mcprime', ext: 'aar'
implementation name: 'mcgoliath', ext: 'aar'
implementation (name:'ADTUnityAdsAdapter3.0.1',ext:'aar')
}
apply plugin: 'com.google.gms.google-services'
Gradle Wrapper Properties File:
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
Do you have any idea to solve this issue? Please help me. Thank you for your time.
My teammate Erman solve this issue. I want to share with you the solution. I am going to share the gradle files that can be successfully build app. You should analyze differences between old and new ones.
main gradle
buildscript {
repositories {
google()
mavenLocal()
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.google.gms:google-services:4.3.3'
classpath 'io.fabric.tools:gradle:1.31.2'
}
}
**app module gradle**
/** GENERATE CMAKEFILES.TXT FOR GAME CLASSES **/
file("../../Classes/cmake/CMakeLists.txt").withWriter("utf-8") { writer ->
writer.writeLine("\n# APP NAME AUTOGENERATED CMAKELISTS FILE, DO NOT DELETE #\n")
writer.writeLine("set(GAME_SOURCE")
project.fileTree("../../Classes").matching {
include "**/**.cpp"
include "**/**.c"
}.sort().forEach { file ->
writer.writeLine("\t${file.path}")
}
writer.writeLine(")\n\n")
writer.write("set(GAME_HEADER\n")
project.fileTree("../../Classes").matching {
include "**/**.hpp"
include "**/**.h"
}.sort().forEach { file ->
writer.writeLine("\t${file.path}")
}
writer.writeLine(")\n\n")
}
/*********************************************/
allprojects {
repositories {
google()
mavenLocal()
jcenter()
}
}
buildscript {
repositories {
google()
mavenLocal()
jcenter()
maven { url 'https://plugins.gradle.org/m2/'}//onesignal
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.google.gms:google-services:4.3.3'
//noinspection GradleDynamicVersion
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.4, 0.99.99]'
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 29
defaultConfig {
applicationId "com.company.appName"
minSdkVersion 16
targetSdkVersion 29
versionCode 111908
versionName "1.119"
multiDexEnabled true
manifestPlaceholders = [onesignal_app_id : "*************************",
onesignal_google_project_number: "REMOTE"]
ndk {
abiFilters "armeabi-v7a", "arm64-v8a"
}
externalNativeBuild {
if(PROP_BUILD_TYPE == 'ndk-build') {
ndkBuild {
targets 'appName'
def module_paths = [project.file("../../cocos2d").absolutePath,
project.file("../../cocos2d/cocos").absolutePath,
project.file("../../cocos2d/external").absolutePath]
arguments 'NDK_TOOLCHAIN_VERSION=clang'
arguments 'APP_PLATFORM=android-' + PROP_TARGET_SDK_VERSION
arguments '-j' + Runtime.runtime.availableProcessors()
if (OperatingSystem.current().isWindows()) {
module_paths = module_paths.collect {it.replaceAll('\\\\', '/')}
arguments 'NDK_MODULE_PATH=' + module_paths.join(";")
} else {
arguments 'NDK_MODULE_PATH=' + module_paths.join(':')
}
}
} else if(PROP_BUILD_TYPE == 'cmake') {
cmake {
targets 'appName'
arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE"
cppFlags "-frtti -fexceptions -fsigned-char"
}
}
}
}
dexOptions {
javaMaxHeapSize "4g"
}
packagingOptions {
exclude 'META-INF/rxjava.properties'
}
sourceSets.main {
java.srcDir "src"
res.srcDir "res"
jniLibs.srcDirs = ['jniLibs']
jni.srcDirs = []
manifest.srcFile "AndroidManifest.xml"
assets.srcDir "../../Resources"
}
externalNativeBuild {
if(PROP_BUILD_TYPE == 'ndk-build') {
ndkBuild {
path "jni/Android.mk"
}
} else if (PROP_BUILD_TYPE == 'cmake') {
cmake {
path "../../CMakeLists.txt"
}
}
}
signingConfigs {
release {
def userHomePath = System.properties['user.home']
def propertyFile = new File(userHomePath, ".gradle/gradle.properties") // Can be signing.properties as well
if (propertyFile.canRead()){
Properties props = new Properties()
props.load(new FileInputStream(propertyFile))
// Loading credentials from props
storeFile file(props['RELEASE_STORE_FILE'])
storePassword props['RELEASE_STORE_PASSWORD']
keyAlias props['RELEASE_KEY_ALIAS']
keyPassword props['RELEASE_KEY_PASSWORD']
}
}
}
useLibrary 'org.apache.http.legacy'
buildTypes {
release {
ext.alwaysUpdateBuildId = true
zipAlignEnabled false
debuggable false
jniDebuggable false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
externalNativeBuild {
ndkBuild {
arguments 'NDK_DEBUG=0'
}
}
}
debug {
ext.alwaysUpdateBuildId = false // prevent fabric.io to generate id
debuggable true
jniDebuggable true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
externalNativeBuild {
ndkBuild {
arguments 'NDK_DEBUG=1'
}
}
}
}
/*
// This is required for the gradle automation.
// Source https://medium.com/mindorks/how-did-i-automate-the-generation-of-release-apk-3e42b6540a4a
TLDR;
Also notice that I have added lintOptions which ignores errors at build time. This is needed for our automate script to work.
If lintOptions are not disabled, it gives the error belov
▸ org.xmlpull.v1.XmlPullParserException: expected: /meta read: HEAD (position:END_TAG </HEAD>#2:32 in java.io.InputStreamReader#4b80c948)
*/
lintOptions {
checkReleaseBuilds false
abortOnError false
}
}
repositories {
google()
mavenLocal()
jcenter()
flatDir {
dirs 'libs'
}
maven { url 'https://maven.fabric.io/public' }
maven { url 'http://repo.admost.com:8081/artifactory/admost' }
//maven { url 'http://repo.admost.com:8081/artifactory/test-before-publish' }
//maven { url 'https://raw.githubusercontent.com/HyprMXMobile/Android-SDKs/master' }
maven { url 'https://vungle.bintray.com/vungle-android-beta' }
//maven { url "https://s3.amazonaws.com/moat-sdk-builds" }
maven { url "http://dl.appnext.com/" }
maven { url 'https://jitpack.io' }
maven { url 'https://dl.bintray.com/pubnative/maven' }
}
crashlytics {
enableNdk true
}
rootProject.allprojects.each(){
it.repositories {
flatDir dirs: (projectDir.absolutePath+'/libs')
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':libcocos2dx')
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.core:core:1.2.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.browser:browser:1.2.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
implementation 'androidx.percentlayout:percentlayout:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.gms:play-services-plus:17.0.0'
implementation 'com.google.android.gms:play-services-games:19.0.0'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
implementation 'com.google.android.gms:play-services-basement:17.1.1'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'com.google.android.gms:play-services-base:17.1.0'
implementation 'com.google.android.gms:play-services-ads:19.0.0'
implementation 'com.google.android.gms:play-services-ads-identifier:17.0.0'
implementation 'com.google.firebase:firebase-analytics:17.2.3'
implementation 'com.google.firebase:firebase-messaging:20.1.3'
//'com.onesignal:OneSignal:[3.11.2, 3.99.99]'
implementation 'com.google.firebase:firebase-ads:19.0.0'
implementation 'com.google.firebase:firebase-config:19.1.3'
implementation 'com.adjust.sdk:adjust-android:4.16.0'
//noinspection GradleDynamicVersion
implementation 'com.facebook.android:facebook-android-sdk:5.+'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.onesignal:OneSignal:[3.11.2, 3.99.99]'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation 'com.crashlytics.sdk.android:crashlytics-ndk:2.1.1'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.google.android.exoplayer:exoplayer:2.8.3'
implementation 'com.android.volley:volley:1.1.0'
implementation 'io.branch.sdk.android:library:2.19.5'
// AMR
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.admost.sdk:amr:2.0.7'
implementation 'com.admost.sdk:admost:0.0.6.a16'
implementation 'com.admost.sdk:admob-gt-17.2.0-adapter:1.0.2.a16'
implementation 'com.admost.sdk:adcolony:4.1.2.a16'
implementation 'com.admost.sdk:chartboost:7.5.0.a16'
implementation 'com.admost.sdk:facebook:5.6.1.a16'
//implementation 'com.admost.sdk:hyprmx-adapter:5.0.1.a16'
//implementation 'com.hyprmx.android:HyprMX-SDK:5.0.1'
implementation 'com.admost.sdk:ironsource:6.13.0.1.a16'
implementation 'com.admost.sdk:mintegral:10.2.1.a16'
implementation 'com.admost.sdk:ogury:4.3.7.a16'
implementation 'net.pubnative:hybid.sdk:0.7.1'
implementation 'com.admost.sdk:pubnative-adapter:0.7.1.a16'
implementation 'com.admost.sdk:qumpara:0.3.3.a16'
implementation 'com.admost.sdk:tapjoy:12.4.2.a16'
implementation 'com.admost.sdk:unity:3.4.0.a16'
implementation 'com.vungle:publisher-sdk-android:6.5.1'
implementation 'com.admost.sdk:vungle-adapter:6.5.1.a16'
implementation name: 'mcprime', ext: 'aar'
implementation name: 'mcgoliath', ext: 'aar'
implementation (name:'ADTUnityAdsAdapter3.0.1',ext:'aar')
}
apply plugin: 'com.google.gms.google-services'

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

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:+')
}
}

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'

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')
}

Could not find method compile() for arguments [project ':react-native-sqlite']

react-native-cli: 2.0.1
react-native: 0.42.0
npm :3.5.2
I install sqlite on react native using this tutorial:
https://github.com/remobile/react-native-sqlite
when I'm done I executed this command :
react-native run-android
I have this error :
Cannot parse yarn version: 0.22
Scanning 547 folders for symlinks in /home/sofiane/projet/sql/node_modules (6ms)
Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug)...
FAILURE: Build failed with an exception.
* Where:
Build file '/home/sofiane/projet/sql/android/build.gradle' line: 9
* What went wrong:
A problem occurred evaluating root project 'sql'.
> Could not find method compile() for arguments [project ':react-native-sqlite'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
build.gradle :
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
compile project(':react-native-sqlite')
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
}
}
You should configure <name-project>/android/app/build.gradle' not <name-project>/android/build.gradle'.
In my case the structure of the gradle file was the problem, i accidetally duplicated the dependencias on allprojects session
from :
// 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.5.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
}
dependencies { //=> duplicated
classpath 'com.android.tools.build:gradle:3.5.2'
classpath "io.realm:realm-gradle-plugin:6.0.1"
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
to
buildscript {
ext.objectboxVersion = '2.1.0'
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
classpath "io.realm:realm-gradle-plugin:6.0.1"
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Hope this helps someone.

Resources