实施许可证验证库后,我的应用程序开始崩溃

时间:2021-01-16 15:50:39

标签: android kotlin android-lvl

我使用 this 答案来设置我的许可证验证库。为了编译我的应用程序而没有错误,我需要添加

import random

def tosscoin():
    numbers = int(input("Times to flip coin: "))
    recordList = []
    heads = 0
    tails = 0
    for n in range(numbers):
        flip = random.randint(0, 1)
        if flip == 0 :
            heads += 1
            recordList.append("Heads") 
            print("Heads",heads)
        else:
            tails += 1
            recordList.append("Tails")
            print("Tails",tails)
        #print(recordList) #uncomment this if you want to print the list in each iteration
    return recordList

print(tosscoin())

在库的 build.gradle 中。但是,当我启动我的应用程序时,它会立即崩溃,即使我删除了 android { useLibrary 'org.apache.http.legacy' } 。使用调试器,我可以到达 abort() 行。也许其他人用 Kotlin 尝试过?我该如何解决这个问题?

编辑:

我注意到我在答案的第 24 步出现错误:checker.checkAccess(licenseCheckerCallback)。但是我不知道如何在 Kotlin 中解决它。

我的红色堆栈跟踪是:

Service Intent must be explicit: Intent { act=com.android.vending.licensing.ILicensingService }

0 个答案:

没有答案
相关问题