小编gur*_*ack的帖子

错误:包 com.nguyenhoanglam.imagepicker.activity 不存在

没有编译器错误。我在运行时收到此错误。

error: package com.nguyenhoanglam.imagepicker.activity does not exist
Run Code Online (Sandbox Code Playgroud)

我在我的项目中使用了许多库。图书馆链接:

https://github.com/nguyenhoanglam/ImagePicker

  • 我添加了滑动库
  • 将 compileSdkVersion 和 targetSdkVersion 从 28 更改为 29。
  • 将项目迁移到 AndroidX

改之前没有问题。

项目摇篮:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()
        maven { url 'https://maven.google.com' }
        maven { url "https://jitpack.io"}

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.4'

        //classpath 'com.google.gms:google-services:1.3.0-beta1'
        classpath 'com.google.gms:google-services:4.3.3'



        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
} …
Run Code Online (Sandbox Code Playgroud)

java android github gradle

8
推荐指数
1
解决办法
506
查看次数

Admob 原生广告中的可点击区域

我想了解 admob 原生广告政策。

他们在政策中说

确保空白(或背景图像)不可点击。

  • 只有广告标题、URL、CTA 和非背景图像资源应该是可点击的。
  • 检查您不打算放置的文本周围是否有额外的空白。
  • 用于显示原生广告资源的 TextView 与其他资源相同,因此您可以使用正常的布局技术来格式化它们。

例如,您可以使用wrap_content属性值来确保您的TextView不会扩展超出显示文本所需的大小。

https://support.google.com/admob/answer/6240814?hl=zh-CN&ref_topic=7384666

我想确定哪些元素是可点击的?哪些元素不可点击?

在此输入图像描述

我的想法是什么?我认为...

1:不可点击

2:可点击

3:可点击

4:可点击

5:可点击

6:不可点击-现实:这里有问题!Admob 未通过其政策中的评级,但可在其自定义 .xib 文件中单击。

只有广告标题、URL、CTA 和非背景图像资源应该是可点击的。

7:不可点击-现实:这里有问题!Admob 不会在其策略中传递正文,但可以在其自定义 .xib 文件中单击正文。

只有广告标题、URL、CTA 和非背景图像资源应该是可点击的。

8:可点击

你怎么认为?我对吗?根据 Admob 政策,评级或正文是否可点击?

请按照以下格式回答我的问题:

1: CLICKABLE or NOT CLICKABLE
2: CLICKABLE or NOT CLICKABLE
3: CLICKABLE or NOT CLICKABLE
4: CLICKABLE or NOT CLICKABLE
5: CLICKABLE or NOT CLICKABLE
6: CLICKABLE or NOT CLICKABLE
7: CLICKABLE or …
Run Code Online (Sandbox Code Playgroud)

android admob ios flutter native-ads

7
推荐指数
1
解决办法
1404
查看次数

Webview.loadData无法在8.1和9.0上运行

我有一个文章应用程序,我在webview中显示文章.在Android版本8.1和9.0中这个webview无法正常工作.该应用程序在文章活动中显示NOTHING.

            mWebView.setVisibility(View.VISIBLE);

            mWebView.getSettings().setJavaScriptEnabled(true);
            mWebView.getSettings().setLoadWithOverviewMode(true);
            mWebView.getSettings().setUseWideViewPort(true);

            mWebView.getSettings().setMinimumFontSize(14);

            String htmlContent = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"
                               + "<head>"
                               + "<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />"
                               + "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>"
                               + "<style type=\"text/css\">body{color: #525252;} img {max-width: 100%; height: auto}</style>"
                               + "</head>"
                               + item.getContent() //content of item
                               + "";

            mWebView.loadData(htmlContent, "text/html; charset=utf-8", "UTF-8");
Run Code Online (Sandbox Code Playgroud)

结果,我该如何解决这个问题?

java android webview android-webview android-9.0-pie

6
推荐指数
3
解决办法
2292
查看次数

如何为App Store添加关联的域?-App Store Connect的app-ads.txt文件

如您所知,Admob向发布商发送了有关app-ads.txt文件的电子邮件。在电子邮件中,Admob说

因此,如果您已经在发布日期之前发布了app-ads.txt文件,我们邀请您仔细检查它。该文件应发布在您的Android Play商店或iOS App Store列表中列出的网站的根目录中

实际上,我可以在域根文件中成功添加新的app-ads.txt文件,对于我的Google Play应用,我可以在Admob面板中看到绿色圆圈。

Google Play应用程序亮绿灯

另一方面,对于我的iPhone应用程序,我找不到如何将网站添加到“应用程序商店列表”页面。

