Google Cloud Endpoint软件包myApi不存在-Android Studio [英] Google Cloud Endpoint package myApi does not exist - Android Studio

查看:262
本文介绍了Google Cloud Endpoint软件包myApi不存在-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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