• 新建安卓项目中的各种问题


    1setting.gradle

    pluginManagement {
        repositories {
            gradlePluginPortal()
            google()
            mavenCentral()
        }
    }
    dependencyResolutionManagement {
        repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
        repositories {
            google()
            maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
        }
    }

    编译报错:

    What went wrong:
    Execution failed for task ':app:mergeDebugNativeLibs'.
    > Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'.
       > Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven repository 'maven(http://maven.aliyun.com/nexus/content/groups/public/)' to redirect to a secure protocol (like HTTPS) or allow insecure protocols. See https://docs.gradle.org/7.3.3/dsl/org.gradle.api.artifacts.repositories.UrlArtifactRepository.html#org.gradle.api.artifacts.repositories.UrlArtifactRepository:allowInsecureProtocol for more details. 

    如何修改:

    pluginManagement {
        repositories {
            gradlePluginPortal()
            google()
            mavenCentral()
        }
    }
    dependencyResolutionManagement {
        repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
        repositories {
            google()
            mavenCentral()
        }
    }

    2 安卓打印有很多种

     cPP :https://blog.csdn.net/jjwwmlp456/article/details/89320343

    3 安卓代码如何触发nativeactivity的回调:

    extern "C" JNIEXPORT void ANativeActivity_onCreate(ANativeActivity *activity,
                                                       void *savedState,
                                                       size_t savedStateSize) {
    
      activity->callbacks->onStart = onStart;
      activity->callbacks->onResume = onResume;
      activity->callbacks->onSaveInstanceState = onSaveInstanceState;
      activity->callbacks->onPause = onPause;
      activity->callbacks->onStop = onStop;
      activity->callbacks->onDestroy = onDestroy;
      activity->callbacks->onWindowFocusChanged = onWindowFocusChanged;
      activity->callbacks->onNativeWindowCreated = onNativeWindowCreated;
      activity->callbacks->onNativeWindowResized = onNativeWindowResized;
      activity->callbacks->onNativeWindowRedrawNeeded = onNativeWindowRedrawNeeded;
      activity->callbacks->onNativeWindowDestroyed = onNativeWindowDestroyed;
      activity->callbacks->onInputQueueCreated = onInputQueueCreated;
      activity->callbacks->onInputQueueDestroyed = onInputQueueDestroyed;
      activity->callbacks->onContentRectChanged = onContentRectChanged;
      activity->callbacks->onConfigurationChanged = onConfigurationChanged;
      activity->callbacks->onLowMemory = onLowMemory;
    
    
    }
    

    3.1注意activity的继承关系是NativeActivity

    public class MainActivity extends NativeActivity 
    继承 NativeActivity  不是app activity

    3.2 如果设置了页面跳转,由MainActivity extends AppCompatActivity跳到NativeActivity,manifest.xml(一定要加,否则会闪退)

      <meta-data
                    android:name="android.app.lib_name"
                    android:value="native-activity" />

    -------------------------------------------------------
    <activity android:name=".CCActivity" 
    android:exported="true">
    <intent-filter>
    <action android:name="android.intent.action.MAIN" />

    <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    </activity>

     。。。。。持续更新中

  • 相关阅读:
    依靠MySQL(frm、MYD、MYI)数据文件恢复
    Centos7.4.1708安装Jumpserver
    Ubuntu16.04安装vmware pro 15激活码
    AIX系统命令
    virtualbox迁移虚拟机
    RedHat Enterprise7 搭建ISCSI
    RedHat Enterprise7 修改为CentOS的yum源
    关于Server2008 R2日志的查看
    Centos7.4.1708搭建syslog服务
    ElasticSearch第四步-查询详解
  • 原文地址:https://www.cnblogs.com/8335IT/p/16602150.html
Copyright © 2020-2023  润新知