0

我正在遵循本指南。

https://developer.android.com/google/play/billing/integrate

我的 build.gradle 看起来像这样:

依赖{

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "com.android.support:appcompat-v7:28.0.0"
implementation "androidx.constraintlayout:constraintlayout:2.0.4"
implementation "com.google.android.gms:play-services-ads:19.6.0"
implementation "com.android.billingclient:billing:3.0.0"

androidTestImplementation "com.android.support.test:runner:1.0.2"
androidTestImplementation "com.android.support.test.espresso:espresso-core:3.0.2"

}

Android Studios 4 中的 Java 代码没有针对 BillingClient 的推荐导入

如果我尝试这个:import android.billingclient ...“billingclient”显示为红色/无法识别。

如果我尝试这个:import androidx.billingclient ...“billingclient”显示为红色/无法识别。

如果我尝试这个:import import com.android.billingclient ...“android”显示为红色/无法识别。

我正在尝试将游戏移植到 Android。我已经坚持了好几天了。任何帮助是极大的赞赏!!!

请帮忙!!谢谢!!

4

1 回答 1

0

好的,我已经想通了。几天后。

只是“文件>使用 Gradle 文件同步项目”

我不确定为什么我不需要为添加到 gradle 的其他语句执行此操作。

于 2020-12-15T00:23:10.940 回答