EddyVerbruggen / SocialSharing-PhoneGap-Plugin

πŸ‘¨β€β€οΈβ€πŸ’‹β€πŸ‘¨ Cordova plugin to share text, a file (image/PDF/..), or a URL (or all three) via the native sharing widget
MIT License
1.78k stars 908 forks source link

phonegap build issue #832

Open SiddiquiImran opened 7 years ago

SiddiquiImran commented 7 years ago

Used xml file: <?xml version="1.0" encoding="UTF-8" ?> <widget xmlns = "http://www.w3.org/ns/widgets" xmlns:gap = "http://phonegap.com/ns/1.0" id = "com.test.tyt" versionCode = "1" version = "1.0" >

Test app
<description>Test app Initial Build</description>
<author href="http://testcom/" email="support@test.com">
  test app
</author>
<preference name="phonegap-version" value="cli-6.3.0" />
<preference name="orientation" value="portrait" />
<preference name="fullscreen" value="true" />
<preference name="AndroidPersistentFileLocation" value="Compatibility" />
<preference name="android-build-tool" value="gradle" />
<preference name="SplashScreenDelay" value="3000" />
<feature name="http://api.phonegap.com/1.0/file" />
<!-- <feature name="NetworkStatus">
    <param name="android-package" value="org.apache.cordova.networkinformation.NetworkManager" />
</feature> -->
<!-- <feature name="Notification"> -->
    <!-- <param name="android-package" value="org.apache.cordova.dialogs.Notification" /> -->
<!-- </feature> -->
<!-- <feature name="PushPlugin"> -->
  <!-- <param name="android-package" value="com.plugin.gcm.PushPlugin" /> -->
<!-- </feature>           -->
 <plugin name="cordova-plugin-device" source="npm" spec="1.1.4" />
<plugin name="cordova-plugin-geolocation" source="npm" spec="2.4.1" />
<plugin name="cordova-plugin-inappbrowser" source="npm" spec="1.6.1"  />
<plugin name="cordova-plugin-globalization" source="npm"  spec="1.0.5" />
<plugin name="cordova-plugin-network-information" source="npm"  spec="1.3.1" />
<plugin name="cordova-plugin-splashscreen" source="npm"  spec="4.0.1" />
<plugin name="cordova-plugin-media" source="npm" spec="2.4.1"  />
<plugin name="cordova-plugin-dialogs" source="npm" spec="1.3.1"  />
<!-- <plugin name="phonegap-plugin-push" spec="1.8.4" source="npm"> -->
    <!-- <param name="SENDER_ID" value="{6}" /> -->
<!-- </plugin> -->
<plugin name="cordova-plugin-screen-orientation" source="npm"  spec="1.4.2" />
<plugin name="cordova-plugin-whitelist" spec="1.3.1" />
<plugin name="cordova-plugin-socialsharing" source="npm" version="4.3.81" />

  <platform name="android">
</platform>
<access origin="*" subdomains="true" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />

When i tired to add this plugin in phonegap build it;'s giving following error:

Build Date: 2017-05-19 06:20:24 +0000

PLUGIN OUTPUT

Fetching plugin "cordova-plugin-device@1.1.4" via npm Installing "cordova-plugin-device" at "1.1.4" for android Fetching plugin "cordova-plugin-geolocation@2.4.1" via npm Installing "cordova-plugin-geolocation" at "2.4.1" for android Fetching plugin "cordova-plugin-compat" via npm Installing "cordova-plugin-compat" at "1.1.0" for android Fetching plugin "cordova-plugin-inappbrowser@1.6.1" via npm Installing "cordova-plugin-inappbrowser" at "1.6.1" for android Fetching plugin "cordova-plugin-globalization@1.0.5" via npm Installing "cordova-plugin-globalization" at "1.0.5" for android Fetching plugin "cordova-plugin-network-information@1.3.1" via npm Installing "cordova-plugin-network-information" at "1.3.1" for android Fetching plugin "cordova-plugin-splashscreen@4.0.1" via npm Installing "cordova-plugin-splashscreen" at "4.0.1" for android Fetching plugin "cordova-plugin-media@2.4.1" via npm Installing "cordova-plugin-media" at "2.4.1" for android Fetching plugin "cordova-plugin-file" via npm Installing "cordova-plugin-file" at "4.3.3" for android Dependent plugin "cordova-plugin-compat" already installed on android.

The Android Persistent storage location now defaults to "Internal". Please check this plugin's README to see if your application needs any changes in its config.xml.

If this is a new application no changes are required.

If this is an update to an existing application that did not specify an "AndroidPersistentFileLocation" you may need to add:

  "<preference name="AndroidPersistentFileLocation" value="Compatibility" />"

to config.xml in order for the application to find previously stored files.

Dependent plugin "cordova-plugin-compat" already installed on android. Fetching plugin "cordova-plugin-dialogs@1.3.1" via npm Installing "cordova-plugin-dialogs" at "1.3.1" for android Fetching plugin "cordova-plugin-screen-orientation@1.4.2" via npm Installing "cordova-plugin-screen-orientation" at "1.4.2" for android Fetching plugin "cordova-plugin-whitelist@1.3.1" via npm Installing "cordova-plugin-whitelist" at "1.3.1" for android

           This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.

Fetching plugin "cordova-plugin-socialsharing@4.3.81" via npm Installing "cordova-plugin-socialsharing" at "4.3.81" for android

COMPILE OUTPUT

Configuration on demand is an incubating feature. Incremental java compilation is an incubating feature. :preBuild UP-TO-DATE :preDebugBuild UP-TO-DATE :checkDebugManifest :CordovaLib:preBuild UP-TO-DATE :CordovaLib:preDebugBuild UP-TO-DATE :CordovaLib:compileDebugNdk UP-TO-DATE :CordovaLib:compileLint :CordovaLib:copyDebugLint UP-TO-DATE :CordovaLib:mergeDebugProguardFiles :CordovaLib:packageDebugRenderscript UP-TO-DATE :CordovaLib:checkDebugManifest :CordovaLib:prepareDebugDependencies :CordovaLib:compileDebugRenderscript :CordovaLib:generateDebugResValues :CordovaLib:generateDebugResources :CordovaLib:packageDebugResources :CordovaLib:compileDebugAidl :CordovaLib:generateDebugBuildConfig :CordovaLib:mergeDebugShaders :CordovaLib:compileDebugShaders :CordovaLib:generateDebugAssets :CordovaLib:mergeDebugAssets :CordovaLib:processDebugManifest :CordovaLib:processDebugResources :CordovaLib:generateDebugSources :CordovaLib:incrementalDebugJavaCompilationSafeguard :CordovaLib:compileDebugJavaWithJavac :CordovaLib:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.). Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. :CordovaLib:processDebugJavaRes UP-TO-DATE :CordovaLib:transformResourcesWithMergeJavaResForDebug :CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug :CordovaLib:mergeDebugJniLibFolders :CordovaLib:transformNative_libsWithMergeJniLibsForDebug :CordovaLib:transformNative_libsWithSyncJniLibsForDebug :CordovaLib:bundleDebug :prepareProjectCordovaLibUnspecifiedDebugLibrary :prepareDebugDependencies :compileDebugAidl :compileDebugRenderscript :generateDebugBuildConfig :mergeDebugShaders :compileDebugShaders :generateDebugAssets :mergeDebugAssets :generateDebugResValues :generateDebugResources :mergeDebugResources :processDebugManifest :processDebugResources :generateDebugSources :incrementalDebugJavaCompilationSafeguard :compileDebugJavaWithJavac :compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.). /project/src/nl/xservices/plugins/SocialSharing.java:19: error: package org.apache.http.util does not exist import org.apache.http.util.ByteArrayBuffer; ^ /project/src/nl/xservices/plugins/SocialSharing.java:420: error: cannot find symbol ByteArrayBuffer baf = new ByteArrayBuffer(5000); ^ symbol: class ByteArrayBuffer location: class SocialSharing /project/src/nl/xservices/plugins/SocialSharing.java:420: error: cannot find symbol ByteArrayBuffer baf = new ByteArrayBuffer(5000); ^ symbol: class ByteArrayBuffer location: class SocialSharing Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /project/src/org/apache/cordova/file/AssetFilesystem.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 3 errors :compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.

BUILD FAILED

Total time: 2.924 secs Error: /project/gradlew: Command failed with exit code 1 Error output: Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. /project/src/nl/xservices/plugins/SocialSharing.java:19: error: package org.apache.http.util does not exist import org.apache.http.util.ByteArrayBuffer; ^ /project/src/nl/xservices/plugins/SocialSharing.java:420: error: cannot find symbol ByteArrayBuffer baf = new ByteArrayBuffer(5000); ^ symbol: class ByteArrayBuffer location: class SocialSharing /project/src/nl/xservices/plugins/SocialSharing.java:420: error: cannot find symbol ByteArrayBuffer baf = new ByteArrayBuffer(5000); ^ symbol: class ByteArrayBuffer location: class SocialSharing Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /project/src/org/apache/cordova/file/AssetFilesystem.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 3 errors

FAILURE: Build failed with an exception.

alpanayotovv commented 7 years ago

Hey @SiddiquiImran, I had the same issue. I suppose that just like me, you found the package on npm. Well, this is a different plugin.

Run $ cordova plugin add cordova-plugin-x-socialsharing and you should be good to go. If you look closely, you will see that you tried to install cordova-plugin-socialsharing, without the -x- in the middle.

SiddiquiImran commented 7 years ago

@alpanayotov, yes you are right. Thanks