Kivy and Google Play services(Kivy 和 Google Play 服务)
问题描述
我正在尝试使用此 示例
我不知道它是否会起作用.我在SDK中下载了Google Play服务,但我不知道我必须将它粘贴到哪里,我尝试了很多地方,但都不成功,总是得到
I have no idea if its going to work. I downloaded Google Play services in SDK, but I have no clue where I have to stick it into, I tried many places, but unsuccessfully, always get
error: package com.google.android.gms.ads.AdView does not exist
以及其他软件包.我为我对 android sdk 的无知而道歉,但我正在努力更好地理解它,所以我需要一些帮助.我需要知道我必须把google-play-services_lib"放在哪里,这样它才能找到它.谢谢!
and other packages as well. I apologize for my ignorance of android sdk, but I'm trying to understand it better, so I need some help. I need to know where I have to put 'google-play-services_lib' so it would find it. Thanks!
解决它,将其添加到buildozer.spec":
solved it, adding this to 'buildozer.spec':
# (list) Android library project to add (will be added in the
# project.properties automatically.)
android.library_references = libs/google-play-services_lib
但还是报错:
.../android-sdk-21/tools/ant/build.xml:539: Unable to resolve project target 'android-9'
这是这一行:
<gettarget
androidJarFileOut="project.target.android.jar"
androidAidlFileOut="project.target.framework.aidl"
bootClassPathOut="project.target.class.path"
targetApiOut="project.target.apilevel"
minSdkVersionOut="project.minSdkVersion" /> # line 539!!!
推荐答案
这也解决了,抱歉我在这里弄得一团糟,问和回答我自己的问题,但我认为这对 Kivy 用户来说是一个重要的话题,网上也没有太多关于这个的.所以,解决方案:我在google-play-services_lib"内的ant.properties"文件中手动将项目目标"设置为android-14".它抛出错误,因为 google play 服务库是针对较新的 android api 的.
And that solved as well, sorry for the mess I've made here, asking and answering my own questions, but I think it's an important topic for Kivy users, and there's not much about this on the net. So, solution: I manually set project 'target' to 'android-14' in 'ant.properties' file inside 'google-play-services_lib'. It was throwing error because the google play services library was for newer android api.
无论如何,对于任何好奇这是否有效(在 Android 的 Kivy 应用程序中实现广告)的人,是的,它有效,但我不得不重写原始解决方案以支持新库(使用 本指南)
Anyway, for anyone curious if that worked (implementing ads into Kivy app for Android), YES it worked, I had to rewrite the original solution to support new library though (using this guide)
这篇关于Kivy 和 Google Play 服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Kivy 和 Google Play 服务
基础教程推荐
- 如何在 iPhone 上显示来自 API 的 HTML 文本? 2022-01-01
- Kivy Buildozer 无法构建 apk,命令失败:./distribute.sh -m “kivy"d 2022-01-01
- 当从同一个组件调用时,两个 IBAction 触发的顺序是什么? 2022-01-01
- Android:对话框关闭而不调用关闭 2022-01-01
- 如何在没有IB的情况下将2个按钮添加到右侧的UINavigationbar? 2022-01-01
- 在 gmail 中为 ios 应用程序检索朋友的朋友 2022-01-01
- 如何让对象对 Cocos2D 中的触摸做出反应? 2022-01-01
- android 应用程序已发布,但在 google play 中找不到 2022-01-01
- 如何在 UIImageView 中异步加载图像? 2022-01-01
- UIWebView 委托方法 shouldStartLoadWithRequest:在 WKWebView 中等效? 2022-01-01