java Android 应用未在其他设备上运行

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/43020529/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-03 07:01:16  来源:igfitidea点击:

Android app is not running on other device

javaandroidxmlemulation

提问by stodgy.nerd

i just made a simple android app with 6 buttons. Each button on click opens a new activity. I installed the app on my device via USB cable from Android studioand it runs fine on my device.

我刚刚制作了一个带有 6 个按钮的简单 android 应用程序。单击每个按钮都会打开一个新活动。我通过 USB 电缆在我的设备上安装了该应用程序Android studio,它在我的设备上运行良好。

But here rises the problem, when I installed the app on my friends device after sharing via SHAREitthe app installed on his device but did not run.

但是这里出现了问题,当我通过SHAREit他的设备上安装的应用程序分享但没有运行后,我在我朋友的设备上安装了该应用程序。

What could be the reason for this? And how can I solve this?

这可能是什么原因?我该如何解决这个问题?

Please help. Thank you

请帮忙。谢谢

回答by Johannes Gnadlinger

You dont need to create a signed APK if you only want to test it on your friends device and not to run it in a production progress. Android Studio creates an apk automatically which is signed for 365 days. Just open your project in your explorer and go to [ProjectName]\app\build\outputs\apkand select the app-debug.apk.

如果您只想在朋友的设备上测试它而不是在生产进度中运行它,则不需要创建签名的 APK。Android Studio 会自动创建一个签名为 365 天的 apk。只需在您的资源管理器中打开您的项目并转到[ProjectName]\app\build\outputs\apk并选择app-debug.apk

回答by Bhuvan Arora

Make sure instance run in android studio is disabled.

确保在 android studio 中运行的实例被禁用。

Because if Instance run is enabled when you debug the app on real device through usb debugging it will work properly . but if u share the apk from your device to other device it will not work. It might show an error . App Name Unfortunately Stoped.

因为如果在真机上通过usb调试调试应用程序时启用了Instance run,它会正常工作。但如果您将 apk 从您的设备共享到其他设备,它将无法正常工作。它可能会显示错误。应用名称不幸停止。

If Instance run is enable. you must disable the instance run first. If you don't know how to disable it just google it. After disable the instance run, you must clean project and Build new apk. It will work on all the other devices without generating signed apk.

如果启用实例运行。您必须先禁用实例运行。如果你不知道如何禁用它,只需谷歌一下。禁用实例运行后,您必须清理项目并构建新的 apk。它可以在所有其他设备上运行,而无需生成签名的 apk。

Hope it may help you.

希望它可以帮助你。

回答by amol

Here is the link, where you will find your solution. https://developer.android.com/studio/publish/check the point 'publish your app', In left column.

这是链接,您将在其中找到您的解决方案。https://developer.android.com/studio/publish/检查左栏中的“发布您的应用程序”点。

回答by Harsh Massand

I have a solution for you:

我有一个解决方案给你:

  1. Install Bluestacks Android Emulator.
  2. Go to Tools, Android and click on Enable Adb Integration to disable it.
  3. In android studios one Android Device for Bluestacks will appear while installation.
  4. Share the installed app through shareit.
  5. It will work on other device.
  1. 安装 Bluestacks Android 模拟器。
  2. 转到“工具”、“Android”并单击“启用 Adb 集成”以禁用它。
  3. 在 android studios 中,安装时会出现一个用于 Bluestacks 的 Android 设备。
  4. 通过 shareit 共享已安装的应用程序。
  5. 它将在其他设备上工作。

Hope it helps

希望能帮助到你

回答by vikram singh

While building the app what MinSDK version you defined? Do both devices satisfy that criteria?

在构建应用程序时,您定义了什么 MinSDK 版本?两种设备都满足该标准吗?

If you suspect that installing through sharing app is a problem then try attaching your friend device to your laptop and try running the app. Or Send the apk through email and let your friend download the apk and install the apk through apkInstaller app.

如果您怀疑通过共享应用程序安装有问题,请尝试将您的朋友设备连接到您的笔记本电脑并尝试运行该应用程序。或通过电子邮件发送 apk,让您的朋友下载 apk 并通过 apkInstaller 应用程序安装 apk。