Android Studio: small problem Summary

1, the configuration of the eclipse project into the android studio.

  Error: Your project contains C++ files but it is not using a supported native build system.

  In build.grade app plus sourceSets module BuildTypes in the {main {jni.src.Dirs = []}} 

 

  1.1, work computer gradle version 3.1.2, gradle plug-in version 4.4, a new activity will do nothing error, because the default configuration does not.

    You need to modify the support libraries and SDK versions. support and sdk library also has general relevance,

    According to information found eventlog error code paragraph, put the mouse on the error marked section, as will be prompted to why and how to change it.

 

2, ndk .so file generation step.

  First you need to install ndk, in the upper right corner of the SDK manager NDK AS interface to make a hook on the line.

  Then set about two mk file jni folder

  In build.grade app plus sourceSets module BuildTypes in the {main {jni.src.Dirs = []}}

  Then in the terminal debugging terminal into the jni folder where the file, enter ndk-build, so you can automatically create the files.

 

3, how to set a custom signature machine APP

  Figure 3.1 If the signature is incorrect, or no signature will be reported errors:

  Failed to finalize session : INSTALL_PARSE_FAILED_NO_CERTIFICATES: Package /data/app/vmdl540410799.tmp/0_dependencies has mismatched certificates at entry AndroidManifest.xml

  

  3.2 solve premise: there .keystore file, key store password, key alias, key password

  Solving steps: build → generate signed apk → Check remember two buttons, then click Finish will automatically compile

       → project structure → app → signing fill in the information box → buildtypes in signing the signature on the election config just set.

 

4、关于Activity.finish()、Activity.onDestory()、System.exit(0)

  4.1, finish () function is equivalent to the back button to end the current acticity, but did not release activity and memory resources;

  4.2, onDestory () end of the current activity and free up memory resources;

  4.3, System.exit (0) to end the current application and release memory resources;

 

5, when drawing btn custom xml with drawable, right-drawable folder, and will not pop up a small box selector when new a new drawable resource file, but the pop-large sash New Resource File.

  I do not know why, but we can put it differently to create a new selector xml file.

  In the right-res layer, new a Andrioid Resource File, and then in the pop-up box in the grid resource type selected drawable, give the file a name, it will generate a seletor of the .xml.

  Then when the next draw btn custom xml, but also directly through a new selecotr right new or shape, layer-list up.

 

 

 

ps1: This is a make your detours JNI / NDK tutorial examples  https://blog.csdn.net/kisty_yao/article/details/79466396

ps2: Android NDK video https://www.youtube.com/watch?v=BWLOas4nojY

ps3: Use Stacktrace exception processing (here, various example)  https://blog.csdn.net/u012585964/article/details/51772622

ps4:彻底解决unable to find valid certification path to requested target   https://blog.csdn.net/gabriel576282253/article/details/81531746

 

Guess you like

Origin www.cnblogs.com/caesura-k/p/11694715.html