duanhan4763 2015-09-21 15:17
浏览 42

未显示使用gomobile构建的android应用的启动器图标

I have a networking app, written in Go. Since Go 1.5 I can build it also for android devices with almost no changes using gomobile working fine.

But I can't change default android icon of app.

I'm building app with custom manifest file:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="name.app" android:installLocation="auto"
 android:versionCode="1" android:versionName="1.0-alpha">
    <uses-sdk android:minSdkVersion="9" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="18" />

    <application android:label="name.app" android:debuggable="true" android:icon="@assets/ic_launcher" android:persistent="true">
        <activity android:name="org.golang.app.GoNativeActivity" android:configChanges="orientation|keyboardHidden"
         android:alwaysRetainTaskState="true" android:launchMode="singleTask">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <meta-data android:name="android.app.lib_name" android:value="name.app" />
        </activity>
    </application>
</manifest>

and trying to place icon png file(s) in assets subdirectory:

.
├── *.go
├── AndroidManifest.xml
└── assets
    ├── drawable-hdpi
    │   └── ic_launcher.png
    ├── drawable-mdpi
    │   └── ic_launcher.png
    ├── drawable-xhdpi
    │   └── ic_launcher.png
    ├── drawable-xxhdpi
    │   └── ic_launcher.png
    ├── drawable-xxxhdpi
    │   └── ic_launcher.png
    └── ic_launcher.png

Instead of android:icon="@assets/ic_launcher" I've also tried android:icon="@drawable/ic_launcher" and android:icon="@assets/drawable/ic_launcher" without any results.

Any solution?

note: gomobile have only assets directory as a place for custom files.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 matlab中使用gurobi时报错
    • ¥15 WPF 大屏看板表格背景图片设置
    • ¥15 这个主板怎么能扩出一两个sata口
    • ¥15 不是,这到底错哪儿了😭
    • ¥15 2020长安杯与连接网探
    • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
    • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
    • ¥16 mybatis的代理对象无法通过@Autowired装填
    • ¥15 可见光定位matlab仿真
    • ¥15 arduino 四自由度机械臂