Apache Cordova CordovaActivity could not be resolved

I have a similar problem:

Cordova cannot be resolved for type in Phonegap 3.4 .

Hence, in the main class CordovaActivity

it cannot be resolved for the type.

However, I downloaded Cordova Android Zip from here (as explained in the comments): https://github.com/apache/cordova-android .

And included cordova-2.2.0.jar

from ./lib/android

in my build path.

Line:

import org.apache.cordova

      

now works fine, but still it doesn't find the class called CordovaActivity

for extension.

What I prove:

grep -r "CordovaActivity" *

      

in the unpacked folder cordova-2.2.0.jar

.

What's wrong here?

enter image description here


Also, there seems to be a package problem: the main java file is in ./src/com/testapp/test2

, on line 20 it says after I call cordova -d build

:

package com.testapp.test;

      

with a red underline that only disappears after the src.

before is added com.testsapp.test2

. However, this gets squashed on every call cordova -d build

. If I correct the path in the config.xml file from

<widget id="com.testapp.test2" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">

      

to

<widget id="src.com.testapp.test2" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">

      

I will have a new package in my package explorer: src.src.com.testapp.test2

having the same problem.

It seems really strange.

+3


source to share


2 answers


So are you using Eclipse or Android Studio for building?

In any case, you should add the Cordova module found in platforms/android/CordivaLib

, depending on your project.



The way to do it for Eclipse is here -> http://red-folder.blogspot.de/2014/01/cordova-330-cordovalib-and-eclipse.html .

And the way to do it in Android Studio is here - > fooobar.com/questions/12702 / ...

+4


source


I found this on the internet. This helped me: http://red-folder.blogspot.de/2014/01/cordova-330-cordovalib-and-eclipse.html



+2


source







All Articles