android / android/codelab-mlkit-android

Can't get the Vision final or starter code to build

Open
#66 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
186
Forks
104
PR merge metrics
No merged PRs in 30d

Description

Android Studio Version: Android Studio Giraffe | 2022.3.1 Patch 1
OS: Mac OS Ventura 13.5.1

I'm quite new to Android dev, so I genuinely don't know what's going on here.

I haven't changed anything after downloading the code and opening it in Android Studio, but I keep getting these errors in the starter code:
`Cannot resolve constructor 'ArrayAdapter(MainActivity, int, String[])'`
`Cannot resolve method 'getApplicationContext' in 'MainActivity'`
`Cannot resolve method 'getAssets' in 'MainActivity'`

for lines
107 `ArrayAdapter adapter = new ArrayAdapter<>(this, simple_spinner_dropdown_item, items);`
129 `Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT).show();`
216 `AssetManager assetManager = context.getAssets();`

In the final code, I'm getting build errors for Gradle.
> Task :app:checkDebugManifest FAILED
> Task :app:createDebugCompatibleScreenManifests FAILED
> Task :app:compileDebugShaders FAILED
> Task :app:signingConfigWriterDebug FAILED
> Task :app:transformNativeLibsWithMergeJniLibsForDebug FAILED

Contributor guide

Open the contributing guide

Research direction

Reproduce the problem by opening the starter and final code in Android Studio Giraffe on macOS Ventura. Inspect MainActivity at lines 107, 129, and 216, then review the reported Gradle task failures and their full output. Done means the starter code's reported errors and the final code's listed build failures are resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
build-system, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.