-
Notifications
You must be signed in to change notification settings - Fork 111
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
Cordova build to Android (clean) #3
Comments
Thanks for your issue, @subversivo58 . The It's possible, however, to use the sample that comes with the plugin on Windows by adapting the usage instructions of the plugin's README.md Create your app: cordova create MyApp
cd MyApp
cordova platform add android
cordova plugin add nodejs-mobile-cordova Copy the sample project files that are included in the plugin, you will be asked to overwrite the default copy plugins\nodejs-mobile-cordova\install\sample-project\www\js\index.js www\js\index.js
copy plugins\nodejs-mobile-cordova\install\sample-project\www\nodejs-project\main.js www\nodejs-project\main.js
copy plugins\nodejs-mobile-cordova\install\sample-project\www\nodejs-project\package.json www\nodejs-project\package.json Next, you could open After that, you can build and run the sample: cordova build android
cordova run android Check Regarding using build.phonegap.com , we're not familiar with the platform, but there's no reason why it shouldn't build. We encourage you to give it a try. Let us know how it goes. I hope this was helpful. |
Sorry for the delay in returning the presented help. I'm not familiar with native development or using Android Studio. I am using the build.phonegap.com tool because this tool abstracts the build process however of course I know the result is a hybrid application and that its performance is inferior to native applications. Using this tool I can only worry about the following structure:
Where the config.xml file is indeed "where things happen"... To add plugins using this tool is something as simple as:
Use as (in /js/index.js):
As several Cordova plugins are supported by this tool I am confused at this point, I know this is not an error in the plugin but rather incompatibility with a specific tool. Is it possible to get this "compatibility" by doing some adjustment or just "creating a new plugin"? I'm looking at the documentation of Cordova plugins but that far outweighs my knowledge. Although it is a relatively new tool, it is an official PhoneGap tool and contributes greatly to the development of applications. I wonder if this can be overcome or if I should open a new issue asking for this "compatibility" (feature)? |
Hi @subversivo58 , The plugin is published in npm as well. |
Basically the error informs that the NDK has not been configured. However build.phonegap.com says: you do not need the SDK configuration.
Yes the reference I used describes the origin (source) as
I have tried to test with a basic model to see if the error could have been caused by some specific feature of my application in the settings but the result (error) was identical, I did not save this log but I will perform the same procedure again to display the log error here in a later comment. |
When using:
The build fails and I get the following error:
When removing the plugin reference and trying to build again ... the build succeeds:
|
Hi @subversivo58 , thanks for the logs. From the error message, it seems the build system is unable to find the Android Native Development Kit (NDK). The cordova plugin needs to run NDK and CMake while building, since it depends on JNI C code compiling for Android. I tried to look up if build.phonegap.com supports NDK/CMake from I've tried submitting a sample application to build.phonegap.com that has a plugin depending on NDK as well and I got the same error. So, there's the possibility that plugins that include Native Code in Android are not supported in build.phonegap.com or need some special configuration on your application so that the build environment is set correctly. I'd advise trying to get support from the build.phonegap.com, since this is related to their tool and might be impossible to have access to NDK and CMake in their environment. In the meanwhile, it is possible to build applications for Android that use the plugin, on a Windows development environment. I hope this was helpful. Please let us know of any further developments. |
Thanks @jaimecbernardo. Officially build.phonegap.com uses a forum in Adobe, I'm looking for help there since plugins can optionally have configuration entries I'll try to know if any optional configuration refers to NDK. I would like to leave this question open if I find relevant information in the Adobe forum however I understand if the administration of this repository understands that this issue has been overcome. Thank you again. |
Thanks @subversivo58 . |
Hi @orangemocha,
I tried to use cordova-angularjs as an example to do a
build
for Android abstracting the use of AngularJS because I only wanted to follow the Node execution in addition to that I do not have a Mac to test ... I confess that the attempt was flawed (I believe that for my lack of knowledge of the process).Is there any limitation to the Windows
build
or idea of a basic example for Android?I have an app I use on build.phonegap.com, how could I integrate this plugin to the application source?
I was surprised to see the project and enthusiastic about the possibilities of using Node. Congratulations on the project.
The text was updated successfully, but these errors were encountered: