没有Launcher活动在Eclipse上发现错误 - Google Glass XE 18.11

时间:2014-06-16 06:36:00

标签: android eclipse google-glass

我试图运行以下

中的示例代码

https://github.com/googleglass/gdk-waveform-sample

我知道该示例是基于旧版本的,但我尝试使其与当前版本一起使用。

我正在

> [2014-06-15 23:16:45 - WaveformActivity] Android Launch! [2014-06-15
> 23:16:45 - WaveformActivity] adb is running normally. [2014-06-15
> 23:16:45 - WaveformActivity] No Launcher activity found! [2014-06-15
> 23:16:45 - WaveformActivity] The launch will only sync the application
> package on the device! [2014-06-15 23:16:45 - WaveformActivity]
> Performing sync

这是AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2013 Google Inc.

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.google.android.glass.sample.waveform"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="19"
        android:targetSdkVersion="19" />

    <uses-permission android:name="android.permission.RECORD_AUDIO"/>

    <application
        android:allowBackup="true"
        android:label="@string/app_name" >

        <activity
            android:name="com.google.android.glass.sample.waveform.WaveformActivity" >
            <intent-filter>
                <action android:name="com.google.android.glass.action.VOICE_TRIGGER" />
            </intent-filter>
            <meta-data android:name="com.google.android.glass.VoiceTrigger"
                android:resource="@xml/trigger_show_me_a_demo" />
        </activity>

    </application>

</manifest>

感谢您的帮助!

3 个答案:

答案 0 :(得分:1)

回答我自己的问题,基本上我必须在Manifest中添加以下行:

<uses-permission android:name="com.google.android.glass.permission.DEVELOPMENT" />

答案 1 :(得分:0)

您没有主要活动,只有语音触发器。

因此,要运行您的应用程序,您需要通过&#34; ok,glass&#34; - &GT; &#34;给我演示一个演示&#34; 语音触发器。

另外,如果你想从eclipse(不是Glassware方式)自动运行应用程序,你应该设置一个Main活动添加意图过滤器:

 <activity  android:name="com.google.android.glass.sample.waveform.WaveformActivity" >
      <intent-filter>
         <action android:name="android.intent.action.MAIN" />
     <category android:name="android.intent.category.LAUNCHER" />
         <action android:name="com.google.android.glass.action.VOICE_TRIGGER" />
      </intent-filter>
            <meta-data android:name="com.google.android.glass.VoiceTrigger"
                android:resource="@xml/trigger_show_me_a_demo" />
 </activity>

并在Project Launch配置中设置此主要活动。在项目运行方式 - &gt;运行配置。选择&#34;启动&#34;和你的主要活动。在这种情况下,WaveformActivity。

请检查: Google Glass Sample APKs

答案 2 :(得分:-1)

您需要添加清单文件

<intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>