首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在android模块中使用sceneform依赖项

在android模块中使用sceneform依赖项
EN

Stack Overflow用户
提问于 2018-06-25 11:20:24
回答 2查看 610关注 0票数 1

我试图在android模块中使用sceneform依赖项。但上面写着一个错误:

Sceneform只能应用于Android项目。

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

我的应用程序模块的build.gradle如下:

代码语言:javascript
复制
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')
EN

回答 2

Stack Overflow用户

发布于 2018-07-25 18:43:48

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

代码语言:javascript
复制
buildscript {
    repositories {
        google()
        jcenter()
        mavenLocal()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
        classpath 'com.google.ar.sceneform:plugin:1.3.0'
    }
}  
票数 0
EN

Stack Overflow用户

发布于 2022-04-21 09:48:01

在app build.gradle中,它必须是

代码语言:javascript
复制
dependencies {
    classpath 'com.google.ar.sceneform:plugin:1.12.0'
}

在项目build.gradle中,您必须包括Sceneform插件

代码语言:javascript
复制
plugins {
id 'com.google.ar.sceneform.plugin' }

也不要忘记依赖关系

代码语言:javascript
复制
dependencies {
implementation "com.google.ar.sceneform.ux:sceneform-ux:1.12.0"
implementation 'com.google.ar.sceneform:assets:1.17.1'}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51022279

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档