Kivy 和 Google Play 服务

2023-03-21移动开发问题
6

本文介绍了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 服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

Cocos2d - 如何检查不同层中对象之间的交集
Cocos2d - How to check for Intersection between objects in different layers(Cocos2d - 如何检查不同层中对象之间的交集)...
2024-08-12 移动开发问题
8

突出显示朗读文本(在 iPhone 的故事书类型应用程序中)
Highlight Read-Along Text (in a storybook type app for iPhone)(突出显示朗读文本(在 iPhone 的故事书类型应用程序中))...
2024-08-12 移动开发问题
9

游戏中心 facebook 喜欢
Game center facebook like(游戏中心 facebook 喜欢)...
2024-08-12 移动开发问题
3

cocos2D iPhone中的UItextfield文本对齐问题
UItextfield text alignment issue in cocos2D iPhone(cocos2D iPhone中的UItextfield文本对齐问题)...
2024-08-12 移动开发问题
7

如何在 cocos2d 环境之外实现 cocos2d 游戏的虚拟摇杆?
How can I implement a virtual joystick for a cocos2d game outside the cocos2d environment?(如何在 cocos2d 环境之外实现 cocos2d 游戏的虚拟摇杆?)...
2024-08-12 移动开发问题
13

收到消息“警告:在正常情况下,_fillInQueueWithExtraSpace:.."和 MPMovieP
Got the message quot;WARNING: under normal conditions, _fillInQueueWithExtraSpace:..quot; and MPMoviePlayer rotation not work in iPad IOS 5.1(收到消息“警告:在正常情况下,_fillInQueueWithExtraSpace:..和 MPMoviePlayer 旋转在 iPad IOS 5.1 中...
2024-08-12 移动开发问题
6