Anandhanarayan K
Anandhanarayan K

Reputation: 1

How clear the issue of gradlew build error in android studio

./gradlew build 

> Task :app:compileDebugJavaWithJavac
C:\Users\GOAT\Desktop\equation3dviewer\app\src\main\java\com\example\equation3dviewer\MainActivity.java:15: error: cannot find symbol
import com.gorisse.thomas.sceneform.ArFragment;
                                   ^
  symbol:   class ArFragment
  location: package com.gorisse.thomas.sceneform
C:\Users\GOAT\Desktop\equation3dviewer\app\src\main\java\com\example\equation3dviewer\MainActivity.java:16: error: package com.gorisse.thomas.sceneform.rendering does not exist
import com.gorisse.thomas.sceneform.rendering.ModelRenderable;
                                             ^
C:\Users\GOAT\Desktop\equation3dviewer\app\src\main\java\com\example\equation3dviewer\MainActivity.java:27: error: cannot find symbol
    private ArFragment arFragment;
            ^
  symbol:   class ArFragment
  location: class MainActivity
C:\Users\GOAT\Desktop\equation3dviewer\app\src\main\java\com\example\equation3dviewer\MainActivity.java:28: error: cannot find symbol
    private ModelRenderable modelRenderable;
            ^
  symbol:   class ModelRenderable
  location: class MainActivity
C:\Users\GOAT\Desktop\equation3dviewer\app\src\main\java\com\example\equation3dviewer\MainActivity.java:39: error: cannot find symbol
        arFragment = (ArFragment) getSupportFragmentManager().findFragmentById(R.id.arFragment);
                      ^
  symbol:   class ArFragment
  location: class MainActivity
C:\Users\GOAT\Desktop\equation3dviewer\app\src\main\java\com\example\equation3dviewer\MainActivity.java:101: error: cannot find symbol
        ModelRenderable.builder()
        ^
  symbol:   variable ModelRenderable
  location: class MainActivity
C:\Users\GOAT\Desktop\equation3dviewer\app\src\main\java\com\example\equation3dviewer\MainActivity.java:111: error: cannot find symbol
        ModelRenderable.builder()
        ^
  symbol:   variable ModelRenderable
  location: class MainActivity
C:\Users\GOAT\Desktop\equation3dviewer\app\src\main\java\com\example\equation3dviewer\MainActivity.java:122: error: package com.gorisse.thomas.sceneform.ux does not exist
            com.gorisse.thomas.sceneform.ux.TransformableNode node = new com.gorisse.thomas.sceneform.ux.TransformableNode(arFragment.getTransformationSystem());
                                           ^
C:\Users\GOAT\Desktop\equation3dviewer\app\src\main\java\com\example\equation3dviewer\MainActivity.java:122: error: package com.gorisse.thomas.sceneform.ux does not exist
            com.gorisse.thomas.sceneform.ux.TransformableNode node = new com.gorisse.thomas.sceneform.ux.TransformableNode(arFragment.getTransformationSystem());
                                                                                                        ^
9 errors

> Task :app:compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
> Run with --info option to get more log output.
> Run with --scan to get full insights.

BUILD FAILED in 5s
18 actionable tasks: 2 executed, 16 up-to-date

I am trying to build my Android project using Gradle with the command:

./gradlew build

However, I am encountering compilation errors related to Sceneform imports, specifically:

com.gorisse.thomas.sceneform.ArFragment
com.gorisse.thomas.sceneform.rendering.ModelRenderable
com.gorisse.thomas.sceneform.ux.TransformableNode

The error messages indicate that these classes cannot be found, suggesting that the dependencies are missing or not properly resolved.

Steps I have tried so far:

1. Checked Gradle dependencies:

dependencies {
    implementation 'com.gorisse.thomas.sceneform:sceneform:1.21.0'
}

2. Synced Gradle:

3. Checked package names:

4. Manually added dependencies:

Expected Behavior I expected the Gradle build to complete successfully, recognizing and resolving all Sceneform dependencies, so that I could proceed with running my AR app.

Actual Behavior The build fails with multiple "cannot find symbol" errors, indicating that the Sceneform classes are not recognized.

Upvotes: 0

Views: 46

Answers (1)

Martin Zeitler
Martin Zeitler

Reputation: 76799

That's an obsolete library, therefore not worth fixing ~> migrate to SceneView.

repositories {
    maven("https://jitpack.io")
}

dependencies {
    implementation("io.github.sceneview:sceneview:2.2.1")
}

Upvotes: 0

Related Questions