最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

dependencies - How clear the issue of gradlew build error in android studio - Stack Overflow

programmeradmin1浏览0评论
./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:

  • I verified that sceneform dependencies are included in build.gradle:
dependencies {
    implementation 'com.gorisse.thomas.sceneform:sceneform:1.21.0'
}
  • Also tried sceneform-ux and sceneform-assets but still getting the same error.

2. Synced Gradle:

  • Ran "Sync Project with Gradle Files" in Android Studio.
  • Tried ./gradlew clean and ./gradlew build again.

3. Checked package names:

  • Confirmed that my import statements match the correct package names from Sceneform.

4. Manually added dependencies:

  • I attempted to manually download the required dependencies and add them as .aar files, but the issue persists.

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.

./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:

  • I verified that sceneform dependencies are included in build.gradle:
dependencies {
    implementation 'com.gorisse.thomas.sceneform:sceneform:1.21.0'
}
  • Also tried sceneform-ux and sceneform-assets but still getting the same error.

2. Synced Gradle:

  • Ran "Sync Project with Gradle Files" in Android Studio.
  • Tried ./gradlew clean and ./gradlew build again.

3. Checked package names:

  • Confirmed that my import statements match the correct package names from Sceneform.

4. Manually added dependencies:

  • I attempted to manually download the required dependencies and add them as .aar files, but the issue persists.

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.

Share Improve this question edited Feb 10 at 19:35 Martin Zeitler 76.8k20 gold badges165 silver badges237 bronze badges asked Feb 10 at 17:13 Anandhanarayan KAnandhanarayan K 1
Add a comment  | 

1 Answer 1

Reset to default 0

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")
}
发布评论

评论列表(0)

  1. 暂无评论