AndroidStudio报错default activity not found的问题

今天又一次出现了default activity not found的问题,原因是为了APP能在触屏电视上使用,将清单文件中的android:screenOrientation="portrait"设置为unspecified,既可以竖屏也可以横屏,但是后来改回去的时候将所有的unspecified改为portrait,忽略了极光认证

<!-- Required -->
<activity
    android:name="com.cmic.sso.sdk.activity.LoginAuthActivity"
    android:configChanges="orientation|keyboardHidden|screenSize"
    android:launchMode="singleTop"
    android:screenOrientation="unspecified"
    android:theme="@style/ActivityDialogStyle" />
<!-- Required -->
<activity
    android:name="cn.jiguang.verifysdk.CtLoginActivity"
    android:configChanges="orientation|keyboardHidden|screenSize"
    android:launchMode="singleTop"
    android:screenOrientation="unspecified"
    android:theme="@style/ActivityDialogStyle" />

这两个在极光SDK中屏幕方向就是设置为unspecified.

解决办法:使用命令行:gradlew processDebugManifest --stacktrace

这里必须在本项目路径下,在别的文件路径下报:'gradlew' 不是内部或外部命令,也不是可运行的程序或批处理文件。

使用命令行之后提示信息如下:

> Task :app:processDebugManifest FAILED
D:\jiaNongZhengHe\NewApp\PttLearn\app\src\main\AndroidManifest.xml:147:13-49 Error:
        Attribute activity#com.cmic.sso.sdk.activity.LoginAuthActivity@screenOrientation value=(portrait) from AndroidManifest.xml:147:13-49
        is also present at [cn.jiguang.sdk:jverification:2.7.3] AndroidManifest.xml:38:13-52 value=(unspecified).
        Suggestion: add 'tools:replace="android:screenOrientation"' to <activity> element at AndroidManifest.xml:143:9-148:58 to override.
D:\jiaNongZhengHe\NewApp\PttLearn\app\src\main\AndroidManifest.xml:154:13-49 Error:
        Attribute activity#cn.jiguang.verifysdk.CtLoginActivity@screenOrientation value=(portrait) from AndroidManifest.xml:154:13-49
        is also present at [cn.jiguang.sdk:jverification:2.7.3] AndroidManifest.xml:47:13-52 value=(unspecified).
        Suggestion: add 'tools:replace="android:screenOrientation"' to <activity> element at AndroidManifest.xml:150:9-155:58 to override.
 

可以将android:screenOrientation改为unspecified,或者加一行tools:replace="android:screenOrientation即可解决问题。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值