【问题标题】:Using sceneform dependency in android studio module在android studio模块中使用sceneform依赖
【发布时间】:2018-06-25 11:20:24
【问题描述】:

我正在尝试在 android studio 模块中使用 sceneform 依赖项。但它说一个错误:

Sceneform 只能应用于 Android 项目

不过,在 app 模块的 gradle 文件中使用相同的依赖项效果很好。

我的app模块的build.gradle如下:

apply plugin: 'com.android.library'

android {
    compileSdkVersion 27

    defaultConfig {
        minSdkVersion 24
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

        ndk {
            /*
             * Sceneform is available for the following ABIs: arm64-v8a, armv7a,
             * x86_64 and x86. This sample app enables arm64-v8a to run on
             * devices and x86 to run on the emulator. Your application should
             * list the ABIs most appropriate to minimize APK size (arm64-v8a recommended).
             */
            abiFilters 'arm64-v8a', 'x86'
        }
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation 'com.android.support:appcompat-v7:27.1.1'
    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.sceneform:core:1.0.0'
    implementation 'com.google.ar.sceneform.ux:sceneform-ux:1.0.0'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
}

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

sceneform.asset('models/Tables/table1.fbx',
        'default',
        'models/Tables/table1.sfa',
        'src/main/res/raw/table1')

【问题讨论】:

    标签: augmented-reality arcore sceneform


    【解决方案1】:

    你记得在你的项目 gradle 文件中输入sceneform:plugin 吗?

    buildscript {
        repositories {
            google()
            jcenter()
            mavenLocal()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.1.3'
            classpath 'com.google.ar.sceneform:plugin:1.3.0'
        }
    }  
    

    【讨论】:

      猜你喜欢
      • 2015-07-03
      • 1970-01-01
      • 2014-12-27
      • 2018-06-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-25
      相关资源
      最近更新 更多