How to configure NDK project in Android Studio 1.3

前端 未结 3 900
有刺的猬
有刺的猬 2021-02-20 03:08

I have been trying to configure Android Studio for NDk by following this article and this article. The following are the contents of my gradle-wrapper.properties



        
相关标签:
3条回答
  • 2021-02-20 03:43
    NDK Build option
    
    ndk {
      moduleName "SeePlusPlus" // Name of C++ module (i.e. libSeePlusPlus)
      cFlags "-std=c++11 -fexceptions" // Add provisions to allow C++11 functionality
      stl "gnustl_shared" // Which STL library to use: gnustl or stlport
    }
    
    0 讨论(0)
  • 2021-02-20 03:57

    Have you declare your NDK path in Local.property file ??

    Looks like the environment path and the local.properties files are pointing to different locations:

    PATH: C:\Program Files (x86)\Android\android-ndk-r9d
    

    local.properties: C:\Program Files (x86)\Android\android-studio\android-ndk-r9d

    Make sure which is right. You can keep the PATH and drop the local.properties declerations, and then try this command through the console: ndk-build -? to see if it was found in PATH

    0 讨论(0)
  • 2021-02-20 04:00

    In your build.gradle(module), the android.buildTypes block needs to outside of the android block. So it should look like this:

    model {
        android {
            compileSdkVersion = 22
            buildToolsVersion = "23.0.0 rc3"
    
            defaultConfig.with {
                applicationId = "com.opaxlabs.nativetest"
                minSdkVersion.apiLevel =  15
                targetSdkVersion.apiLevel =  22
                versionCode = 1
                versionName = "1.0"
            }
        }
        android.buildTypes {
            release {
                minifyEnabled = false
                proguardFiles += file('proguard-rules.pro')
            }
        }
        android.ndk{
            moduleName = "native"
        }
    }
    
    0 讨论(0)
提交回复
热议问题