Gradle build error: "Plugin with id 'com.google.ar.sceneform.plugin' not found."
Asked Answered
L

2

9

I am following this Sceneform SDK tutorial (https://www.raywenderlich.com/5485-arcore-sceneform-sdk-getting-started) and I encountered some issues while building Gradle. Here is my app build.gradle file:

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'


android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.kotlinfirstapp"
        minSdkVersion 24
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'


    implementation 'com.google.ar.ar:core:1.10.0'
    implementation 'com.google.ar.sceneform.ux:sceneform-ux:1.10.0'
    implementation 'com.google.ar.sceneform:core:1.10.0'
}

apply plugin: 'com.google.ar.sceneform.plugin'

sceneform.asset('sampledata/models/andy.obj',
        'default',
        'sampledata/models/andy.sfa',
        'src/main/res/raw/andy')

The output displays the following error:

Plugin with id 'com.google.ar.sceneform.plugin' not found.
Loot answered 28/6, 2019 at 13:17 Comment(0)
B
25

You are missing the classpath in the build.gradle (Project) file:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()

}
dependencies {
    classpath 'com.android.tools.build:gradle:3.4.1'        
    classpath 'com.google.ar.sceneform:plugin:1.10.0'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
Bureaucratize answered 28/6, 2019 at 13:49 Comment(0)
D
0

Assuming that your Android Version is 3.6.x. The latest Sceneform SDK 1.15+ is not supported by Android Version 3.6.x. A bug has been raised but there is no solution as of now!. What you can do is shift to Android Version 3.5.3 and use Sceneform SDK 1.15.0. Doing this will help you get rid of the problem you are facing.

Directoire answered 16/10, 2020 at 17:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.