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

Plugin won't compile using nativescript 4 #40

Open
dammynex opened this issue Apr 30, 2018 · 14 comments
Open

Plugin won't compile using nativescript 4 #40

dammynex opened this issue Apr 30, 2018 · 14 comments

Comments

@dammynex
Copy link

I recently updated to nativescript 4.0.
And the plugin stopped working, I even created a new project and installed the plugin and still won't compile

"Failed to build plugin nativescript-social-share : Error: Command failed: ./gradlew -p /home/brainex/Projects/mp3faka/platforms/tempPlugin/nativescript_social_share assembleRelease -PcompileSdk=android-25 -PbuildToolsVersion=26.0.2 -PsupportVersion=25.3.1"

@sitefinitysteve
Copy link
Owner

Last PR apparently added support

Your error says "Failed to build plugin nativescript-social-share"?

@dammynex
Copy link
Author

Sorry about this, I copied the wrong error message.
That plugin doesn't work too.

Failed to build plugin nativescript-google-analytics : Error: Command failed: ./gradlew -p /home/brainex/Projects/mp3faka/platforms/tempPlugin/nativescript_google_analytics assembleRelease -PcompileSdk=android-25-PbuildToolsVersion=26.0.2 -PsupportVersion=25.3.1

@msobocin
Copy link

msobocin commented May 3, 2018

@dammynex try to update library, in my case work

npm update nativescript-google-analytics

@dammynex
Copy link
Author

dammynex commented May 3, 2018

Okay, thanks. I'll try that

@sitefinitysteve
Copy link
Owner

I updated to 4, and made some changes, both demo apps now work fine with no real changes (superficial at best) to the plugin code itself...

https://www.screencast.com/t/sMcEEG8D

I'll re-publish, but can you dump me the FULL terminal error message?

@sitefinitysteve
Copy link
Owner

Up on npm now

@Emmandez
Copy link

Hi! How did you solve the problem? I think I have the same problem.

Unable to apply changes on device: ZY222W2F3Q. Error is: Failed to build plugin nativescript-google-analytics :
Error: Command failed: gradlew.bat -p <MyPath>\platforms\tempPlugin\nativescript_google_analytics assembleRelease -PcompileSdk=android-27 -PbuildToolsVersion=27.0.3 -PsupportVersion=26.0.0-alpha1

And then

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all files for configuration ':releaseCompileClasspath'.
> Could not find support-v4.aar (com.android.support:support-v4:26.1.0).
  Searched in the following locations:
      https://jcenter.bintray.com/com/android/support/support-v4/26.1.0/support-v4-26.1.0.aar

@mixaster
Copy link

The jcenter url returns a 404. Is there an update or known workaround?

@sitefinitysteve
Copy link
Owner

@mixaster
Copy link

mixaster commented Jun 20, 2018

Unfortunately, no. Even with google listed first, for the support-v4 AAR, it tries to get it from JCenter:

image

Failed to build plugin nativescript-google-analytics :
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 support-v4.aar (com.android.support:support-v4:26.1.0).
  Searched in the following locations:
      https://jcenter.bintray.com/com/android/support/support-v4/26.1.0/support-v4-26.1.0.aar

@sitefinitysteve
Copy link
Owner

Can you try with the latest plugin push to npm... whatever is going on here I don't think is specific to this plugin, but eddy made a massive PR, and demo works fine

@mixaster
Copy link

mixaster commented Jun 27, 2018

Upgrading everything to the latest doesn't fix it. I did look into the platforms/tempPlugin/nativescript_google_analytics folder after a build attempt, and the build.gradle file there has the jcenter() repository listed first:


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

apply plugin: 'com.android.library'

def computeCompileSdkVersion = { -> project.hasProperty("compileSdk") ? compileSdk : 24 }
def computeBuildToolsVersion = { ->
    project.hasProperty("buildToolsVersion") ? buildToolsVersion : "27.0.3"
}

android {
    compileSdkVersion computeCompileSdkVersion()
    buildToolsVersion computeBuildToolsVersion()

    defaultConfig {
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
    }
}

dependencies {
    def supportVer = "27.0.1"
    if (project.hasProperty("supportVersion")) {
        supportVer = supportVersion
    }
    compileOnly "com.android.support:support-v4:$supportVer"
    compileOnly "com.android.support:appcompat-v7:$supportVer"
}

dependencies {
    // [START gms_compile]
    def googlePlayServicesVersion = project.hasProperty('googlePlayServicesVersion') ? project.googlePlayServicesVersion : '+'
	compile "com.google.android.gms:play-services-analytics:$googlePlayServicesVersion"
    // [END gms_compile]
}

...at least in the allprojects section. It seems like it's not checking anything but jcenter.

@sitefinitysteve
Copy link
Owner

sitefinitysteve commented Jun 27, 2018 via email

@mixaster
Copy link

Looks like this is still an open issue with the android runtime: NativeScript/android#1081

This issue can be closed, but hope it helps someone else.

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

5 participants