Thursday 25 February 2016

Errors occur when I building project

Picture 

I go a strange error when I build my Pirateproject,the error is like this:
Can't find /.../app/build/intermediates/res/debug/mipmap/ic_launcher.png
Error:Execution failed for task ': app:processDebugResources'.
com.android.ide.common.process.ProcessException:
org.gradle.process.internal.ExecException:Process 'command '/.../sdk/build-tools/22.0.1/aapt'' finished with non-zero exit value 1 
-I tried to clean my project and rebuild, it dosen't work.
-I tried to launch the assembleDebug for project, and I rebuilt, it dosen't work for me.
-I tried to rename a picture to ic_launcher.png, no.
-Last time I notice that it marks "@mipmap/ic_launcher.png", so I create some  folders likes this and make assure in these folders there are ic_launcher.png:

So it works.



SQLite

I have an error like this(no such table: X):

I confuse the DATABASE NAME and TABLE NAME, database name is declared here
And table name (tWORD)is declared here: 
When insert data in to table, I should point out the table name instead of database name.


And if I add a column after the table having been created, I should add a function of onUpgrade at Class DBHelp(which extend SQLiteOpenHelp), or an other error like no column :X in table Y.  
->Firsty change the private static final int DATABASE_VERSIO
->then and if(newVersion > oldVersion){//execute a cmd of SQLdb.execSQL("ALTER TABLE TABLE_NAME ADD COLUMN COLUMN_NAME TYPE DEFAUT VALUE");

Manifest

When I try to run a class (not main Activity), the logcat told me:



It means that I should add this class to manifest.xml:

then it works.


No comments:

Post a Comment