마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

Error: cannot access 오류좀 봐주세요 JNI

0 추천

먼저 GLView.java 코드 올릴게요

package com.ndk_opengl;

import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;
import android.content.Context;
import android.opengl.GLSurfaceView;
import android.opengl.GLSurfaceView.Renderer;
import android.view.MotionEvent;

public class GLView extends GLSurfaceView implements Renderer {

    private static native void nativeCreated(); 
    private static native void nativeChanged(int w, int h);
    private static native void nativeUpdateGame();
    private static native void nativeOnTouchEvent(int x, int y, int touchFlag);
    
    public GLView(Context context) {
        super(context);
        this.setRenderer(this);
        this.requestFocus();
        this.setRenderMode(RENDERMODE_WHEN_DIRTY);
        this.setFocusableInTouchMode(true);
    }

    @Override
    public void onSurfaceCreated(GL10 gl, EGLConfig config) {
        nativeCreated();
        
    }

    @Override
    public void onSurfaceChanged(GL10 gl, int w, int h) {
        nativeChanged(w, h);
        
    }

    @Override
    public void onDrawFrame(GL10 gl) {
        nativeUpdateGame();
        
    }
    @Override
    public boolean onTouchEvent(MotionEvent event) {
        nativeOnTouchEvent((int)event.getX(), (int)event.getY(), event.getAction());
        return true;
    }
    

여기서 jni를 이용하여 c파일을 만들고싶은데

Error:cannot access android.opengl.GLSurfaceView
class file for android.opengl.GLSurfaceView not found라고 뜨네요
프로젝트폴더\bin\classes>javah ../../jni/jni.c com.ndk_opengl.GLView 이렇게 해도 뜨고 인터넷에 나와있는
프로젝트폴더\bin>javah -classpath ./classes/ com.ndk_opengl.GLView 이래도 뜨고 .. 어떡하면 GLSrufaceView 를 할수있죠 ? Activity 할때도 마찬가지에용.. 알려주세요 개발자님들.

 

 
 
 
 
 
문어야 (300 포인트) 님이 2015년 12월 3일 질문

답변 달기

· 글에 소스 코드 보기 좋게 넣는 법
· 질문에 대해 추가적인 질문이나 의견이 있으면 답변이 아니라 댓글로 달아주시기 바랍니다.
표시할 이름 (옵션):
개인정보: 당신의 이메일은 이 알림을 보내는데만 사용됩니다.
스팸 차단 검사:
스팸 검사를 다시 받지 않으려면 로그인하거나 혹은 가입 하세요.
...