将您的借记卡 SHA1 证书指纹转移给第三方会带来什么问题?
主页
/
user-180957
iramm's questions
Android Studio 已停止工作。加载工作室并打开另一个项目并尝试同步项目时,弹出错误:
项目刷新失败错误:C:\Users\??????.gradle\native\23\windows-i386\native-platform.dll: 找不到依赖库
从发送给谷歌的日志中:
Could not initialize class com.sun.jna.Native
java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native
at com.intellij.util.text.DateFormatUtil.getWindowsFormats(DateFormatUtil.java:433)
at com.intellij.util.text.DateFormatUtil.getDateTimeFormats(DateFormatUtil.java:335)
at com.intellij.util.text.DateFormatUtil.<clinit>(DateFormatUtil.java:59)
at com.intellij.openapi.wm.impl.status.StatusPanel$5.run(StatusPanel.java:218)
at com.intellij.openapi.wm.impl.status.StatusPanel.updateText(StatusPanel.java:225)
at com.intellij.openapi.wm.impl.status.InfoAndProgressPanel.setText(InfoAndProgressPanel.java:479)
at com.intellij.openapi.wm.impl.status.IdeStatusBarImpl.lambda$setInfo$3(IdeStatusBarImpl.java:465)
at com.intellij.util.ui.UIUtil.invokeLaterIfNeeded(UIUtil.java:2432)
at com.intellij.openapi.wm.impl.status.IdeStatusBarImpl.setInfo(IdeStatusBarImpl.java:463)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:117)
at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:377)
at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:364)
at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:350)
at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:343)
at com.intellij.util.messages.impl.MessageBusImpl.access$200(MessageBusImpl.java:42)
at com.intellij.util.messages.impl.MessageBusImpl$2.invoke(MessageBusImpl.java:226)
at com.sun.proxy.$Proxy103.setInfo(Unknown Source)
at com.intellij.openapi.wm.StatusBar$Info.set(StatusBar.java:57)
at com.intellij.openapi.wm.StatusBar$Info.set(StatusBar.java:43)
at com.intellij.ui.components.labels.LinkLabel.setStatusBarText(LinkLabel.java:273)
at com.intellij.ui.components.labels.LinkLabel.disableUnderline(LinkLabel.java:265)
at com.intellij.ui.components.labels.LinkLabel.removeNotify(LinkLabel.java:201)
at java.awt.Container.removeNotify(Container.java:2804)
at javax.swing.JComponent.removeNotify(JComponent.java:4758)
at java.awt.Container.removeNotify(Container.java:2804)
at javax.swing.JComponent.removeNotify(JComponent.java:4758)
at java.awt.Container.removeAll(Container.java:1297)
at com.intellij.openapi.wm.impl.status.InfoAndProgressPanel.buildInProcessCount(InfoAndProgressPanel.java:325)
at com.intellij.openapi.wm.impl.status.InfoAndProgressPanel.removeProgress(InfoAndProgressPanel.java:257)
at com.intellij.openapi.wm.impl.status.InfoAndProgressPanel.access$800(InfoAndProgressPanel.java:64)
at com.intellij.openapi.wm.impl.status.InfoAndProgressPanel$MyInlineProgressIndicator.lambda$finish$0(InfoAndProgressPanel.java:684)
at com.intellij.openapi.application.TransactionGuardImpl$6.run(TransactionGuardImpl.java:291)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:326)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:310)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:795)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:631)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:387)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
并进一步:
Could not initialize class com.sun.jna.Native
java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native
at com.sun.jna.platform.win32.WinDef$ULONGLONG.<clinit>(WinDef.java:843)
at com.intellij.ui.Win7TaskBar.<clinit>(Win7TaskBar.java:50)
at com.intellij.ui.AppIcon$Win7AppIcon._hideProgress(AppIcon.java:410)
at com.intellij.ui.AppIcon$BaseIcon.hideProgress(AppIcon.java:101)
at com.intellij.openapi.project.DumbServiceImpl$AppIconProgress.lambda$finish$1(DumbServiceImpl.java:561)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:795)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:631)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:387)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
并进一步:
Could not initialize class com.intellij.ui.Win7TaskBar
java.lang.NoClassDefFoundError: Could not initialize class com.intellij.ui.Win7TaskBar
at com.intellij.ui.AppIcon$Win7AppIcon._hideProgress(AppIcon.java:410)
at com.intellij.ui.AppIcon$BaseIcon.hideProgress(AppIcon.java:101)
at com.intellij.ui.AppIcon$BaseIcon$1.applicationActivated(AppIcon.java:150)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:117)
at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:377)
at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:364)
at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:343)
at com.intellij.util.messages.impl.MessageBusImpl.access$200(MessageBusImpl.java:42)
at com.intellij.util.messages.impl.MessageBusImpl$2.invoke(MessageBusImpl.java:226)
at com.sun.proxy.$Proxy73.applicationActivated(Unknown Source)
at com.intellij.ide.ApplicationActivationStateManager.setActive(ApplicationActivationStateManager.java:135)
at com.intellij.ide.ApplicationActivationStateManager.updateState(ApplicationActivationStateManager.java:83)
at com.intellij.ide.IdeEventQueue.processAppActivationEvents(IdeEventQueue.java:758)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:520)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:387)
at java.awt.SequencedEvent.dispatch(SequencedEvent.java:128)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:795)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:631)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:387)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
我最终重新安装了 Android Studio,但问题仍然存在。
在 Android Studio 中向 Git 添加新文件时,我错误地选中了“记住我的选择”复选框。现在所有需要和不需要的东西都被跟踪了。如何取消这个命令?
建议使用 Android Studio 的图形工具。
是否可以在 Android Studio 中运行main()
仅包含对标准 java 类的引用的简单 java 类的方法,而无需编译整个 Android 项目。
我有一个活动Toolbar
和FrameLayout
- 片段容器。片段之间的导航是使用兼容性库 (v7) 中的导航抽屉完成的。
工具栏上有一个汉堡包按钮,单击它会弹出一个 NavigationView - 选择一个片段 - 它会替换主片段 ( Fragment0
)。汉堡包按钮替换为向上按钮(向左箭头)。我希望当我们点击它时,我们返回到原始片段,并且当没有汉堡包按钮时侧边栏不会在滑动时爬出。但实际上,Up-button 只改变了它的外观,而没有改变行为——当你点击它时,会弹出一个侧边栏。
这是我的活动代码:
public class MainActivity extends AppCompatActivity {
private String[] mNumberTitles;
private DrawerLayout mDrawerLayout;
private ListView mDrawerList;
private Toolbar toolbar;
private ActionBarDrawerToggle mDrawerToggle;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
FragmentManager fragmentManager = getSupportFragmentManager();
Fragment fragment = fragmentManager.findFragmentById(R.id.fragment_container);
if (fragment == null) {
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction
.add( R.id.fragment_container, new Fragment0())
.commit();
}
mNumberTitles = getResources().getStringArray(R.array.numbers_array);
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
mDrawerList = (ListView) findViewById(R.id.left_drawer);
// Set the adapter for the list view
mDrawerList.setAdapter(new ArrayAdapter<String>(this,
R.layout.drawer_list_item, mNumberTitles));
// Set the list's click listener
mDrawerList.setOnItemClickListener(new DrawerItemClickListener());
initToolbar();
mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout,
toolbar, R.string.drawer_open, R.string.drawer_close);
// Set the drawer toggle as the DrawerListener
mDrawerLayout.addDrawerListener(mDrawerToggle);
mDrawerToggle.syncState();
// заменяем гамбургер на Up button во второстепенных фрагментах
fragmentManager.addOnBackStackChangedListener(new FragmentManager.OnBackStackChangedListener() {
@Override
public void onBackStackChanged() {
if (getSupportFragmentManager().getBackStackEntryCount() > 0) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
} else {
getSupportActionBar().setDisplayHomeAsUpEnabled(false);
mDrawerToggle.syncState();
}
}
});
}
private void initToolbar() {
toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
}
/** Swaps fragments in the main content view */
private void selectItem(int position) {
Fragment fragment = null;
switch (position) {
case 0 : fragment = new Fragment0();
break;
case 1 : fragment = new Fragment1();
break;
case 2 : fragment = new Fragment2();
break;
default: fragment = new Fragment0();
break;
}
FragmentManager fragmentManager = getSupportFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.replace(R.id.fragment_container, fragment)
.addToBackStack(null)
.commit();
// Highlight the selected item, update the title, and close the drawer
mDrawerList.setItemChecked(position, true);
setTitle(mNumberTitles[position]);
mDrawerLayout.closeDrawer(mDrawerList);
}
private void setTitle(String title) {
if (toolbar != null)
toolbar.setTitle(title);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home: // it's for up button
Log.d("!!!!!!!!!", "HOMe button is pressed");
getSupportFragmentManager().popBackStack();
return true;
default:
break;
}
return super.onOptionsItemSelected(item);
}
private class DrawerItemClickListener implements ListView.OnItemClickListener {
@Override
public void onItemClick(AdapterView parent, View view, int position, long id) {
selectItem(position);
}
}
}
按下向上按钮(日志为空)时,我们不会进入方法onOptionsItemSelected(MenuItem item)
( )。case android.R.id.home:
我究竟做错了什么?