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

Problem building nativescript-google-maps-sdk on Android #1081

Closed
erjdriver opened this issue Jun 10, 2018 · 16 comments
Closed

Problem building nativescript-google-maps-sdk on Android #1081

erjdriver opened this issue Jun 10, 2018 · 16 comments
Milestone

Comments

@erjdriver
Copy link

erjdriver commented Jun 10, 2018

Using NS 4.1, tns-core 4.1 and tns-android 4.1.

Getting the following error during build on Android

`Unable to apply changes on device: emulator-5554. Error is: Failed to build plugin nativescript-google-maps-sdk :
Error: Command ./gradlew failed with exit code 1 Error output:

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not resolve all files for configuration ':releaseCompileClasspath'.

Could not find common.jar (android.arch.core:common:1.0.0).
Searched in the following locations:
https://jcenter.bintray.com/android/arch/core/common/1.0.0/common-1.0.0.jar

  • 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`

The problem seems to be it's looking for common-1.0.0.jar and it's not on that jcenter site.

This happens on android@4.1.0 - the build works on android@4.0.1

More detailed info on the plug-in page.

Issue on the plug-in site

@jibon57
Copy link

jibon57 commented Jun 11, 2018

Same problem for me. It's happening when NativeScript is generating .aar from plugins under platforms/tempPlugin/nativescript_PLUGIN. I tried to change build.gradle file's repositories like this:

repositories {
         google()
        jcenter()
}

&

allprojects {
    repositories {
        google()
        jcenter()
        mavenLocal()
        mavenCentral()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
}

But that file got override each time & show error as above. I tried to prevent overriding & that time it worked. But need a good solution.

@jibon57
Copy link

jibon57 commented Jun 11, 2018

@erjdriver got a working solution. You can try this:
Open default build.gradle of nativescript from this location:
for PC: C:\Users\USERNAME\AppData\Roaming\npm\node_modules\nativescript\vendor\gradle-plugin
For Mac: /usr/local/lib/node_modules/nativescript/vendor/gradle-plugin
change USERNAME to your username of PC. Now open the file build.gradle & change 2 parts as bellow:

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'

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

allprojects {
    repositories {
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
	jcenter()
        mavenLocal()
        mavenCentral()
    }
}

Now delete platforms directory & try to rebuild the app. It should work.

ref: https://stackoverflow.com/questions/50584437/android-studio-3-1-2-failed-to-resolve-runtime

@isaacfi
Copy link

isaacfi commented Jun 11, 2018

@jibon57 your solution works very well.

@erjdriver
Copy link
Author

This fixed the problem.

Thank you.

@vhristov5555 vhristov5555 added this to the 4.1.3 milestone Jun 14, 2018
@sserdyuk
Copy link

So I got it to build but only after I manually changed global installed nativescript's vendor/gradle-plugin/build.gradle file and put "google()" on the top in the repositories list. If I do npm remove -g nativescript && npm install -g nativescript and clear out the node_modules directory, it fails to build again.

I think it's a bit too soon to close the issue.

@sserdyuk
Copy link

Here are my steps to reproduce:

``
$ tns create zzz --tsc
$ cd zzz
$ tns info
✔ Getting NativeScript components versions information...
✔ Component nativescript has 4.1.0 version and is up to date.
✔ Component tns-core-modules has 4.1.0 version and is up to date.
✔ Component tns-android has 4.1.3 version and is up to date.
✖ Component tns-ios is not installed.

$ tns plugin add nativescript-google-maps-sdk
$ tns build android

Failed to build plugin nativescript-google-maps-sdk :
Error: Command ./gradlew failed with exit code 1 Error output:

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not resolve all files for configuration ':releaseCompileClasspath'.

Could not find runtime.jar (android.arch.lifecycle:runtime:1.0.0).
Searched in the following locations:
https://jcenter.bintray.com/android/arch/lifecycle/runtime/1.0.0/runtime-1.0.0.jar
Could not find common.jar (android.arch.core:common:1.0.0).
Searched in the following locations:
https://jcenter.bintray.com/android/arch/core/common/1.0.0/common-1.0.0.jar

  • 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 0s
``

@jnorkus
Copy link

jnorkus commented Jun 21, 2018

Looks like in the latest version of build.gradle they moved one jcenter() but forgot to move the other one.

Faulty version:

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'

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

allprojects {
    repositories {
        jcenter()
        mavenLocal()
        mavenCentral()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }        
    }
}

Working version:

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'

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

allprojects {
    repositories {
        mavenLocal()
        mavenCentral()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
        jcenter()
    }
}

@sitefinitysteve
Copy link

😥

@bradseefeld
Copy link

How is this marked as fixed? The only (working) work around involves modifying the nativescript library manually. This is not a practical or scalable solution.

@sitefinitysteve
Copy link

Guessing just not reopened, hang on

@bradseefeld
Copy link

@erjdriver, please re-open this. It needs to be fixed in the library.

@bradseefeld
Copy link

@sitefinitysteve, are you able to re-open this, or should I open a separate issue? I am finding this issue when trying to install other plugins as well and it is making the experience quite broken.

@odedBartov
Copy link

Any fix for this??? I am facing the same problem and nothing helped!

@triniwiz
Copy link
Member

triniwiz commented Dec 6, 2021

@odedBartov please open a new issue with the error you have received

@odedBartov
Copy link

@odedBartov please open a new issue with the error you have received

Just did:
dapriett/nativescript-google-maps-sdk#486

@kefahB
Copy link

kefahB commented Jan 9, 2022

Hi,

I've updating this plugin because it not so often maintained and I've updating the new renderer as well you can try it from here : github.com/kefahB/nativescript-google-maps

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