我将app-ads.txt文件添加到了域根目录,但是我不知道如何将该域与我的App Store应用程序关联。

如何将我的域名(URL)与我的App Store应用相关?我找不到像

网站

要么

在App Store Connect中。

android admob ios

6
推荐指数
1
解决办法
380
查看次数

如何创建对象并在 Objective-C 中使用它?

我正在为我的游戏使用 Buildbox。我实施了自定义激励广告。问题是当奖励视频打开时游戏音乐会继续。我想在观看视频后静音和取消静音。

我知道 Java,但我不擅长 Objective-C 和 Cocos2dx。

我的AudioEngine.h类:在 libs/cocos2dx/include/audio/include/ 下

/****************************************************************************
 Copyright (c) 2014-2015 Chukong Technologies Inc.

 http://www.cocos2d-x.org

 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
 in the Software without restriction, including without limitation the rights
 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the Software is
 furnished to do …
Run Code Online (Sandbox Code Playgroud)

objective-c objective-c-2.0 ios cocos2d-x buildbox

6
推荐指数
3
解决办法
380
查看次数

如何跟踪歌曲何时完成 AVAudioPlayer

我想在播放歌曲时进行跟踪。我尝试了网络上的不同解决方案,但他们无法解决我的问题。我实现了audioPlayerDidFinishPlaying方法,但它不起作用。我怎么知道播放歌曲是否完成?

我正在播放带有playSound功能的歌曲

播放声音 功能:

func playSound(name: String ) {
    guard let url = Bundle.main.url(forResource: name, withExtension: "mp3") else {
        print("url not found")
        return
    }

    do {
        /// this codes for making this app ready to takeover the device audio
        try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback)
        try AVAudioSession.sharedInstance().setActive(true)

        /// change fileTypeHint according to the type of your audio file (you can omit this)
        player = try AVAudioPlayer(contentsOf: url, fileTypeHint: AVFileTypeMPEGLayer3)
        // no need for prepareToPlay because prepareToPlay is happen automatically when …
Run Code Online (Sandbox Code Playgroud)

avaudioplayer audio-player ios swift swift3

3
推荐指数
1
解决办法
2487
查看次数

如何在Flutter中制作Alert Dialog晃动动画

我想像这样摇动警报对话框:(不仅是文本,还有整个弹出对话框)

https://www.youtube.com/watch?v=IaHMoifUBSw

当用户单击按钮时,如何震动整个警报对话框?

dart flutter flutter-layout flutter-animation flutter-alertdialog

3
推荐指数
1
解决办法
1380
查看次数

我收到“在构建期间调用 setState() 或 markNeedsBuild()”。错误

我试图在无状态小部件中调用一个方法,但它给出了错误。

X级:

class X extends StatelessWidget { 
  const X({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Divider(height: 5,),

          ListTile(
            title: Text('X').tr(),
            leading: Container(
              height: 30,
              width: 30,
              decoration: BoxDecoration(
                color: Colors.red,
                borderRadius: BorderRadius.circular(5)
              ),
              child: Icon("x", size: 20, color: Colors.white),
            ),
            trailing: Icon("x", size: 20,),
         
            onTap: _openDialog(context),//This line is problematic! If I remove this line, it does not give any error.
          ),
      ],
    );
  }

   _openDialog(context) {
    return showDialog(
        barrierDismissible: true,
        context: context,
        builder: …
Run Code Online (Sandbox Code Playgroud)

setstate dart flutter flutter-layout

2
推荐指数
1
解决办法
9124
查看次数

我收到“查找已停用小部件的祖先是不安全的”。错误

当用户单击按钮时,我试图从 firebase 中删除数据。

await context线路有问题!

class SecurityOption extends StatelessWidget {//StatelessWidget
  const SecurityOption({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Divider(
          height: 3,
        ),
        ListTile(
          title: Text('security').tr(),
          leading: Container(
            height: 30,
            width: 30,
            decoration: BoxDecoration(
                color: Colors.red, borderRadius: BorderRadius.circular(5)),
            child: Icon(Feather.lock, size: 20, color: Colors.white),
          ),
          trailing: Icon(
            Feather.chevron_right,
            size: 20,
          ),
          onTap: () => _openDeleteDialog(context),
        ),
      ],
    );
  }

  _openDeleteDialog(context) {
    return showDialog(
        barrierDismissible: true,
        context: context,
        builder: (context) {
          return AlertDialog(
            title: …
Run Code Online (Sandbox Code Playgroud)

ios dart flutter flutter-layout flutter-widget

0
推荐指数
1
解决办法
6241
查看次数