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

Build Android Error #93

Open
sr2ds opened this issue Dec 23, 2017 · 13 comments
Open

Build Android Error #93

sr2ds opened this issue Dec 23, 2017 · 13 comments

Comments

@sr2ds
Copy link

sr2ds commented Dec 23, 2017

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:

compileDebugJavaWithJavac/home/david/Development/cordova/service/platforms/android/app/src/main/java/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
/home/david/Development/cordova/service/platforms/android/app/src/main/java/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

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;

@icecoolinux
Copy link

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.
https://github.com/icecoolinux/bgs-core.git

@icecoolinux
Copy link

icecoolinux commented Oct 30, 2018 via email

@felipe-ff
Copy link

Hello, Try with: cordova plugin add https://github.com/icecoolinux/bgs-core.git El lun., 29 oct. 2018 a las 18:37, felipe-ff (notifications@github.com) 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

@felipe-ff
Copy link

felipe-ff commented Oct 30, 2018

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!

@wangxinyu4027789
Copy link

@felipe-ff can you offer a ionic project example with this plugin ? I met the same problem when I run cordova build command

@icecoolinux
Copy link

icecoolinux commented Nov 3, 2018 via email

@felipe-ff
Copy link

felipe-ff commented Nov 3, 2018

Ok I'll try to remove my personal changes and publish to github this week.

@felipe-ff
Copy link

felipe-ff commented Nov 5, 2018

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.

@icecoolinux
Copy link

icecoolinux commented Nov 6, 2018 via email

@wangxinyu4027789
Copy link

@felipe-ff ,@icecoolinux Thanks to all of you

@icecoolinux
Copy link

icecoolinux commented Nov 14, 2018 via email

@felipe-ff
Copy link

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" />

This fixed it for me thanks.

@Red-Folder
Copy link
Owner

@icecoolinux @felipe-ff Is this a fix specifically for Ionic or is it needed for phonegap as well?

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

5 participants