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

问题描述

我使用 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 }

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)