Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-native-google-places:compileDebugJavaWithJavac FAILED #188

Closed
kabirma opened this issue Dec 20, 2018 · 2 comments
Closed

react-native-google-places:compileDebugJavaWithJavac FAILED #188

kabirma opened this issue Dec 20, 2018 · 2 comments

Comments

@kabirma
Copy link

kabirma commented Dec 20, 2018

I have been trying to run a file that contain react-native-maps and react-native-google-places and getting the following error;

Task :react-native-google-places:compileDebugJavaWithJavac FAILED
C:\react-native\TaxiApp\node_modules\react-native-google-places\android\src\main\java\com\arttitude360\reactnative\rngoogleplaces\RNGooglePlacesModule.java:49: error: RNGooglePlacesModule is not abstract and does not override abstract method onActivityResult(int,int,Intent) in ActivityEventListener
public class RNGooglePlacesModule extends ReactContextBaseJavaModule implements ActivityEventListener,
^
C:\react-native\TaxiApp\node_modules\react-native-google-places\android\src\main\java\com\arttitude360\reactnative\rngoogleplaces\RNGooglePlacesModule.java:88: error: method does not override or implement a method from a supertype
@OverRide
^
C:\react-native\TaxiApp\node_modules\react-native-google-places\android\src\main\java\com\arttitude360\reactnative\rngoogleplaces\RNGooglePlacesModule.java:321: error: cannot find symbol
List placeIDsObjects = placeIDs.toArrayList();
^
symbol: method toArrayList()
location: variable placeIDs of type ReadableArray
C:\react-native\TaxiApp\node_modules\react-native-google-places\android\src\main\java\com\arttitude360\reactnative\rngoogleplaces\RNGooglePlacesModule.java:528: error: method does not override or implement a method from a supertype
@OverRide
^
4 errors

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':react-native-google-places:compileDebugJavaWithJavac'.

Compilation failed; see the compiler error output for details.

  • 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

my build gradle file in android/app

apply plugin: "com.android.application"

import com.android.build.OutputFile

/**

  • The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
  • and bundleReleaseJsAndAssets).
  • These basically call react-native bundle with the correct arguments during the Android build
  • cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
  • bundle directly from the development server. Below you can see all the possible configurations
  • and their defaults. If you decide to add a configuration block, make sure to add it before the
  • apply from: "../../node_modules/react-native/react.gradle" line.
  • project.ext.react = [
  • // the name of the generated asset file containing your JS bundle
  • bundleAssetName: "index.android.bundle",
  • // the entry file for bundle generation
  • entryFile: "index.android.js",
  • // whether to bundle JS and assets in debug mode
  • bundleInDebug: false,
  • // whether to bundle JS and assets in release mode
  • bundleInRelease: true,
  • // whether to bundle JS and assets in another build variant (if configured).
  • // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
  • // The configuration property can be in the following formats
  • // 'bundleIn${productFlavor}${buildType}'
  • // 'bundleIn${buildType}'
  • // bundleInFreeDebug: true,
  • // bundleInPaidRelease: true,
  • // bundleInBeta: true,
  • // the root of your project, i.e. where "package.json" lives
  • root: "../../",
  • // where to put the JS bundle asset in debug mode
  • jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
  • // where to put the JS bundle asset in release mode
  • jsBundleDirRelease: "$buildDir/intermediates/assets/release",
  • // where to put drawable resources / React Native assets, e.g. the ones you use via
  • // require('./image.png')), in debug mode
  • resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
  • // where to put drawable resources / React Native assets, e.g. the ones you use via
  • // require('./image.png')), in release mode
  • resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
  • // by default the gradle tasks are skipped if none of the JS files or assets change; this means
  • // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
  • // date; if you have any other folders that you want to ignore for performance reasons (gradle
  • // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
  • // for example, you might want to remove it from here.
  • inputExcludes: ["android/", "ios/"],
  • // override which node gets called and with what additional arguments
  • nodeExecutableAndArgs: ["node"],
  • // supply additional arguments to the packager
  • extraPackagerArgs: []
  • ]
    */

apply from: "../../node_modules/react-native/react.gradle"

/**

  • Set this to true to create two separate APKs instead of one:
    • An APK that only works on ARM devices
    • An APK that only works on x86 devices
  • The advantage is the size of the APK is reduced by about 4MB.
  • Upload all the APKs to the Play Store and people will download
  • the correct one based on the CPU architecture of their device.
    */
    def enableSeparateBuildPerCPUArchitecture = false

/**

  • Run Proguard to shrink the Java bytecode in release builds.
    */
    def enableProguardInReleaseBuilds = false

android {
compileSdkVersion 26
buildToolsVersion "26.0.1"

defaultConfig {
    applicationId "com.taxiapp"
    minSdkVersion 16
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
    ndk {
        abiFilters "armeabi-v7a", "x86"
    }
}
splits {
    abi {
        reset()
        enable enableSeparateBuildPerCPUArchitecture
        universalApk false  // If true, also generate a universal APK
        include "armeabi-v7a", "x86"
    }
}
buildTypes {
    release {
        minifyEnabled enableProguardInReleaseBuilds
        proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
    }
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
    variant.outputs.each { output ->
        // For each separate APK per architecture, set a unique version code as described here:
        // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
        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 {
compile project(':react-native-spinkit')
compile project(':react-native-google-places')
compile project(':react-native-vector-icons')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
compile project(':react-native-maps')
compile ('com.google.android.gms:play-services-base:10.2.4') {
force = true;
}
compile ('com.google.android.gms:play-services-maps:10.2.4') {
force = true;
}
compile ('com.google.android.gms:play-services-places:10.2.4') {
force = true;
}
compile ('com.google.android.gms:play-services-location:10.2.4') {
force = true;
}
}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}

build gradle in android
// 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.1.0'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

allprojects {
repositories {
// Add jitpack repository (added by react-native-spinkit)
maven { url "https://jitpack.io" }
mavenLocal()
jcenter()
google()
maven {
url 'https://maven.google.com'
}

}

}
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "26.1.0"
}
}
}
}

and package,json file

{
"name": "TaxiApp",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"native-base": "^2.8.2",
"react": "16.6.1",
"react-native": "0.56.0",
"react-native-google-places": "^2.1.0",
"react-native-maps": "0.15.0",
"react-native-router-flux": "^4.0.6",
"react-native-spinkit": "^1.0.3",
"react-native-star-rating": "^1.1.0",
"react-native-vector-icons": "^4.1.1",
"react-redux": "^6.0.0",
"redux": "^4.0.1",
"redux-socket.io": "^1.4.0",
"redux-thunk": "^2.3.0",
"socket.io": "^2.2.0",
"socket.io-client": "^2.2.0",
"superagent": "^4.0.0"
},
"devDependencies": {
"babel-jest": "20.0.1",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react-native": "1.9.2",
"jest": "20.0.1",
"react-test-renderer": "16.6.1",
"redux-logger": "^3.0.1"
},
"jest": {
"preset": "react-native"
}
}

@vinhtq
Copy link

vinhtq commented Jan 29, 2019

I had the same issue. This is duplicate with #184

@tolu360
Copy link
Owner

tolu360 commented Mar 11, 2019

Please get on the latest version to support changes from Google, please see #198 to get started. Issues from Play Services are gone from the new SDK.

@tolu360 tolu360 closed this as completed Mar 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants