Apache Cordova Facebook Plugin BUILD FAILED - javascript

I am trying to install the facebook cordova plugin using the cordova CLI but unfortunately, whatever I do, I get BUILD FAILED whenever I try to cordova build android.
This is what I am using to install the plugin
cordova plugin add https://github.com/phonegap/phonegap-facebook-plugin --variable APP_ID="my_facebook_app_id" --variable APP_NAME="my_facebook_app_name"
Of course, I use my real facebook App_ID and App_Name. I also put them in plugin.xml everywhere there is APP_NAME or APP_ID. I don't know how to get older cmd error logs, because the only errors I see when the buld fails are error occuring because of a previous error. I tried cordova build android -d but it didn't help at all.
I don't know if it has something to do with my cordova version or with the fact that I already have other plugins and have developed quite a lot and my app is no longer as empty as the example one.
Cordova version: 3.5.0-0.2.6
P.S.: Just tried it on a new cordova build of my version, same error. I wonder how everybody else is not getting any, obviously the error is in me or the cordova version ;(

Related

Cordova app installation crashes on android

Today I am trying to make a cordova app out of my existing website.
This seems to be pretty easy but there are some errors for me.
After installing everything and creating a new cordova project I only added this line in the index.js:
window.location = "http://myHomePage.net";
This should be enough for using your hosted website in a cordova android app.
And it really seems to work on my emulator but when I build the release for the app with:
cordova build --release android
and try to install the output apk my phone says:
app was not installed
How is this possible and does somebody know this issue?
The answer is don't use cordova build --release android!
cordova build android works.

Adding Cordova Platforms

Hey, Guys! I recently started to work with Cordova and when I run the Cordova platform add android i get the following error. I have successfully placed the environment variables for Java and for the Android SDK as well. But the npm modules does not exist in C:/Windows/System32/npm as shown in the error, It is in the Users/My username/AppData/Roaming/npm folder. Some guidance would be appreciated.
I followed the following scripts which are shown in the official Cordova documentation to create a new project.
Cordova create hello com.example.hello HelloWorld
cd hello
Cordova platform add android -> where I'm stuck at
Kindly Check the Android Version Provided by Cordova and verify with your current Android version installed on your system , if there a mismatch :
1) Update Android Version From Android Studio SDK Manager
2) Update Cordova Platform - Refer: Cordova Documentation
External Source
cordova - Error: Failed to fetch platform android
I figured out halfway what the the problem was. There was a file named 'npm' in my C:/Windows/System32 directory wich was of 0kb size, and once i deleted it, the error vanished. But not all the way though. I was able to install the browser platform but not the android platform via cordova platform add android or even specifying what the matching cordova-andriod pluggin to be with cordova platform add andriod#version.
Only through the cordova platform add https://github.com/apache/cordova-android.git script I could install the andriod platform and once it was done other steps worked fine, and the project ran through the Android AVD. Any idea why the normal command to add the android platform didnt work, Just want to know but if it happens again i think Im gonna have to run the get from git command again. Thanks

Google Play reject Cordova application 'cause contains security vulnerabilities for users

