【问题标题】:"cannot combine custom titles with other title features" and "Source code does not match binarycode"“无法将自定义标题与其他标题功能结合”和“源代码与二进制代码不匹配”
【发布时间】:2016-10-07 07:57:20
【问题描述】:

我对标题中的异常有疑问。我有一个正在运行的应用程序,我想在其中包含蓝牙 GATT 配置文件。因此我至少需要 SDK 18,所以我在清单中对其进行了更改。现在我的应用程序每次启动时都会崩溃,抛出异常:“无法将自定义标题与其他标题功能结合起来”。我按照this解决方案删除了​​这一行

requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);

但现在我的应用程序只是崩溃而没有引发异常。当我使用调试模式查找崩溃的确切位置时,我看到吐司“源代码与二进制代码不匹配”。 我也试着把 android:windowNoTitle="false"这样的

<style name="Theme.PageIndicatorDefaults" parent="android:Theme">
    <item name="vpiIconPageIndicatorStyle">@style/Widget.IconPageIndicator</item>
    <item name="vpiTabPageIndicatorStyle">@style/Widget.TabPageIndicator</item>
    <item name="android:windowNoTitle">false</item>
</style>

在我的styles.xml中,但是这个

10/07 09:48:19: Launching app
$ adb push H:\Vibrotac_Android\app\build\outputs\apk\app-debug.apk /data/local/tmp/com.sensodrive.vibrotac
$ adb shell pm install -r "/data/local/tmp/com.sensodrive.vibrotac"
    pkg: /data/local/tmp/com.sensodrive.vibrotac
Success


$ adb shell am start -n "com.sensodrive.vibrotac/com.sensodrive.vibrotac.app.activity.VibroTacStartActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Client not ready yet..Waiting for process to come online
Connected to process 7629 on device motorola-xt1032-TA92910MK8
W/VibroTacIncidentManager: outputTextView is not set - nothing will be shown
D/VibroTacBluetoothCommunicationManager: Acquiring lock for requestStatusOfRemoteDeviceAndReportIncidents
D/VibroTacBluetoothCommunicationManager: Acquiring lock for requestStatusOfRemoteDeviceAndReportIncidents
D/VibroTacConfigurationDataManager: getConfigurationData: key=EXECUTION_RUNNING, value=null
D/VibroTacBluetoothCommunicationManager: Acquiring lock for requestStatusOfRemoteDeviceAndReportIncidents
D/VibroTacConfigurationDataManager: getConfigurationData: key=EXECUTION_RUNNING, value=null
W/VibroTacIncidentManager: outputTextView is not set - nothing will be shown
D/VibroTacBluetoothCommunicationManager: Acquiring lock for requestStatusOfRemoteDeviceAndReportIncidents
D/VibroTacConfigurationDataManager: getConfigurationData: key=EXECUTION_RUNNING, value=null
D/VibroTacBluetoothCommunicationManager: Acquiring lock for requestStatusOfRemoteDeviceAndReportIncidents
D/VibroTacConfigurationDataManager: getConfigurationData: key=EXECUTION_RUNNING, value=null
W/VibroTacIncidentManager: outputTextView is not set - nothing will be shown
D/VibroTacBluetoothCommunicationManager: Acquiring lock for requestStatusOfRemoteDeviceAndReportIncidents
D/VibroTacConfigurationDataManager: getConfigurationData: key=EXECUTION_RUNNING, value=null
D/VibroTacBluetoothCommunicationManager: Acquiring lock for requestStatusOfRemoteDeviceAndReportIncidents
D/VibroTacConfigurationDataManager: getConfigurationData: key=EXECUTION_RUNNING, value=null
W/VibroTacIncidentManager: outputTextView is not set - nothing will be shown
D/VibroTacBluetoothCommunicationManager: Acquiring lock for requestStatusOfRemoteDeviceAndReportIncidents
D/VibroTacConfigurationDataManager: getConfigurationData: key=EXECUTION_RUNNING, value=null
D/VibroTacBluetoothCommunicationManager: Acquiring lock for requestStatusOfRemoteDeviceAndReportIncidents
D/VibroTacConfigurationDataManager: getConfigurationData: key=EXECUTION_RUNNING, value=null
W/VibroTacIncidentManager: outputTextView is not set - nothing will be shown
D/VibroTacBluetoothCommunicationManager: Acquiring lock for requestStatusOfRemoteDeviceAndReportIncidents
D/VibroTacConfigurationDataManager: getConfigurationData: key=EXECUTION_RUNNING, value=null
D/VibroTacBluetoothCommunicationManager: Acquiring lock for requestStatusOfRemoteDeviceAndReportIncidents
D/VibroTacConfigurationDataManager: getConfigurationData: key=EXECUTION_RUNNING, value=null

会发生什么...应用程序在两者之间关闭,但我没有看到抛出异常。

我会在前一个帖子中作为评论提出要求,但我还不允许发表评论。 感谢您的帮助。

编辑: 在将 Android Studio 降级到 v2.1.3 并撤消所做的更改后,我现在得到了似乎抛出的随机异常。使用目标,编译和 minSDK18 我得到已知的cannot combine custom titles with other title features,使用 SDK14 程序告诉我

    H:\Vibrotac_Android\app\build\intermediates\manifests\full\debug\AndroidManifest.xml
Error:(64) No resource identifier found for attribute 'parentActivityName' in package 'android'
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\huebner\AppData\Local\Android\Sdk\build-tools\22.0.1\aapt.exe'' finished with non-zero exit value 1

在 debug\AndroidManifest 中(我以前从未见过)... 我不知道到底发生了什么,我慢慢能理解那些创建像this 这样的网站的人。

【问题讨论】:

    标签: android exception crash


    【解决方案1】:

    所以,在尝试了很多事情之后,我发现......这不是一个很好的答案,而是一个解决问题的方法。至少代码在运行……

    我使用 Android Studion v2.1.3 而不是 v2.2 将项目重置为上次运行的版本。 build.gradle 看起来像这样:

        dependencies {
        compile fileTree(dir: 'libs', include: '*.jar')
        compile 'com.google.code.gson:gson:2.3.1'
    }
    
    
    android {
        compileSdkVersion 18
        buildToolsVersion "22.0.1"
    
        defaultConfig {
            applicationId "com.sensodrive.vibrotac"
            minSdkVersion 10
            targetSdkVersion 10
        }
    

    我处理了 GATT SDK 问题,只是使用if(Build.VERSION.SDK_INT&gt;18) 处理所有使用 GATT 的问题。 因此,如果您有类似的问题,请尝试是否可以不增加 AndroidManifest.xml 中的 minSDK 版本,而只是在发生问题的地方处理 SDK 问题。可能不是最优雅的解决方案,但至少它有效......

    哦,还有一件事: 如果您不必更新到 v2.2,请不要这样做。 build.gradle 中的assembleDebug.finalizedBy(copyAPK) 行存在某种问题,即使有workaround,我也无法应用它。我想在官方解决此问题之前,最好还是继续使用旧版本。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多