on 02-11-2015 11:04 AM
Hi SMP Kapsel experts,
I am stacked in a problem and hope soemone can help me out. Basically, I just want to create a Cordova project (and add Kapsel plugins later) and load it into Eclipse (Kepler)+ADT, and run it on AVD or HTC devices
Here are my settings of tools:
IDE: Eclipse (Kepler SR2) +ADT (23.0.4.1468518)
Android SDK (upto anroid 5.0.1)
Cordova (4.4.2)
jdk1.8.0_31
SMP server: SMP3.0_SP05
SMP SDK (Kapsel SDK): 3.0_SP06_PL02
Here are the commands used to create a cordova project:
cordova create appFolder com.myapp.id myapp
cordova plateform add android
cordova build android //this is optional, tried in same cases
cordova prepare andriod
Here is the problem:
(Note that for now I have not reach the step to add Kapsel plugin yet. ) After these, I load the generated project into the Kepler eclipse, its precompipling shows this error:
Can anyone please tell what might go wrong here? Seems cordova lib is missing but why? Some version mismatch?
Thanks a lot in advance!
Dong Zhu
Hi There,
Thanks for all the help tips, and those steps are correct steps to follow.
Here I want to share the solution of my specific issue:
Cause: used cordova 4.2.0 which has bugs - does not create correct 2 projects. There is a note how to manually modify teh generated .xml files to get the project work.
Better solution is:
Fix: - installed cordova 3.6.3 which generated 2 projects.
By default, the latest codova is installed - which you should be careful - the latest does not mean the best!
Br,
Dong
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Abaper and Midhun,
Thanks a lot for the info. I will post the question somewhere else.
At least I am using different versions: cordova 4.2.0, android API 19. I will try other versions.
Br,
Dong
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
I have found two things that might be wrong:
1. When importing the cordova project into ADT, I didn't use "Android Project".
2. The default JRE in ADT was pointing to an old jre.
But after the fixes above, I have the following issues:
1. After generate a cordova project, when Import it into ADT, there are 2 projects to be imported:
One is my project, the other is called "Cordovaapp-CordovaLib". Is this correct?
2. After loaded into ADT, I still have issues in my cordova project:
The same error as shown in my pic above - the building cannot see teh package src/org apache.codova which is in "Cordovaapp-CordovaLib" project.
I think this is the key issue - the cordova package is missing in my generated project.
3. In CordovaApp.java where the errors ocurr, its code:
public class CordovaApp extends CordovaActivity{
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.init();
// Set by <content src="index.html" /> in config.xml
loadUrl(launchUrl);
Here, besides the error due to missing package, my question here is how can I set the var "launchUrl" to point to the index.html under /www/ folder? I cannot see here this string is defined. Could it be defined in the missing cordova package? By hacking the err code (ignoring), II can get the cordova icon shown in the Android emulator, but no actual index.html UI is shown.
Appreciate all the helps!
Dong
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dong,
Are you following the below steps:
Regards, Midhun
SAP Technology RIG
Hi Midhun,
Yes, I did the same steps as yours and I did get the similar pic above. The "Copy project into workspace" was unchecked by default. After that, there are two projects imported into ADT.
In fact, what I wonder is the further steps done in the IDE (Kepler+ADT):
Can you show me how your prject looks after the import? I can see in your pic that there are also two projects to be imported. How did you build your two project? - Did you merge them into one or keep them separated? The cordova lib is in fact in the "CordovaLib" project.
Anther thing is how you resolve the "launchUrl" variable in the onCreate()?
Thx a lot!
Dong
First, please do the steps that told here; http://docs.phonegap.com/en/edge/guide_cli_index.md.html#The%20Command-Line%20Interface and then import the project into eclipse as midhun told, then you will see cordova lib.
Hi Dong,
Below is the screen shot after import:
I haven't merged IATDemo-CordovaLib. The project was build automatically and I am able to run the IATDemo project.
I have Java 7, cordova 3 and android API level 21.
I would recommend to post this question in stackoverflow for a quick response since it is not related to SAP's technology/solution. And you can come back if you stuck with Kapsel.
Regards, Midhun
SAP Technology RIG
Hi Dong,
When you are importing the project to Eclipse do not check the option "copy projects into workspace" and try.
I have noticed that cordova version you are using is incompatible with SMP SDK (Even it's not the reason of the issue; would help you later). You can refer:
Cordova 3.0.6 (or the latest 3.0.x version) should be used if using SMP 3.0 SDK.
Cordova 3.1.0-0.2.0 (or the latest 3.1.x version) should be used if using SMP 3.0 SP01 SDK.
Cordova 3.3.1-0.1.2 (or the latest 3.3.x version) should be used if using SMP 3.0 SP02 SDK.
Cordova 3.4.0-0.1.3 should be used if using SMP 3.0 SP03 SDK.
Cordova 3.4.1-0.1.0 should be used if using SMP 3.0 SP04 SDK.
Cordova 3.5.0-0.2.7 (or the latest 3.5.x version) should be used if using SMP 3.0 SP05 SDK.
Cordova 3.6.3-0.2.13 (or the latest 3.6.x version) should be used if using SMP 3.0 SP05 PL03 or SP06 SDK.
Regards, Midhun
SAP Technology RIG
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Midhun,
Thanks for the quick reply. You hit some of the points - first, I will try the import process again. Secondly, I also notcied that there are different versions between Cordova and SMP SDK. From the posts I saw, they are using old Cordova versions. Is there any link which shows the complete list of the versions used?
But just for now, I have not reach the step to add the Kapsel plugins using the Cordova. All I tried was a purely cordova project which was imported into Eclipse ADT. It should not be related to SMP SDK yet.I had an old project I made before which was working and I can see there is a cordovaxxx.jar in the project tree.
Seems smething to do with "Build Path" config in Eclipse where cordova lib has to be added somehow. Thx.
Br,
Dong
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.