gpt4 book ai didi

android - 应用插件: 'com.google.ar.sceneform.plugin'。无法建立

转载 作者:行者123 更新时间:2023-12-03 05:34:21 27 4
gpt4 key购买 nike

我正在尝试实现我的第一个Sceneform应用程序。
我正在关注以下教程:

我的引用:

https://www.youtube.com/playlist?list=PLsOU6EOcj51cEDYpCLK_bzo4qtjOwDWfW

https://developers.google.com/ar/develop/java/quickstart

我正在使用以下配置:

mac os High Sierra-版本10.13.6(17G7024)
Android Studio-3.1.3

我的应用的gradle文件:

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')


我项目的gradle文件:
// 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.1.3'


// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.ar.sceneform:plugin:1.11.0'
}
}

allprojects {
repositories {
google()
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}


我的 list 文件:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="myfirstapp.example.com.helloar">

<uses-permission android:name="android.permission.CAMERA" />
<!-- "AR Required" apps must declare minSdkVersion ≥ 24 -->
<uses-sdk android:minSdkVersion="24" />


<!-- Indicates that the app requires ARCore ("AR Required"). Ensures the app is
visible only in the Google Play Store on devices that support ARCore.
-->
<uses-feature android:name="android.hardware.camera.ar" />



<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data android:name="com.google.ar.core" android:value="required" />

</application>

</manifest>


当我右键单击.obj文件并单击导入场景形式 Assets 时。将以下内容添加到我的应用程序的gradle文件中
apply plugin: 'com.google.ar.sceneform.plugin'

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

错误给出:

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.



请帮助修复。

最佳答案

我已经将Android Studio升级到3.4.2,并且现在可以正常工作。

关于android - 应用插件: 'com.google.ar.sceneform.plugin'。无法建立,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57416476/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com