Error: Avoid hardcoding the debug mode; leaving it out allows debug and release builds to automatically assign one [HardcodedDebugMode]
解決方案:
AndroidMainfest.xml 去掉 android:debuggable="true"The number of method references in a .dex file cannot exceed 64K. Error
解決方案:
首先app的 build.gradle 中
(1)在dependencies 中添加
compile'com.android.support:multidex:1.0.1'
(2)在 defaultConfig 中添加
multiDexEnabled true
(3)在 AndroidManifest.xml 中的 application 標(biāo)簽中添加
<application
...
android:name="android.support.multidex.MultiDexApplication"
...
</application>
(4)如果你的應(yīng)用程序繼承 Application , 那么你需要重寫Application attachBaseContext方法
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this) ;
}
- "java.lang.OutOfMemoryError: GC overhead limit exceeded"
在build.gradle, Andoird{}內(nèi)加入
dexOptions{
incremental false
javaMaxHeapSize "2048M"
preDexLibraries = false
}
- 在用 Unity 編譯 Android 平臺(tái)的應(yīng)用時(shí)鸡典,遇到 Unable to list target platforms 的問題赢织。
Unity 在編譯時(shí)會(huì)調(diào)用 Android SDK tools 中的 android 命令,而在新版本的 Android SDK tools 中竖螃,android這個(gè)命令已經(jīng)廢棄了,導(dǎo)致 Unity 無(wú)法正常編譯句伶。
從官網(wǎng)下載一個(gè)舊版本的 Android SDK tools 篮撑。tools_r25.2.3-windows.zip。
把原來(lái) SDK 目錄下的 tools 備份一下流济。我是把它重命名成 tools-25.3.1 锐锣。
把下載好的舊版本的 tools 解壓到 SDK 目錄下腌闯。
再在 Unity 中重新編譯,問題已經(jīng)解決了雕憔。
找不到主題:
compile 'com.android.support:appcompat-v7:23.1.1'