-
Notifications
You must be signed in to change notification settings - Fork 104
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
Build Android Error #93
Comments
I solve it. It's a file ubication problem, the aidl files was in a wrong path. I fork the project and fix the problem, in this fork i add MyService class. |
Hello,
Try with:
cordova plugin add https://github.com/icecoolinux/bgs-core.git
El lun., 29 oct. 2018 a las 18:37, felipe-ff (<[email protected]>)
escribió:
… MyService.java is not present im my src/Android folder... do I have to
install from another branch?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#93 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ARoqDiyjeEP3AyQKlEwma8ZzHgZuFsKEks5up3UogaJpZM4RLioN>
.
|
I did that, the project in the plugins folder is now correct but the one in node_modules still seems wrong? I installed with: npm i cordova-plugin-bgs-core |
I created a new ionic project and it worked, so probably something wrong with my project... Edit: Just had to ionic cordova platform rm android and add again to work! |
@felipe-ff can you offer a ionic project example with this plugin ? I met the same problem when I run cordova build command |
Yes, is a good idea.
El sáb., 3 de nov. de 2018 04:38, wangxinyu4027789 <[email protected]>
escribió:
… @felipe-ff <https://github.com/felipe-ff> can you offer a ionic project
example with this plugin ? I met the same problem when I run cordova build
command
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#93 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ARoqDuwfbj5UUu019pII3NXwfh-3lSqgks5urUgBgaJpZM4RLioN>
.
|
Ok I'll try to remove my personal changes and publish to github this week. |
I published my plugin's folder to github, all you have to do is create a new ionic project "ionic start myProject" and add the plugin from: https://github.com/felipe-ff/ionic-bgs-core.git Note that it will only work if your project's id is "io.ionic.starter", if you already have a working ionic project with a different id you will have to edit some parts of the plugin with your id. |
I already published a Readme change mentioning your project.
Thank
El lun., 5 nov. 2018 a las 15:47, felipe-ff (<[email protected]>)
escribió:
… I published my plugin's folder to github, all you have to do is create a
new ionic project "ionic start myProject" and add the plugin from:
https://github.com/felipe-ff/ionic-bgs-core.git
Note that it will only work if your project's id is "io.ionic.starter", if
you already have a working ionic project you will have to edit some parts
of the plugin with your id.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#93 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ARoqDoAiofX5WQad450d54J9AWf_rTaHks5usIfUgaJpZM4RLioN>
.
|
@felipe-ff ,@icecoolinux Thanks to all of you |
Hi,
I tried with cordova 8.1.2, gradle 4.4 and ionic 4.3.1.
This are the steps that I built successfully an android app:
1) ionic start myapp
2) cd myapp
3) ionic cordova plugin add https://github.com/icecoolinux/bgs-core.git
4) I found an error here, I edited the file
plugins/com.red_folder.phonegap.plugin.backgroundservice/plugin.xml, the
lines are:
<source-file src="aidl/android/BackgroundServiceApi.aidl"
target-dir="app/src/main/aidl/com/red_folder/phonegap/plugin/backgroundservice"
/>
<source-file src="aidl/android/BackgroundServiceListener.aidl"
target-dir="app/src/main/aidl/com/red_folder/phonegap/plugin/backgroundservice"
/>
By:
<source-file src="aidl/android/BackgroundServiceApi.aidl"
target-dir="aidl/com/red_folder/phonegap/plugin/backgroundservice" />
<source-file src="aidl/android/BackgroundServiceListener.aidl"
target-dir="aidl/com/red_folder/phonegap/plugin/backgroundservice" />
5) ionic cordova platform add android
6) Start the service from index.html, add:
<script>
var myService;
document.addEventListener('deviceready', function() {
var serviceName =
'com.red_folder.phonegap.plugin.backgroundservice.MyService';
var factory =
cordova.require('com.red_folder.phonegap.plugin.backgroundservice.BackgroundService');
myService = factory.create(serviceName);
myService.startService(function(r){getStatus()},
function(e){displayError(e)});
}, true);
function getStatus() {
myService.getStatus(function(r){displayResult(r)},
function(e){displayError(e)});
}
function displayResult(data) {
alert("Is service running: " + data.ServiceRunning);
}
function displayError(data) {
alert("We have an error");
}
</script>
7) ionic cordova build android
El mar., 13 nov. 2018 a las 14:45, felipe-ff (<[email protected]>)
escribió:
… For some reason this error started happening again to me...
BUILD FAILED
Total time: 2.219 secs
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
cmd: Command failed with exit code 1 Error output:
C:\ProjetosInatel\MyIonicProj\platforms\android\src\com\red_folder\phonegap\plugin\backgroundservice\BackgroundService.java:21: error: cannot find symbol
import com.red_folder.phonegap.plugin.backgroundservice.BackgroundServiceApi;
^
symbol: class BackgroundServiceApi
location: package com.red_folder.phonegap.plugin.backgroundservice
C:\ProjetosInatel\MyIonicProj\platforms\android\src\com\red_folder\phonegap\plugin\backgroundservice\BackgroundService.java:43: error: cannot find symbol
private List<BackgroundServiceListener> mListeners = new ArrayList<BackgroundServiceListener>();
^
symbol: class BackgroundServiceListener
location: class BackgroundService
C:\ProjetosInatel\MyIonicProj\platforms\android\src\com\red_folder\phonegap\plugin\backgroundservice\BackgroundService.java:154: error: package BackgroundServiceApi does not exist
private BackgroundServiceApi.Stub apiEndpoint = new BackgroundServiceApi.Stub() {
^
C:\ProjetosInatel\MyIonicProj\platforms\android\src\com\red_folder\phonegap\plugin\backgroundservice\BackgroundServicePluginLogic.java:283: error: cannot find symbol
private BackgroundServiceApi mApi;
^
symbol: class BackgroundServiceApi
location: class BackgroundServicePluginLogic.ServiceDetails
C:\ProjetosInatel\MyIonicProj\platforms\android\src\com\red_folder\phonegap\plugin\backgroundservice\BackgroundServicePluginLogic.java:661: error: package BackgroundServiceListener does not exist
private BackgroundServiceListener.Stub serviceListener = new BackgroundServiceListener.Stub() {
^
C:\ProjetosInatel\MyIonicProj\platforms\android\src\com\red_folder\phonegap\plugin\backgroundservice\BackgroundService.java:43: error: cannot find symbol
private List<BackgroundServiceListener> mListeners = new ArrayList<BackgroundServiceListener>();
^
symbol: class BackgroundServiceListener
location: class BackgroundService
C:\ProjetosInatel\MyIonicProj\platforms\android\src\com\red_folder\phonegap\plugin\backgroundservice\BackgroundService.java:154: error: package BackgroundServiceApi does not exist
private BackgroundServiceApi.Stub apiEndpoint = new BackgroundServiceApi.Stub() {
^
C:\ProjetosInatel\MyIonicProj\platforms\android\src\com\red_folder\phonegap\plugin\backgroundservice\BackgroundServicePluginLogic.java:636: error: package BackgroundServiceApi does not exist
mApi = BackgroundServiceApi.Stub.asInterface(service);
^
C:\ProjetosInatel\MyIonicProj\platforms\android\src\com\red_folder\phonegap\plugin\backgroundservice\BackgroundServicePluginLogic.java:661: error: package BackgroundServiceListener does not exist
private BackgroundServiceListener.Stub serviceListener = new BackgroundServiceListener.Stub() {
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
9 errors
This is driving me crazy what should I do to fix it? it seems like a
deprecaed use of some API.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#93 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ARoqDgCrTFL8_IzRPYw7ohHIuyJgM3BMks5uuwVLgaJpZM4RLioN>
.
|
This fixed it for me thanks. |
@icecoolinux @felipe-ff Is this a fix specifically for Ionic or is it needed for phonegap as well? |
Hello Friend,
I'm trying to compile the basic implementation, following its documentation but I'm locking in the build.
I think it's inexperienced with Java maybe you've already seen it.
After the android build, I get this:
I think it might be a version problem but I just installed an environment from scratch reinstalling everything I could compile without the plugin.
Thank you very much for your time;
The text was updated successfully, but these errors were encountered: