Google Cloud Endpoint package myApi does not exist - Android Studio

一个人想着一个人 提交于 2019-12-11 09:59:16

问题


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:

Error:(8, 56) error: package com.example.adamzarn.myapplication.backend.myApi does not exist

However, it does exist:

Why am I getting this error?


回答1:


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')
}

This ensures your module can see the backend module.

See https://github.com/GoogleCloudPlatform/gradle-appengine-plugin.



来源:https://stackoverflow.com/questions/46183669/google-cloud-endpoint-package-myapi-does-not-exist-android-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!