今天又一次出现了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即可解决问题。