java - plugin with id 'com.android.application' not found. android studio jni sample -
i trying follow android-studio-jni tutorial following link:
the simple android app works fine change classpath gradle-experimental suggested in tutorial, above mentioned error. did @ other questions related none of them solved issue.
these changes made(as done in tutorial example):
in build.gradle (module:app) file:
`proguardfiles getdefaultproguardfile('proguard-android.txt'),` `'proguard-rules.pro'`
replaced :
proguardfiles.add(file('proguard-android.txt'))
in gradle-wrapper.properties (gradle version):
distributionurl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
replaced with
distributionurl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
in build.gradle (project:samples) file:
classpath 'com.android.tools.build:gradle:2.3.3'
replaced with
classpath 'com.android.tools.build:gradle-experimental:0.9.3’
update:
as suggested @hetfieldan24 , mistake not having correct plugin type. once modified it, getting following error:
error:(3, 0) not find method android() arguments [build_90xijo5xugofjl1c4u81bbnlj$_run_closure1@e9e4277] on project ':app' of type org.gradle.api.project.
files:
build.gradle (module:app)
apply plugin: 'com.android.model.application' android { compilesdkversion 26 buildtoolsversion "26.0.0" defaultconfig { applicationid "com.polyyai.user.samplejniapp1" minsdkversion 25 targetsdkversion 26 versioncode 1 versionname "1.0" testinstrumentationrunner "android.support.test.runner.androidjunitrunner" } buildtypes { release { minifyenabled false //proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' proguardfiles.add(file('proguard-android.txt')) } } } dependencies { compile filetree(dir: 'libs', include: ['*.jar']) androidtestcompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.android.support:appcompat-v7:26.+' compile 'com.android.support.constraint:constraint-layout:1.0.1' compile 'com.android.support:design:26.+' testcompile 'junit:junit:4.12' }
build.gradle (project:samples)
// top-level build file can add configuration options common sub-projects/modules. buildscript { repositories { jcenter() } dependencies { //classpath 'com.android.tools.build:gradle:2.3.3' classpath 'com.android.tools.build:gradle-experimental:0.9.3' // note: not place application dependencies here; belong // in individual module build.gradle files } } allprojects { repositories { jcenter() } } task clean(type: delete) { delete rootproject.builddir }
gradle-wrapper.properties (gradle version)
#sat aug 19 17:05:08 edt 2017 distributionbase=gradle_user_home distributionpath=wrapper/dists zipstorebase=gradle_user_home zipstorepath=wrapper/dists distributionurl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
any appreciated.
thanks
Comments
Post a Comment