In AS v1.4.1, I also needed to move the autogenerated 
'android.compileOptions{}' inside the model block and use the .with/= 
syntax.

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

model {
    android {
        compileSdkVersion = 23
        buildToolsVersion = "23.0.1"

        compileOptions.with {
            sourceCompatibility = JavaVersion.VERSION_1_7
            targetCompatibility = JavaVersion.VERSION_1_7
        }
        // ...
    }
   // ...
}

On Monday, October 5, 2015 at 3:38:37 PM UTC-7, GameCodingNinja wrote:
>
> Never mind. I was able to get it to compile without error. I missed adding 
> one of the '=' in ./app/build.gradle. Bah! Also needed to remove the line 
> "testCompile 'junit:junit:4.12'" from dependencies.
>
> It should have produced an *.so file. Where is the file or do I need to 
> tell it to do that somewhere? 
>
> On Monday, October 5, 2015 at 2:52:53 PM UTC-5, GameCodingNinja wrote:
>>
>> This is what I'm trying to do which should be very simple. I'm using 
>> Windows 10 btw.
>>
>> 1) I start by creating a new Blank Activity project.
>> 2) Add a JNI folder under MyApplication.app.main
>> 3) Add an empty class via cpp & h files.
>>
>> Build it and I get... Error:Execution failed for task 
>> ':app:compileDebugNdk'.
>> > Error: NDK integration is deprecated in the current plugin.  Consider 
>> trying the new experimental plugin.  For details, see 
>> http://tools.android.com/tech-docs/new-build-system/gradle-experimental.  
>> Set "android.useDeprecatedNdk=true" in gradle.properties to continue using 
>> the current NDK integration.
>>
>> That's when I start following this...
>> http://tools.android.com/tech-docs/new-build-system/gradle-experimental
>>
>> I download the latest gradle (gradle-2.8-rc-1) but it bitches at me it 
>> wants gradle-2.5 so I download and install that.
>>
>> I make the changes via the web page. Not everything in ./app/build.gradle 
>> applies to what the web page says. The web page has more stuff then what 
>> was generated when the project was made.
>>
>> I try building again and get an error message that allows me to view the 
>> Gradle window (where is this thing hiding?). I choose gradle-2.5 and build 
>> again and below is my set of error messages.
>>
>> Error:(31, 0) Gradle DSL method not found: 'testCompile()'
>> Possible causes:<ul><li>The project 'My Application' may be using a 
>> version of the Android Gradle plug-in that does not contain the method 
>> (e.g. 'testCompile' was added in 1.1.0).
>> <a href="fixGradleElements">Fix plugin version and sync 
>> project</a></li><li>The project 'My Application' may be using a version of 
>> Gradle that does not contain the method.
>> <a href="openGradleSettings">Gradle settings</a></li><li>The build file 
>> may be missing a Gradle plugin.
>> <a href="apply.gradle.plugin">Apply Gradle plugin</a></li>
>>
>> At this point I don't know what to do.
>>
>>
>> On Monday, October 5, 2015 at 11:40:41 AM UTC-5, GameCodingNinja wrote:
>>>
>>> I'm new to Android development and Android Studio 1.4. I wanted to try 
>>> adding some C++ to a simple "hello World" app to get an idea of how it 
>>> works. The sample Android apps that have C++ don't compile and my adding an 
>>> empty class also don't compile.
>>>
>>> I've been following this but none of it seems to work. Seems like it's 
>>> for 1.3.
>>> http://tools.android.com/tech-docs/new-build-system/gradle-experimental
>>>
>>> I installed NDK from the project structure window.
>>>
>>> This link here gives the impression 1.3 is good to go with C++ but yet I 
>>> can't get anything to work in 1.4.
>>>
>>> http://android-developers.blogspot.com/2015/07/get-your-hands-on-android-studio-13.html
>>>
>>> Any help would be appreciated.
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to