.
报错信息 :
-- Message Make :
Information:Compilation completed with 1 error and 0 warnings in 2 sec Information:1 error Information:0 warnings Error:Android Source Generator: [MidiScope] AndroidManifest.xml file not found
-- Event Log :
上午8:41:38 Compilation completed with 1 error and 0 warnings in 2 sec
解决方案 :
-- 选择 右键点击工程, 选择 Open Module Settings :
-- 配置 AndroidManifest 路径 :
(1) 报错信息
报错信息 :
-- Message Make :
Information:Using javac 1.8.0_45 to compile java sources Information:Compilation completed with 5 errors and 0 warnings in 3 sec Information:5 errors Information:0 warnings /Users/hanshuliang/Downloads/MidiScope/Application/src/main/AndroidManifest.xml Error:(27, -1) Android Resource Packaging: [MidiScope] /Users/hanshuliang/Downloads/MidiScope/Application/src/main/AndroidManifest.xml:27: error: Error: No resource found that matches the given name (at 'icon' with value '@mipmap/ic_launcher'). Error:(27, -1) Android Resource Packaging: [MidiScope] /Users/hanshuliang/Downloads/MidiScope/Application/src/main/AndroidManifest.xml:27: error: Error: No resource found that matches the given name (at 'label' with value '@string/app_name'). Error:(27, -1) Android Resource Packaging: [MidiScope] /Users/hanshuliang/Downloads/MidiScope/Application/src/main/AndroidManifest.xml:27: error: Error: No resource found that matches the given name (at 'theme' with value '@style/MidiScopeTheme'). Error:(33, -1) Android Resource Packaging: [MidiScope] /Users/hanshuliang/Downloads/MidiScope/Application/src/main/AndroidManifest.xml:33: error: Error: No resource found that matches the given name (at 'label' with value '@string/app_name'). Error:(48, -1) Android Resource Packaging: [MidiScope] /Users/hanshuliang/Downloads/MidiScope/Application/src/main/AndroidManifest.xml:48: error: Error: No resource found that matches the given name (at 'resource' with value '@xml/scope_device_info').
解决方案 :
-- 选择 右键点击工程, 选择 Open Module Settings :
-- 配置 资源路径 路径 :
报错信息 :
12-08 16:39:31.105 15700-15700/cn.zkhw.midi E/AndroidRuntime: FATAL EXCEPTION: main java.lang.RuntimeException: Unable to start activity ComponentInfo{cn.zkhw.midi/cn.zkhw.midi.slide.MainActivity}: java.lang.IllegalStateException: This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_SUPPORT_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead. at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2297) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2351) at android.app.ActivityThread.access$700(ActivityThread.java:161) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1318) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:177) at android.app.ActivityThread.main(ActivityThread.java:5426) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1225) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1041) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.IllegalStateException: This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_SUPPORT_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead. at android.support.v7.app.AppCompatDelegateImplV7.setSupportActionBar(AppCompatDelegateImplV7.java:198) at android.support.v7.app.AppCompatActivity.setSupportActionBar(AppCompatActivity.java:99) at cn.zkhw.midi.slide.MainActivity.onCreate(MainActivity.java:28) at android.app.Activity.performCreate(Activity.java:5372) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2259) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2351)? at android.app.ActivityThread.access$700(ActivityThread.java:161)? at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1318)? at android.os.Handler.dispatchMessage(Handler.java:99)? at android.os.Looper.loop(Looper.java:177)? at android.app.ActivityThread.main(ActivityThread.java:5426)? at java.lang.reflect.Method.invokeNative(Native Method)? at java.lang.reflect.Method.invoke(Method.java:525)? at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1225)? at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1041)? at dalvik.system.NativeStart.main(Native Method)? 12-08 16:39:32.815 15700-15700/cn.zkhw.midi I/Process: Sending signal. PID: 15700 SIG: 9
解决方案 :
-- 出错原因 : 使用 ToolBar 后, 原有的 ActionBar 没有取消, 两个导航栏都出现就出现了上述错误;
-- 设置一个 style :
<style name="AppTheme.NoActionBar"> <item name="windowActionBar">false</item> <item name="windowNoTitle">true</item> </style>-- 将这个 style 设置给 Activity : android :theme= "@style/AppTheme.NoActionBar"
<activity android:name=".MainActivity" android:label="@string/app_name" android:theme="@style/AppTheme.NoActionBar"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity>
报错信息 :
FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':library:compileReleaseAidl'. > aidl is missing * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Total time: 0.651 secs
解决方案 :
-- 错误原因 : SDK 文件不全, 换一个 SDk 重新编译即可通过;
-- 原来的 SDK 查看 : 右键点击工程, 选择 "Open Module Setting" ;
-- 编译设置 : 由此可见 22 5.1 的 SDK 是不完整的;
-- 更换 SDK 即可完成编译 : 注意 SDK 版本 和 编译工具的版本必须对应;
.
.
.