I developed an application on Apache Cordova, I followed all the steps to generate the .apk to upload on Google Play. I tried many times but Google's response is the same:
We rejected APP, package ID com.xxx.app, for violating our dangerous products policy. If you submitted an update, the previous version of
your app is still available on Google Play. This app uses software
that contains security vulnerabilities for users. Below is the list of
vulnerabilities and the corresponding APK versions that were detected
in your recent submission. Please upgrade your app(s) as soon as
possible and increment the version number of the upgraded APK.
Vulnerability Apache Cordova: The vulnerabilities were fixed in Apache Cordova v.3.5.1.
I have the latest version of Cordova (5.4.1).
The following will detail the steps that I followed for installation and project development:
Start the download of Cordova from the console Node.js using the command npm install -g Cordova.
Install Java: version 1.8.0_65.
Install Android SDK.
Add Java and SDK to PATH.
I downloaded the necessary components of the Android SDK.
Create the project through the commands. (Cordova create Projectxxxx).
Add the Android platform.
I copied my application code in the www folder.
Add the plugins needed for my project: splashscreen and sqlite.
I tested the application on the Android emulator and other mobile phones. All good. Runs perfect.
To create the signed APK file, these are the steps:
-Cordova build --release android. (This generated the android-release-unsigned.apk on platforms / android / build / outputs
/ apk).
-Then, I generated the keystore.
-After the jarsigner.
-Finally: zipalign.
I upload end-app.apk to Google Play.
Another detail that I have is that cordova.js generated version is 4.1.1. But the console version is 5.4.1 (Command: Cordova -version).
I did everything by node.js console.
Attemps:
I uploaded an APK without js components. Only with cordova.js and it not worked.
I installed all over again in a newly installed windows and neither worked.
My version is higher than 3.5.1. I can not find the solution.
The big problem is not just that PLATFORM_VERSION_BUILD_LABEL is wrong, but the default cordova used is ancient ( it was 3.7.1 on mine ). To resolve this you need to install a newer version in the project. You can specify this on the command line, much like npm does.
cordova platform update android#4.1.1
Or you can specify it in your config.xml
<engine name="android" version="4.1.1" />
That may need 'spec' instead of 'version' depending on how current you cordova install is. At this point, they are up to 5.1, and you can use 'latest' instead of a specific version number.
The next headache will be the point of the patch, which locks down network access. I am now getting 404 errors on all my ajax calls to our server. Access was the root of the security problem, so this isn't a big surprise. I am still working on that.
I had the same problem, I found a previous corodva version in a plugin, in my case was facebook connect; I deleted this plugin and upload again, its work form me. You may search PLATFORM_VERSION_BUILD_LABEL in your project, is posible that some plugin have other cordova version.
I was trying to solve this problem almost for a week. Solution:
There was a cordova.js file within www/lib/cordova folder that doesn't get updated when you update cordova and ionic. Open the file and look for var PLATFORM_VERSION_BUILD_LABEL. If the version is not 4.1.1 at the time of this post, update it with another copy of the file that is somewhere in your main directory.

Two cordova-plugin-device plugins

I have just added the cordova plugin com.phonegap.plugin.mobile-accessibility to my ionic project, and it had automatically installed cordova-plugin-device as it is its dependency.
This would be fine, but I already have the plugin installed (as a dependancy of another plugin) under a different name (org.apache.cordova.device). Has anyone got any ideas on whether I should keep both, or how I could remove one.
I think that having both of these plugins is causing the following error and stopping me from building the App.
[INFO:CONSOLE(59)] "Uncaught module cordova-plugin-device.device not found", source: file:///android_asset/www/cordova.js (59)
I have screen dumped the dependency errors I get when trying to uninstall one of the plugins.
Easy enough fix, I removed the android platform and then re-added it again. As it went through the install it skipped the second cordova-plugin-device plugin install so now the platform only has it once.
The App now builds and works as it should.
Answer was found here - http://forum.ionicframework.com/t/plugins-does-not-exist/2980/5
NOTE: did not need to remove and add ionic & Cordova, only the Android and iOS platforms

Phonegap 3.0,Cordova CLI: an error occurred during creation of ios sub-project

An Error is showing when I running the Android Project using Phonegap 3.0 in Command Line Interface
(Phonegap local run android)
Cordova CLI: an error occurred during creation of ios sub-project,The system can not find the path specified.
I have also tried the following steps
$ cordova create HelloWorld com.example.hello "Hello World"
Then try removing the whitespace between Hello World.
$ cordova create HelloWorld com.example.hello "HelloWorld"
Then It was giving the same error.
D:\Applications\TestApp1>Phonegap local run android
[phonegap] adding the Android platform...[error] An error occured during creation of android sub-project. The system cannot find the path specified.
Please suggest
[solved]
if you are using windows.
don't forget to install jdk. you can found it at link.
try to follow this instruction on youtube .
and for the detail instruction you can follow the phonegap get started page.
next, install the sdk android first. goto developer*android*com/sdk/index.html to download the package. furthermore extract them, and open the "sdk manager" at your path. install more package of API's as you needs.
i recommend to install gingerbread(2.3) api 10 and ICS(4.0) version.
on this progress install ant package you may found a trouble same as me. but don't worry, I've found the answer.
just follow this instruction on youtube*com/watch?v=bAbBqrTG3q4 . by using my package on drive*google*com/file/d/0B4B3LaTbByxAWlVpQjJhSjd5dVU/edit?usp=sharing .
if you still have an error, you can call me on YM : rifqi_platinum25.
note: change [*] with [.] to access the page. i'm sorry for inconvenience because i haven't at least 10 reputation to post with over 2 links. thank's.
I think you're having a problem of creating a new project. You can try it by changing the location as cordova create ../HelloWorld com.example.hello "HelloWorld"

Categories

Resources