1

It looks like the AndroidStudio 2.1 editor highlights the header file from a native module red as though it is missing. It seems to build and run with no issues though. Anyone facing the same issue? (See attached images below)

Also the editor suggests that I include Addition.h using the long relative path. Adding the header file location with cppFlags does not seem to fix this issue.

app build.gradle

apply plugin: 'com.android.model.application'

model {
    android {
        .......
        ndk{
            moduleName = 'native'
        }
        sources {
            main {
                jni {
                    dependencies {
                        project ':Addition' linkage 'static'
                    }
                }
            }
        }
    }
}

Addition module build.gradle

apply plugin: 'com.android.model.native'

model {
    android {
        ........
        ndk {
            moduleName = 'addition'
        }
        sources {
            main {
                jni {
                    exportedHeaders{
                        srcDir "src"
                    }
                    source {
                        srcDir "src"
                    }
                }
            }
        }
    }
}

Steps to Reproduce: https://github.com/noridge/StudioClintBug

Studio Build: 2.1.1
Version of Gradle Plugin: experimental 0.7.0 and 2.1.0 
Version of Gradle: 2.10
OS: MacOSX El Capitan 10.11.4

enter image description here enter image description here

Harkish
  • 2,262
  • 3
  • 22
  • 31
  • Have you tried looking at Google's NDK sample - **hello-libs**? https://github.com/googlesamples/android-ndk/tree/master/hello-libs. They demonstrate how to copy header files into a directory in your project. – IgorGanapolsky Jul 13 '16 at 18:45

1 Answers1

0

Filed a bug with Google. They seem to have fixed it in 2.2

https://code.google.com/p/android/issues/detail?id=209865

Harkish
  • 2,262
  • 3
  • 22
  • 31