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

Could not get unknown property 'ANDROID_SUPPORT_V4_VERSION' #980

Closed
MarcBalaban opened this issue Sep 2, 2018 · 12 comments
Closed

Could not get unknown property 'ANDROID_SUPPORT_V4_VERSION' #980

MarcBalaban opened this issue Sep 2, 2018 · 12 comments

Comments

@MarcBalaban
Copy link

Spec:

config.xml:

<preference name="phonegap-version" value="cli-6.5.0" />
<plugin name="cordova-plugin-x-socialsharing" spec="https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin" />

Problem:

Build is working on Windows and IOS without issues, but Android Phonegap build is erroring out.

--------------------------------------------------------------------------------
COMPILE OUTPUT
--------------------------------------------------------------------------------
Subproject Path: CordovaLib
Running command: /project/gradlew cdvBuildDebug -b /project/build.gradle -Dorg.gradle.daemon=true -Dorg.gradle.jvmargs=-Xmx2048m -Pandroid.useDeprecatedNdk=true
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
	at build_atdiclqi7wajlsrpuc5lrvjq1.run(/project/build.gradle:139)

FAILURE: Build failed with an exception.

* Where:
Build file '/project/build.gradle' line: 255

* What went wrong:
A problem occurred evaluating root project 'project'.
> Could not get unknown property 'ANDROID_SUPPORT_V4_VERSION' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Solution:

Within your config.xml -- use:

<gap:plugin name="cordova-plugin-x-socialsharing" source="npm" />

instead of:

<plugin name="cordova-plugin-x-socialsharing" spec="https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin" />
@knyazz
Copy link

knyazz commented Nov 21, 2018

in ionic project
Spec:

config.xml:

  <feature name="SocialSharing">
    <param name="android-package" value="cordova-plugin-x-socialsharing.SocialSharing" />
    <param name="ios-package" value="SocialSharing" />
  </feature>

or

  <feature name="SocialSharing">
    <param name="android-package" value="nl.xservices.plugins.SocialSharing" />
    <param name="ios-package" value="SocialSharing" />
  </feature>

get the same error:

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/smirnovev/ionictest/platforms/android/build.gradle' line: 254

* What went wrong:
A problem occurred evaluating root project 'android'.
> Could not get unknown property 'ANDROID_SUPPORT_V4_VERSION' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

any solution?

@thesayyn
Copy link

same here +1

@knyazz
Copy link

knyazz commented Nov 23, 2018

same here +1

you may install v5.4.0. it helps for me. This error is on v.5.4.3

@thesayyn
Copy link

same here +1

you may install v5.4.0. it helps for me. This error is on v.5.4.3

may I see your config.xml file?

@knyazz
Copy link

knyazz commented Nov 23, 2018

same here +1

you may install v5.4.0. it helps for me. This error is on v.5.4.3

may I see your config.xml file?

part of it is above with SocialSharing values

@UnknownDino
Copy link

same here +1

you may install v5.4.0. it helps for me. This error is on v.5.4.3

Hi, sorry to bother you with a dumb question, i want to install v5.4.0 but i have no idea how to do it. At the moment i just write what's in the pic below. PLEASE, can you tell me how to choose the mentioned version?
xml socialsharing plugin

@ghost
Copy link

ghost commented Dec 3, 2018

same here +1

you may install v5.4.0. it helps for me. This error is on v.5.4.3

Hi, sorry to bother you with a dumb question, i want to install v5.4.0 but i have no idea how to do it. At the moment i just write what's in the pic below. PLEASE, can you tell me how to choose the mentioned version?
xml socialsharing plugin

cordova plugin remove [PLUGIN_ID]
cordova plugin add [PLUGIN_ID]@[VERSION]

@MarcBalaban
Copy link
Author

@UnknownDino @fecogc
you can specify:
<gap:plugin name="cordova-plugin-x-socialsharing" source="npm" spec="5.4.0" />

@gabrielsodre91
Copy link

same here +1

you may install v5.4.0. it helps for me. This error is on v.5.4.3

Works for me! Thanks!!!

@codotronix
Copy link

codotronix commented Jul 7, 2019

Was getting the same issue while building a cordova app with visual studio. Removed the "gap:" from the beginning and added the following line in config.xml
<plugin name="cordova-plugin-x-socialsharing" spec="5.4.0" src="npm" />

And it worked like a charm. Thanks a lot @MarcBalaban and @knyazz 👍

@klemensz
Copy link

klemensz commented Feb 13, 2020

The current version of the plugin is 5.6.3. So you are saying that the fix for the issue is downgrading to version 5.4.0?

5.4.0 is the last version that has the version hardcoded:

<framework src="com.android.support:support-v4:24.1.1+" />

so it means that any version after that won't work? (see diff: 5.4.0...5.4.4)

@MarcBalaban
Copy link
Author

downgrading worked for me last year, but have not checked releases for a while, so perhaps has been fixed?

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

7 participants