为啥 buildozer 显示 Error: Activity class org.test.myapp/org.renpy.android.PythonActivity 不存在

Posted

技术标签:

【中文标题】为啥 buildozer 显示 Error: Activity class org.test.myapp/org.renpy.android.PythonActivity 不存在【英文标题】:Why does buildozer show Error: Activity class org.test.myapp/org.renpy.android.PythonActivity does not exist为什么 buildozer 显示 Error: Activity class org.test.myapp/org.renpy.android.PythonActivity 不存在 【发布时间】:2018-02-05 00:02:10 【问题描述】:

我正在将 android 应用程序 - kivy-python, buildozer 安装到 Android Lollipop, 5.1.1,并遇到此错误

Starting: Intent  act=org.renpy.android.PythonActivity cmp=org.test.myapp/org.renpy.android.PythonActivity 
Error type 3
Error: Activity class org.test.myapp/org.renpy.android.PythonActivity does not exist.

有什么想法吗?

更多输出:

/private/lib/python2.7/xml/sax/xmlreader.py ...
[DEBUG]:   -> running ant debug
[DEBUG]:    Buildfile: /home/ivan/Downloads/kivy/.buildozer/android/platform/build/dists/myapp/build.xml
[DEBUG]:    
[DEBUG]:    -set-mode-check:
[DEBUG]:    
[DEBUG]:    -set-debug-files:
[DEBUG]:    
[DEBUG]:    -check-env:
[DEBUG]:     [checkenv] Android SDK Tools Revision 22.6.2
[DEBUG]:     [checkenv] Installed at /home/ivan/.buildozer/android/platform/android-sdk-20
[DEBUG]:    
[DEBUG]:    -setup:
[DEBUG]:         [echo] Project Name: MyApplication-0.1
[DEBUG]:      [gettype] Project Type: Application
[DEBUG]:    
[DEBUG]:    -set-debug-mode:
[DEBUG]:    
[DEBUG]:    -debug-obfuscation-check:
[DEBUG]:    
[DEBUG]:    -pre-build:
[DEBUG]:         [copy] Copying 24 files to /home/ivan/Downloads/kivy/.buildozer/android/platform/build/dists/myapp/tmp-src
[DEBUG]:    
[DEBUG]:    -build-setup:
[DEBUG]:    [getbuildtools] Using latest Build Tools: 19.1.0
[DEBUG]:         [echo] Resolving Build Target for MyApplication-0.1...
[DEBUG]:    [gettarget] Project Target:   Android 4.4.2
[DEBUG]:    [gettarget] API level:        19
[DEBUG]:         [echo] ----------
[DEBUG]:         [echo] Creating output directories if needed...
[DEBUG]:         [echo] ----------
[DEBUG]:         [echo] Resolving Dependencies for MyApplication-0.1...
[DEBUG]:    [dependency] Library dependencies:
[DEBUG]:    [dependency] No Libraries
[DEBUG]:    [dependency]
[DEBUG]:    [dependency] ------------------
[DEBUG]:         [echo] ----------
[DEBUG]:         [echo] Building Libraries with 'debug'...
[DEBUG]:       [subant] No sub-builds to iterate on
[DEBUG]:    
[DEBUG]:    -code-gen:
[DEBUG]:    [mergemanifest] Found modified input file
[DEBUG]:    [mergemanifest] Merging AndroidManifest files into one.
[DEBUG]:    [mergemanifest] Manifest merger disabled. Using project manifest only.
[DEBUG]:         [echo] Handling aidl files...
[DEBUG]:         [aidl] No AIDL files to compile.
[DEBUG]:         [echo] ----------
[DEBUG]:         [echo] Handling RenderScript files...
[DEBUG]:         [echo] ----------
[DEBUG]:         [echo] Handling Resources...
[DEBUG]:         [aapt] Found modified input file
[DEBUG]:         [aapt] Generating resource IDs...
[DEBUG]:         [aapt]     (skipping file '.gitkeep' due to ANDROID_AAPT_IGNORE pattern '.*')
[DEBUG]:         [echo] ----------
[DEBUG]:         [echo] Handling BuildConfig class...
[DEBUG]:    [buildconfig] No need to generate new BuildConfig.
[DEBUG]:    
[DEBUG]:    -pre-compile:
[DEBUG]:    
[DEBUG]:    -compile:
[DEBUG]:        [javac] Compiling 25 source files to /home/ivan/Downloads/kivy/.buildozer/android/platform/build/dists/myapp/bin/classes
[DEBUG]:        [javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
[DEBUG]:        [javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
[DEBUG]:        [javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
[DEBUG]:        [javac] Note: Some input files use or override a deprecated API.
[DEBUG]:        [javac] Note: Recompile with -Xlint:deprecation for details.
[DEBUG]:        [javac] 3 warnings
[DEBUG]:    
[DEBUG]:    -post-compile:
[DEBUG]:    
[DEBUG]:    -obfuscate:
[DEBUG]:    
[DEBUG]:    -dex:
[DEBUG]:          [dex] input: /home/ivan/Downloads/kivy/.buildozer/android/platform/build/dists/myapp/bin/classes
[DEBUG]:          [dex] Found modified input file
[DEBUG]:          [dex] Converting compiled files and external libraries into /home/ivan/Downloads/kivy/.buildozer/android/platform/build/dists/myapp/bin/classes.dex...
[DEBUG]:    
[DEBUG]:    -crunch:
[DEBUG]:       [crunch] Crunching PNG Files in source dir: /home/ivan/Downloads/kivy/.buildozer/android/platform/build/dists/myapp/res
[DEBUG]:       [crunch] To destination dir: /home/ivan/Downloads/kivy/.buildozer/android/platform/build/dists/myapp/bin/res
[DEBUG]:       [crunch] Processing image to cache: /home/ivan/Downloads/kivy/.buildozer/android/platform/build/dists/myapp/res/drawable/icon.png => /home/ivan/Downloads/kivy/.buildozer/android/platform/build/dists/myapp/bin/res/drawable/icon.png
[DEBUG]:       [crunch]   (processed image to cache entry /home/ivan/Downloads/kivy/.buildozer/android/platform/build/dists/myapp/bin/res/drawable/icon.png: 49% size of source)
[DEBUG]:       [crunch] Crunched 1 PNG files to update cache
[DEBUG]:    
[DEBUG]:    -package-resources:
[DEBUG]:         [aapt] Found modified input file
[DEBUG]:         [aapt] Creating full resource package...
[DEBUG]:         [aapt]     (skipping file '.gitkeep' due to ANDROID_AAPT_IGNORE pattern '.*')
[DEBUG]:    
[DEBUG]:    -package:
[DEBUG]:    [apkbuilder] Found modified input file
[DEBUG]:    [apkbuilder] Creating MyApplication-0.1-debug-unaligned.apk and signing it with a debug key...
[DEBUG]:    
[DEBUG]:    -post-package:
[DEBUG]:    
[DEBUG]:    -do-debug:
[DEBUG]:     [zipalign] Running zip align on final apk...
[DEBUG]:         [echo] Debug Package: /home/ivan/Downloads/kivy/.buildozer/android/platform/build/dists/myapp/bin/MyApplication-0.1-debug.apk
[DEBUG]:    [propertyfile] Updating property file: /home/ivan/Downloads/kivy/.buildozer/android/platform/build/dists/myapp/bin/build.prop
[DEBUG]:    [propertyfile] Updating property file: /home/ivan/Downloads/kivy/.buildozer/android/platform/build/dists/myapp/bin/build.prop
[DEBUG]:    [propertyfile] Updating property file: /home/ivan/Downloads/kivy/.buildozer/android/platform/build/dists/myapp/bin/build.prop
[DEBUG]:    [propertyfile] Updating property file: /home/ivan/Downloads/kivy/.buildozer/android/platform/build/dists/myapp/bin/build.prop
[DEBUG]:    
[DEBUG]:    -post-build:
[DEBUG]:       [delete] Deleting directory /home/ivan/Downloads/kivy/.buildozer/android/platform/build/dists/myapp/tmp-src
[DEBUG]:    
[DEBUG]:    debug:
[DEBUG]:    
[DEBUG]:    BUILD SUCCESSFUL
[DEBUG]:    Total time: 3 seconds
[INFO]:    <- directory context /home/ivan/Downloads/kivy/.buildozer/android/platform/python-for-android-master
[INFO]:    # Copying APK to current directory
[INFO]:    # Found APK file: /home/ivan/Downloads/kivy/.buildozer/android/platform/build/dists/myapp/bin/MyApplication-0.1-debug.apk
[DEBUG]:   -> running cp /home/ivan/Downloads/kivy/.buildozer/android/platform/build/dists/myapp/bin/MyApplication-0.1-debug.apk ./
# Android packaging done!
# APK MyApplication-0.1-debug.apk available in the bin directory
# Run '/home/ivan/.buildozer/android/platform/android-sdk-20/platform-tools/adb devices'
# Cwd None
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached 
7a1cceac    device

# Deploy on 7a1cceac
# Run '/home/ivan/.buildozer/android/platform/android-sdk-20/platform-tools/adb install -r "/home/ivan/Downloads/kivy/bin/MyApplication-0.1-debug.apk"'
# Cwd /home/ivan/.buildozer/android/platform
3901 KB/s (7489264 bytes in 1.874s)
    pkg: /data/local/tmp/MyApplication-0.1-debug.apk
Success
# Application pushed.
# Run on 7a1cceac
# Run '/home/ivan/.buildozer/android/platform/android-sdk-20/platform-tools/adb shell am start -n org.test.myapp/org.renpy.android.PythonActivity -a org.renpy.android.PythonActivity'
# Cwd /home/ivan/.buildozer/android/platform
Starting: Intent  act=org.renpy.android.PythonActivity cmp=org.test.myapp/org.renpy.android.PythonActivity 
Error type 3
Error: Activity class org.test.myapp/org.renpy.android.PythonActivity does not exist.
# Application started.

【问题讨论】:

嗯,它存在吗?我们需要更多的上下文 @cricket_007 我添加了更多输出。或者你需要我的代码吗? 发布完整日志,包括您运行的命令。 【参考方案1】:

我也有同样的问题 我解决了它

替换

org.renpy.android.PythonActivity

org.kivy.android.PythonActivity

【讨论】:

以上是关于为啥 buildozer 显示 Error: Activity class org.test.myapp/org.renpy.android.PythonActivity 不存在的主要内容,如果未能解决你的问题,请参考以下文章

Cython not found.. Please install it error in buildozer

Kivy Apk build with buildozer error: # Java compiler (javac) not found, please install it

尝试使用 kivy 制作的 buildozer 打包简单的计算器应用程序时出现错误“adb:安装失败”

由 buildozer 构建的 Kivy apk 在显示预启动屏幕后很快崩溃

Buildozer 构建失败:找不到 CC 的可执行文件

如何使用 buildozer 将可以显示图像的 pygame 转换为 apk