在安卓的AndroidManifest.xml清单中,添加一下代码
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"
package="com.wt.yisuji_tablet">
<!-- io.dcloud.nativeresouce -->  
 <application  
             android:allowBackup="true"    
             android:allowClearUserData="true"    
             android:icon="@drawable/icon"    
             android:label="@string/app_name"    
             android:largeHeap="true"    
             android:supportsRtl="true">  
             <activity  android:exported="true"  
                     android:name="io.dcloud.PandoraEntry"    
                     android:configChanges="orientation|keyboardHidden|keyboard|navigation"    
                     android:label="@string/app_name"    
                     android:launchMode="singleTop"    
                     android:hardwareAccelerated="true"    
                     android:theme="@style/TranslucentTheme"    
                     android:screenOrientation="user"    
                     android:windowSoftInputMode="adjustResize" >    
                     <intent-filter>    
                             <action android:name="android.intent.action.MAIN" />    
                             <category android:name="android.intent.category.LAUNCHER" />    
                             <category android:name="android.intent.category.HOME" />    
                             <category android:name="android.intent.category.DEFAULT" />    
                     </intent-filter>    
             </activity>  
             <activity  android:exported="true"  
                     android:name="io.dcloud.PandoraEntryActivity"    
                     android:launchMode="singleTop"    
                     android:configChanges="orientation|keyboardHidden|screenSize|mcc|mnc|fontScale|keyboard|smallestScreenSize|screenLayout|screenSize|uiMode"    
                     android:hardwareAccelerated="true"    
                     android:permission="com.miui.securitycenter.permission.AppPermissionsEditor"    
                     android:screenOrientation="user"    
                     android:theme="@style/DCloudTheme"    
                     android:windowSoftInputMode="adjustResize">    
                     <intent-filter>    
                             <category android:name="android.intent.category.DEFAULT" />    
                             <category android:name="android.intent.category.BROWSABLE" />    
                             <action android:name="android.intent.action.VIEW" />    
                             <data android:scheme=" " />    
                     </intent-filter>    
             </activity>    
    </application>  </manifest>
设置主屏幕的代码主要是这一段:
<intent-filter>
                             <action android:name="android.intent.action.MAIN" />    
                             <category android:name="android.intent.category.LAUNCHER" />    
                             <category android:name="android.intent.category.HOME" />    
                             <category android:name="android.intent.category.DEFAULT" />    
                     </intent-filter>    添加之后,打包过来运行,是能设置成为主屏幕应用的, 但是打开就一直处于启动页面;
之后取消主屏幕设置,直接打开app,也一直处于启动页面,不能进入到app内
(从一开始不设置成主屏幕应用,是能正常打开app)  
现在不知道是什么问题导致的,是这清单的问题? 还是app里面的代码配置问题吗
有没有大佬给点见解或者解决办法。谢谢
 
             
             
             
			 
                                        
                                     
            
9 个回复
DCloud_Android_zl
测试添加之后可以启动,可以报一下有没有报错
1***@qq.com
1、首页打开没有设置主屏幕应用时,是否能打开软件
2、设置主屏幕应用之后,停留在启动页,那重启平板之后能否进入软件
1***@qq.com
res 目录下创建 ”layout" 然后在创建 “activity_splash.xml” 文件 内容:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#fff">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/push"
android:layout_centerInParent="true" />
</RelativeLayout>
然后打包运行
6***@qq.com - janson
要屏蔽返回,第一次启动要重启一下机子
6***@qq.com - janson
// 关闭程序启动界面
plus.navigator.closeSplashscreen();
5***@qq.com
相同的问题,请问你解决了吗
7***@qq.com - sing hip-hop
这个是不是放到POS上,要求将apk设置成桌面应用?
五彩斑斓大熊猫 - 丨接丨单丨
遇到同样问题,楼主解决了吗?
a***@163.com
肯定是new -- JSNWindow=_www/__uniappview.html 这个报错
官方没人去解决
2***@qq.com
怎么解决,我现在遇到这样的问题了,设置成主屏幕。重启手机打开就报错了。
2025-07-08 15:03
2***@qq.com
回复 2***@qq.com: 可以了,打包成apk就没啥问题了
2025-07-08 15:37