google-ar / sceneform-android-sdk

Sceneform SDK for Android
https://developers.google.com/sceneform/develop/
Apache License 2.0
1.23k stars 603 forks source link

apply plugin: 'com.google.ar.sceneform.plugin' breaking code #816

Closed ChanduMnS closed 5 years ago

ChanduMnS commented 5 years ago

I've right clicked on the .obj file and clicked on Import scene form asset. Then @ #apply plugin: 'com.google.ar.sceneform.plugin'

sceneform.asset('sampledata/ArcticFox_Posed.obj', 'default', 'sampledata/ArcticFox_Posed.sfa', 'src/main/assets/ArcticFox_Posed')

added to my app's gradle file, followed by error message

Unable to find method 'com.android.build.gradle.api.ApplicationVariant.getMergeResourcesProvider()Lorg/gradle/api/tasks/TaskProvider;'. Possible causes for this unexpected error include:

  • Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) Re-download dependencies and sync project (requires network)
  • The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem. Stop Gradle build processes (requires restart)
  • Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

I'm using the following configurations:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "myfirstapp.example.com.helloar"
        minSdkVersion 26
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    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'
    // Provides ArFragment, and other UX resources.
    implementation 'com.google.ar.sceneform.ux:sceneform-ux:1.11.0'
    implementation 'com.google.ar:core:1.11.0'

    // Alternatively, use ArSceneView without the UX dependency.
    implementation 'com.google.ar.sceneform:core:1.11.0'
}

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

sceneform.asset('sampledata/ArcticFox_Posed.obj',
        'default',
        'sampledata/ArcticFox_Posed.sfa',
        'src/main/assets/ArcticFox_Posed')

can you please tell me the issue. I've seen many forums but didn't get any solution.

My references:

ChanduMnS commented 5 years ago

I've upgraded my android studio to 3.4.2 and it's working now. Thanks