我最近升级了Android Studio到2.1版本,并将我正在工作的项目更新到Gradle版本2.1.0。
我注释掉了我的代码中一个与自动生成的App Indexing代码无关的行,现在,每当我尝试运行我的应用程序时,它就会崩溃并给出以下错误:
java.lang.RuntimeException: Unable to start activity ComponentInfo{lux.unisabana.sabanaviveenti/sabanaviveenti.unisabana.lux.unisabana.appsabana.MainActivity}: java.lang.IllegalArgumentException: AppIndex: The android-app URI host must match the package name and follow the format android-app://<package_name>/<scheme>/[host_path]. Provided URI: android-app://sabanaviveenti.unisabana.lux.unisabana.appsabana/http/host/path
我已经四处寻找并尝试了很多方法,更新目标版本、所需库等等,但迄今为止仍然没有解决,有人可以帮助我吗?
我用于编译的SDK版本是23,使用的Google服务依赖项是8.4.0。
Action viewAction = Action.newAction( Action.TYPE_VIEW, "主页", // TODO: 如果您有与此应用程序活动内容匹配的网页内容, // 请确保此自动生成的网页URL正确。 // 否则,将URL设置为null。 Uri.parse("http://host/path"), // TODO: 确保此自动生成的应用程序URL正确。 Uri.parse("android-app://sabanaviveenti.unisabana.lux.unisabana.appsabana/http/host/path") ); AppIndex.AppIndexApi.start(client2, viewAction);
- Jpfcan