processing-android icon indicating copy to clipboard operation
processing-android copied to clipboard

"Cannot find 'android.view' library" when trying example sketch

Open piethon1 opened this issue 11 years ago • 6 comments

I've installed AndroidMode, and finally got it working with Processing (had to download version 3.0a11. Now I'm just trying to do a sample build to make sure it's running properly.

Here's the code I'm trying:

import android.view.MotionEvent;

void mouseDragged() {
 MotionEvent me = (MotionEvent) mouseEvent.getNative();
 // code here, like me.getHistorySize() and other Android-y things
}
import android.view.MotionEvent;

void mouseDragged() {
 MotionEvent me = (MotionEvent) mouseEvent.getNative();
 // code here, like me.getHistorySize() and other Android-y things
}

But I just keep getting told that there is no Android view library, or even no Android library if I try import android.*;

piethon1 avatar Aug 04 '15 06:08 piethon1

Please make sure you're in Android mode. Also, use the below code instead of the above code :

public void mouseDragged(MouseEvent event) {
    //Your code here
}

omerjerk avatar Aug 11 '15 17:08 omerjerk

@omerjerk @Manindra29 I run the mode after applying Manindra's fix https://github.com/processing/processing/commit/76a9facff4b579a40cf8bc0631503ee1115894c6 but still get

Cannot find "android.view" library. Line 1 in tab sketch_150828a

Is there anything else we need to update in the mode's code?

codeanticode avatar Aug 28 '15 18:08 codeanticode

I'm also getting it. When I edit the code to add new import, I get exception here - https://github.com/processing/processing/blob/master/java/src/processing/mode/java/pdex/ErrorCheckerService.java#L871

omerjerk avatar Aug 28 '15 18:08 omerjerk

This has now been fixed in https://github.com/processing/processing/commit/77801509fbf436603a2646e84bfcf0beb537b2ca

@codeanticode @omerjerk, please verify. We can then close this. @piethon1 Please download the latest processing-master to try it out.

Manindra29 avatar Aug 29 '15 04:08 Manindra29

This is fixed now with the latest commits by @Manindra29.

omerjerk avatar Aug 29 '15 04:08 omerjerk

confirming that the "cannot find library" error is gone. This fix will be incorporated in the next release of the mode, to be out alongside beta 6. Thanks @Manindra29 !

codeanticode avatar Aug 29 '15 11:08 codeanticode