Google Cloud Endpoint软件包myApi不存在-Android Studio [英] Google Cloud Endpoint package myApi does not exist - Android Studio
问题描述
我正在尝试将Google Cloud Endpoint添加到我的Android应用程序中.在我的EndpointAsyncTask
类中,我使用MyApi
像这样导入它:
I'm trying to add a Google Cloud Endpoint to my Android Application. In my EndpointAsyncTask
class I use MyApi
importing it like so:
import com.example.adamzarn.myapplication.backend.myApi.MyApi;
运行项目时出现此错误:
When I run my project I get this error:
错误:(8,56)错误:包装 com.example.adamzarn.myapplication.backend.myApi不存在
Error:(8, 56) error: package com.example.adamzarn.myapplication.backend.myApi does not exist
但是,它确实存在:
为什么会出现此错误?
推荐答案
检查EndpointAsyncTask
类所在模块中的build.gradle
文件.确保对backend
模块的依赖关系正确,并确保没有冲突或重复项.应该是这样的:
Check the build.gradle
file in the module where your EndpointAsyncTask
class is located. Make sure the dependency to your backend
module is correct, and ensure there are no conflicts or duplicates. It should be like this:
dependencies {
compile project(path: 'backend', configuration: 'android-endpoints')
}
这确保您的模块可以看到backend
模块.
This ensures your module can see the backend
module.
请参见 https://github.com/GoogleCloudPlatform/gradle-appengine-plugin.
这篇关于Google Cloud Endpoint软件包myApi不存在-Android Studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!