DJI dependencies cannot be resolved.
已完成I am writing a Mobile SDK application using Android Studio (Koala).
I have the dependencies for the dji-sdk in the Project Structure -> Dependencies tab and they appear as expected in the all dependencies list.
I also have them added in the build.gradle.kts (app) file.
// DJI SDK
implementation(libs.dji.sdk)
kapt(libs.dji.sdk)
However, when trying to import the namespaces in the main activity, the DJI SDK references will not resolve.
import com.dji.sdk.camera.Camera
import com.dji.sdk.sdkmanager.DJISDKManager
Both indicate that sdk cannot be found.
I've tried to explore the DJI root of the namespace but there is nothing there.
The results of the build are as follows:
Executing tasks: [:app:assembleDebug] in project c:\Temp\TestApp
Duplicate entry for alias 'dji.sdk': dependency {group='com.dji', name='dji-sdk', version='4.17'} is replaced with org.gradle.internal.lazy.UnsafeLazy@55a474c2
> Configure project :
Build was configured to prefer settings repositories over project repositories but repository 'Google' was added by build file 'build.gradle.kts'
Build was configured to prefer settings repositories over project repositories but repository 'MavenRepo' was added by build file 'build.gradle.kts'
> Configure project :app
Build was configured to prefer settings repositories over project repositories but repository 'Google' was added by build file 'app\build.gradle.kts'
Build was configured to prefer settings repositories over project repositories but repository 'MavenRepo' was added by build file 'app\build.gradle.kts'
> Task :app:preBuild UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
> Task :app:checkDebugAarMetadata UP-TO-DATE
> Task :app:generateDebugResValues UP-TO-DATE
> Task :app:mapDebugSourceSetPaths UP-TO-DATE
> Task :app:generateDebugResources UP-TO-DATE
> Task :app:packageDebugResources
> Task :app:parseDebugLocalResources UP-TO-DATE
> Task :app:createDebugCompatibleScreenManifests
> Task :app:extractDeepLinksDebug UP-TO-DATE
> Task :app:processDebugMainManifest
> Task :app:processDebugManifest
> Task :app:javaPreCompileDebug UP-TO-DATE
> Task :app:mergeDebugShaders UP-TO-DATE
> Task :app:compileDebugShaders NO-SOURCE
> Task :app:generateDebugAssets UP-TO-DATE
> Task :app:mergeDebugAssets UP-TO-DATE
> Task :app:compressDebugAssets UP-TO-DATE
> Task :app:mergeDebugResources
> Task :app:checkDebugDuplicateClasses UP-TO-DATE
> Task :app:desugarDebugFileDependencies
> Task :app:mergeDebugStartupProfile UP-TO-DATE
> Task :app:mergeDebugJniLibFolders UP-TO-DATE
> Task :app:mergeLibDexDebug
> Task :app:mergeDebugNativeLibs UP-TO-DATE
> Task :app:stripDebugDebugSymbols UP-TO-DATE
> Task :app:validateSigningDebug UP-TO-DATE
> Task :app:writeDebugAppMetadata UP-TO-DATE
> Task :app:writeDebugSigningConfigVersions
> Task :app:processDebugManifestForPackage
> Task :app:mergeExtDexDebug
warn: removing resource com.tims.drivingtrack:dimen/offline_map_header_bar_title_size without required default value.
warn: removing resource com.tims.drivingtrack:dimen/offline_map_manager_title_size without required default value.
> Task :app:processDebugResources
> Task :app:kaptGenerateStubsDebugKotlin UP-TO-DATE
> Task :app:kaptDebugKotlin UP-TO-DATE
> Task :app:compileDebugKotlin FAILED
e: file:///c:\Temp\TestApp/app/src/main/java/com/tims/drivingtrack/MainActivity.kt:19:16 Unresolved reference: sdk
e: file:///c:\Temp\TestApp/app/src/main/java/com/tims/drivingtrack/MainActivity.kt:20:16 Unresolved reference: sdk
e: file:///c:\Temp\TestApp/app/src/main/java/com/tims/drivingtrack/MainActivity.kt:21:16 Unresolved reference: sdk
e: file:///c:\Temp\TestApp/app/src/main/java/com/tims/drivingtrack/MainActivity.kt:22:12 Unresolved reference: example
e: file:///c:\Temp\TestApp/app/src/main/java/com/tims/drivingtrack/MainActivity.kt:30:13 Unresolved reference: DJIAppTheme
e: file:///c:\Temp\TestApp/app/src/main/java/com/tims/drivingtrack/MainActivity.kt:31:17 @Composable invocations can only happen from the context of a @Composable function
e: file:///c:\Temp\TestApp/app/src/main/java/com/tims/drivingtrack/MainActivity.kt:31:82 @Composable invocations can only happen from the context of a @Composable function
e: file:///c:\Temp\TestApp/app/src/main/java/com/tims/drivingtrack/MainActivity.kt:41:30 Unresolved reference: LocalContext
e: file:///c:\Temp\TestApp/app/src/main/java/com/tims/drivingtrack/MainActivity.kt:72:17 Unresolved reference: Camera
e: file:///c:\Temp\TestApp/app/src/main/java/com/tims/drivingtrack/MainActivity.kt:72:27 Unresolved reference: DJISDKManager
e: file:///c:\Temp\TestApp/app/src/main/java/com/tims/drivingtrack/MainActivity.kt:78:17 Unresolved reference: Camera
e: file:///c:\Temp\TestApp/app/src/main/java/com/tims/drivingtrack/MainActivity.kt:78:27 Unresolved reference: DJISDKManager
e: file:///c:\Temp\TestApp/app/src/main/java/com/tims/drivingtrack/MainActivity.kt:97:5 Unresolved reference: DJIAppTheme
e: file:///c:\Temp\TestApp/app/src/main/java/com/tims/drivingtrack/MainActivity.kt:98:9 @Composable invocations can only happen from the context of a @Composable function
FAILURE: Build failed with an exception.
请先登录再写评论。
评论
1 条评论