首页 > 系统服务 > 详细

JNI在eclipse中出现Unresolved inclusion: <jni.h>或Type 'jint' could not be resolved等解决方法

时间:2016-09-08 14:43:45      阅读:438      评论:0      收藏:0      [点我收藏+]

在eclipse中经常出现这类错误,include文件报错或者是jint,jclass,JNIEnv could not be resolved等,但可以编译通过,可以经过这个步骤消除这些错误或警告

1. 打开.project,删除cdt部分

    <buildSpec>
        <buildCommand>
            <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
            <triggers>clean,full,incremental,</triggers>
            <arguments>
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
            <arguments>
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
            <arguments>
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>org.eclipse.jdt.core.javabuilder</name>
            <arguments>
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>com.android.ide.eclipse.adt.ApkBuilder</name>
            <arguments>
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
            <triggers>full,incremental,</triggers>
            <arguments>
            </arguments>
        </buildCommand>
    </buildSpec>
    <natures>
        <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
        <nature>org.eclipse.jdt.core.javanature</nature>
        <nature>org.eclipse.cdt.core.cnature</nature>
        <nature>org.eclipse.cdt.core.ccnature</nature>
        <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
        <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
    </natures>

2. 删除.cproject文件

3. 打开工程,refresh,然后右键->properties->Android Tools -> Add Native Support

经过上述步骤就不会出现之前的那些错误和警告了。

JNI在eclipse中出现Unresolved inclusion: <jni.h>或Type 'jint' could not be resolved等解决方法

原文:http://www.cnblogs.com/tingjiang/p/5852839.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!