无法解析x导入

问题描述 投票:0回答:1

我正在(使用:api'com.squareup.wire:wire-runtime:3.0.2']

Execution failed for task ':app:generateProtos'.
unable to resolve 1 imports: testing/tastes/tastes.proto
searching 0 proto paths:

我的理解是,我不需要在gradle中定义任何内容来寻找进口商品?

但是当它说searching 0 proto paths时,我感到奇怪。...

我的毕业证书是:

wire { kotlin { android = true } }

文件结构是

      -> proto
           -> testing
                -> people
                     -> person.proto
                -> tastes
                     -> tastes.proto

我在person.proto中的导入行是:import "testing/tastes/tastes.proto";

syntax = "proto2";
package testing.people;
option java_package = "com.testing.people";

import "testing/tastes/tastes.proto";

message WirePerson {

    optional string name = 1;
    repeated string picture_urls = 2;
    optional testing.tastes.WirePersonTaste period = 5;
}
syntax = "proto2";
package testing.tastes;
option java_package = "com.testing.tastes";

message WirePersonTaste {
    optional string taste = 1;
    repeated string picture_urls = 2;
}

我将非常感谢您的协助:)

square-wire
1个回答
0
投票

请确保原型位于src/main/proto中。否则,插件将无法检测到它。如果存在问题,可以在kotlin {}配置中将路径指定为选项。

© www.soinside.com 2019 - 2024. All rights reserved.