我正在使用Instant Apps for Android.I安装了所有正确的软件包并厌倦了创建具有Instant App支持的新应用程序(在创建新应用程序时选中Instant App框).问题是我总是遇到编译工具的问题.是否有其他人有这个问题,并能够找到任何解决方法.
我的环境:
错误:
Error: java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.internal.aapt.AaptException: AAPT2 compile failed:
aapt2 compile -o /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/res/merged/androidTest/debug /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml
Issues:
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:520 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:521 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:568 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:594 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:595 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:597 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:598 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:599 invalid dimen
 - ERROR: …android aapt android-studio android-gradle-plugin android-instant-apps
我现在面临一个问题超过 3 天,我无法解决。自从我开始在 Android 上使用 Kotlin 以来,我停止使用“annotationProcessor”并开始使用“kapt”,在我开始构建 Android 即时应用程序之前,所有事情都在 kapt 上运行良好,当我将“kapt”添加到任何依赖项(如 Glide)时或 ButterKnife Gradle 总是显示找不到方法 kapt() 的错误
Could not find method kapt() for arguments [com.github.bumptech.glide:compiler:4.7.1] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
这是我的项目 Gradle 文件
项目gradle文件
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    ext.kotlin_version = '1.2.71'
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module …android gradle kotlin android-gradle-plugin android-instant-apps
Google最近更新了有关即时应用的文档:准备应用
大多数要点都很清楚,除非 3.如有必要,请重新构建您的应用.
他们建议零售模块,如浏览,搜索,项目详细信息和结账.
问题:如何将应用程序拆分为功能齐全且URL可寻址的模块?
我在这里看到几个问题:
有人可以将光照进黑暗中吗?谢谢!
android android-build android-studio android-gradle-plugin android-instant-apps
我最近升级到了gradle-3.0.0-alpha8,之后在编译时没有解决一些样式.
发展环境:
错误信息:
Run Code Online (Sandbox Code Playgroud)Error:(94, 5) style attribute '@android:attr/windowExitAnimation' not found Error:(94, 5) style attribute '@android:attr/windowEnterAnimation' not found
在gradle.properties文件中设置android.enableAapt2 = false可以解决这个问题.
但是,Instant App需要android.enableAapt2 = true.我该怎么办?
我目前正在尝试使用InstantApps,并希望将dagger包含在我的项目中.
我在设置应用程序AppComponent时遇到了问题.我的应用程序组件包括我的应用程序的所有功能匕首模块.
我基本上有:
我想在添加Instant App模块之前弄清楚设置.
来自InstantApps文档和项目示例.似乎Application类需要在Base中.从Dagger文档,到设置匕首:
 DaggerYourAppComponent.create().inject(this);
应该包含在您的应用程序类中.但是,这似乎是不可能的,因为AppComponent需要引用所有功能匕首模块.
我的问题是:
谢谢
Crashlytics是否适用于Android Instant Apps,如果是这样,您如何正确设置项目?
每当我尝试将我的即时应用apks上传到Play商店时,都会出现以下错误:
但是,每当我执行https://developers.google.com/digital-asset-links/tools/generator时,它都会成功与我的应用和网站相关联.知道为什么我会收到这个错误吗?可能是什么原因导致的
提前感谢您的帮助.
我开发了一个即时应用程序并将其发布到游戏商店,还有一个与Instant App相关联的网站.从这里测试了测试工具的app链接 .
点击其他应用程序(gmail,环聊)中的链接后打开该应用程序,但是从谷歌搜索点击我的网站是打开网页而不是即时应用程序.为了将网页从Google搜索重定向到应用,我还有什么需要做的吗?
我在Play商店发布了我的即时应用程序.当我点击gmail的链接时,它会在某些设备中以即时应用程序的形式打开(三星s6 note,moto g4 plus)
在某些设备上,它不能作为即时应用程序打开,但buzzfeed.com/tasty作为即时应用程序打开.(一加3加一加5).
我的数字资产链接是https://abdcoop.mybuzztm.com/.well-known/assetlinks.json
谁能够建议我缺少什么?
android deep-linking android-app-indexing applinks android-instant-apps
我正在尝试通过NFC打开即时应用程序.
我的AndroidManifest.xml中有类似下面的内容
            <intent-filter android:autoVerify="true">
            <action android:name="android.intent.action.VIEW" />
            <action android:name="android.nfc.action.NDEF_DISCOVERED" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="https" />
            <data android:scheme="http" />
            <data android:host="example-refresh.herokuapp.com" />
        </intent-filter>
从链接转到https://example-refresh.herokuapp.com(显然是示例链接)时,单击即时应用正确加载.当从nfc标签打开该链接时,浏览器就会加载.我已经尝试过让nfc打开一个AAR(https://developer.android.com/guide/topics/connectivity/nfc/nfc.html#aar)这会导致当应用程序没有打开游戏商店链接时安装时,安装和应用程序正确打开nfc.如果我在nfc上有其他东西,所以它显示了消歧的选项,那么我可以为浏览器选项选择即时应用程序,但我希望它默认为即时应用程序.
是否有一些我缺少一个nfc标签来加载即时应用程序?我也试过使用分支,但没有运气.
我目前正在尝试了解Android即时应用程序.由于我没有任何支持它们的真实设备,我使用的是模拟器(来自Android Studio 3.0 Canary 9).我可以成功运行的"玩具"即时应用程序(像这样在我的模拟的Nexus 5X)(与Play商店),所以我相信我的开发环境配置是否正确.
但是,我很想知道第三方应用程序的发现过程,并了解用户体验是什么样的.由于缺乏合适的设备,我使用模拟的Chrome浏览器搜索启用了即时应用的网站(如Stack Exchange).但这些搜索只给我通常的网站(不是即时应用程序).
我非常感兴趣地阅读这篇文章,因为它似乎表明这应该有效.但是,这些答案似乎对我没有帮助.
API 24和API 26模拟设备(两者都包括Play商店)目前处于不同的状态,可能是因为我一直在尝试各种技巧来使其工作.(TLDR:没有什么对我有用.)
在API 24模拟设备上,如果我键入,adb shell pm list packages grep "com.google.android.instantapps.supervisor"那么它输出package:com.google.android.instantapps.supervisor为一个答案建议(但它仍然不起作用).
已Google Play services for Instant Apps (version 1.9-sdk-155682639)安装API 24设备.
API 24设备在屏幕顶部显示"闪电"通知,说"开发模式有效": URLs will be routed to Dev Manager in order to launch Instant Apps locally. Uninstall Dev Manager to disable Development Mode.
在API 24设备上,设置 - > Google - >即时应用,即时应用设置为true
在API 26模拟设备上,如果我输入adb …
android android-emulator android-instant-apps android-studio-3.0
android ×10
deep-linking ×2
aapt ×1
applinks ×1
branch.io ×1
crashlytics ×1
dagger-2 ×1
gradle ×1
gradle-3.0 ×1
kotlin ×1
nfc ×1