This is my android\build.gradle file
buildscript {
ext.kotlin_version = '1.2.41'
repositories {
google()
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.ar.sceneform:plugin:1.13.0'
}
}
allprojects {
repositories {
google()
mavenCentral()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
This is my app\build.gradle file
package example.android.app
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new FileNotFoundException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'com.google.ar.sceneform.plugin'
android {
compileSdkVersion 29
buildToolsVersion "23.0.2"
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.riya.ar_3d_object"
minSdkVersion 24
targetSdkVersion 29
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
sceneform.asset('sampledata/Andy.obj',
'default',
'sampledata/Andy.sfa',
'src/main/assets/andy')
sceneform.asset('sampledata/TocoToucan.obj',
'default',
'sampledata/TocoToucan.sfa',
'src/main/assets/toucan')
sceneform.asset('sampledata/ArcticFox_Posed.obj',
'default',
'sampledata/ArcticFox_Posed.sfa',
'src/main/assets/artic_fox')
sceneform.asset('sampledata/fox_face.fbx',
'sampledata/fox_face_material.mat',
'sampledata/fox_face.sfa',
'src/main/assets/fox_face')
I'm getting this error
FAILURE: Build failed with an exception.
Where: Build file 'C:\Users\Dell\Desktop\ar_3d_object\example\android\build.gradle' line: 27
What went wrong: A problem occurred evaluating root project 'android'.
A problem occurred configuring project ':app'. Could not open cp_proj remapped class cache for auh9gocscmxbp0wg79n65tthz (C:\Users\Dell.gradle\caches\5.1.1\scripts-remapped\build_23qoew63m1vj2i2ymjivjusak\auh9gocscmxbp0wg79n65tthz\cp_proj13bba240a07c562d578336deed5b2fbf). > Could not open cp_proj generic class cache for build file 'C:\Users\Dell\Desktop\ar_3d_object\example\android\app\build.gradle' (C:\Users\Dell.gradle\caches\5.1.1\scripts\auh9gocscmxbp0wg79n65tthz\cp_proj\cp_proj13bba240a07c562d578336deed5b2fbf). > Build file 'C:\Users\Dell\Desktop\ar_3d_object\example\android\app\build.gradle' should not contain a package statement.